From 8f95b06aabd866230198d7da5ce57f3f95c9155f Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 3 Sep 2008 09:37:20 +0000 Subject: [PATCH] MDL-16263 Flagging questions during a quiz attempt. Submit all and finish was nuking flag states. Fix that. --- mod/quiz/processattempt.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/quiz/processattempt.php b/mod/quiz/processattempt.php index 6dcf9669fd2..e1a1d1e9612 100644 --- a/mod/quiz/processattempt.php +++ b/mod/quiz/processattempt.php @@ -173,11 +173,12 @@ $attemptobj->load_question_states(); $success = true; $attempt = $attemptobj->get_attempt(); foreach ($attemptobj->get_questions() as $id => $question) { + $state = $attemptobj->get_question_state($id); $action = new stdClass; $action->event = QUESTION_EVENTCLOSE; - $action->responses = $attemptobj->get_question_state($id)->responses; - $action->timestamp = $attemptobj->get_question_state($id)->timestamp; - $state = $attemptobj->get_question_state($id); + $action->responses = $state->responses; + $action->responses['_flagged'] = $state->flagged; + $action->timestamp = $state->timestamp; if (question_process_responses($attemptobj->get_question($id), $state, $action, $attemptobj->get_quiz(), $attempt)) { save_question_session($attemptobj->get_question($id), $state);