Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.4
-
Fix Version/s: 1.9.8
-
Component/s: Quiz
-
Labels:None
-
Environment:PHP 5.2.8 on Apache 2/RedHat Linux. MSSQL backend on IIS.
-
Database:Microsoft SQL
-
Difficulty:Moderate
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
When a teacher goes to view the answers to essay questions in a quiz, they can't see the student's answer when they first pull up the page (e.g. /mod/quiz/reviewquestion.php?state=1031944&number=53 ).
However, if they click on the edit button (on the upper left), and then click cancel on the following page, the answer is then shown. I tried debugging the script, but haven't been able to find where the essay answers are being loaded, and why they wouldn't be loaded initially.
I've attached a couple of screenshots to illustrate the problem.
Attachments
Issue Links
| This issue has a non-specific relationship to: | ||||
| MDL-9327 | Text in Essay type questions is not saved in second or more attempts when the teacher has not graded previous attempts |
|
|
|
I found if I changed the function quiz_get_newgraded_states() (in /mod/quiz/report/reportlib.php) SQL from:
$gradedstatesql = "SELECT $fields FROM " .
"{$CFG->prefix}question_sessions qns, " .
"{$CFG->prefix}question_states qs " .
"WHERE qns.attemptid IN ($attemptidlist) AND " .
"qns.newgraded = qs.id";
to
$gradedstatesql = "SELECT $fields FROM " .
"{$CFG->prefix}question_sessions qns, " .
"{$CFG->prefix}question_states qs " .
"WHERE qns.attemptid IN ($attemptidlist) AND " .
"qns.newest = qs.id";
It fixes the problem. However, the function is named quiz_getnewgraded_states, which makes me think it's supposed to return values based on the newgraded column, not the newest column, so I'm hesitant to submit this change back.