diff --git a/mod/quiz/comment.php b/mod/quiz/comment.php index fcb7578d43d..9d55b4092bc 100644 --- a/mod/quiz/comment.php +++ b/mod/quiz/comment.php @@ -33,6 +33,7 @@ $cmid = optional_param('cmid', null, PARAM_INT); $PAGE->set_url('/mod/quiz/comment.php', array('attempt' => $attemptid, 'slot' => $slot)); $attemptobj = quiz_create_attempt_handling_errors($attemptid, $cmid); +$attemptobj->preload_all_attempt_step_users(); $student = $DB->get_record('user', array('id' => $attemptobj->get_userid())); // Can only grade finished attempts. diff --git a/mod/quiz/tests/behat/manually_mark_question.feature b/mod/quiz/tests/behat/manually_mark_question.feature index 10df50b062c..755e824109e 100644 --- a/mod/quiz/tests/behat/manually_mark_question.feature +++ b/mod/quiz/tests/behat/manually_mark_question.feature @@ -28,9 +28,7 @@ Feature: Teachers can override the grade for any question And quiz "Quiz 1" contains the following questions: | question | page | | TF1 | 1 | - And I log in as "student1" - And I am on "Course 1" course homepage - And I am on the "Quiz 1" "mod_quiz > View" page + And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1" And I press "Attempt quiz now" And I follow "Finish attempt ..." And I press "Submit all and finish" @@ -39,8 +37,7 @@ Feature: Teachers can override the grade for any question @javascript @_switch_window @_bug_phantomjs Scenario: Validating the marking of an essay question attempt. - When I log in as "teacher1" - And I am on the "Quiz 1 > student1 > Attempt 1" "mod_quiz > Attempt review" page + When I am on the "Quiz 1 > student1 > Attempt 1" "mod_quiz > Attempt review" page logged in as "teacher1" And I follow "Make comment or override mark" And I switch to "commentquestion" window And I set the field "Mark" to "25" @@ -52,8 +49,9 @@ Feature: Teachers can override the grade for any question And I set the field "Mark" to "10.0" And I press "Save" and switch to main window And I should see "Complete" in the "Manually graded 10 with comment: " "table_row" - # This time is same as time the window is open. So wait for it to close before proceeding. - And I wait "2" seconds + And I follow "Make comment or override mark" + And I switch to "commentquestion" window + And I should see "Teacher 1" in the "Manually graded 10 with comment: " "table_row" @javascript @_switch_window @_file_upload @_bug_phantomjs Scenario: Comment on a response to an essay question attempt.