Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grader message res-education code issue, lowercase matches an id field #41

Open
srcatto opened this issue Sep 16, 2021 · 3 comments
Open

Comments

@srcatto
Copy link
Contributor

srcatto commented Sep 16, 2021

Will create PR when ready, will need to test match text, in the id as below.
https://www.wa4e.com/solutions/res-education/add.php
After adding a record the flash message / redirect to index.php is 'Profile added' this appears to create a false positive message,

Expecting 'added'
Test passed: Found success message after add
Looking 'Confirms' entry in index.php

as the HTML did not redirect to index, there should be no match, as no flash message. However 'added' appears to be found in a short match, while still on add.php, in the id value 'addEdu'

<p>
Education: <input type="submit" id="addEdu" value="+">
<div id="edu_fields">
@csev
Copy link
Owner

csev commented Mar 24, 2022

Yikes - I missed this one - is it fixed?

@srcatto
Copy link
Contributor Author

srcatto commented Oct 21, 2022

Ouch, don't close browser tab before saving comment.
It's the common wa4e/tools/autograder/crud.php
line 146 - if ( strpos(strtolower($html), 'added') !== false ) {
On 1st check,
course 4 JSON/JQuery - weeks 1 res-profile, 3 res-position & 4 res-education, the output message is "Profile added"
course 3 BuildDB - week 5 autoscrud the output message is "Record added"
So the check is only for "added" and on a code fail, it finds the id as mentioned.

Changing the id is likely the sample code, lectures. Or if crud.php could use a variable from autoscrud, res-profile, res-position, res-education.php initialization. So autoscrud is $expected_message = "Record added"; and crud.php
if ( strpos(strtolower($html), $expected_message) !== false )
with the 3 x res using $expected_message = "Profile added";
possibly then remove the strtolower?

Before this course 3 w4 autosess and w2 autosdb use "Record inserted" but that is not tested.

@srcatto
Copy link
Contributor Author

srcatto commented May 30, 2023

Please review, as the match is only 'added' in lowercase. Course 4 uses "Profile added" and course 3 is "Record added". The generic CRUD grader would need to know which course to match with the string. It would not be right to make course 4 "Record added" either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants