From f23f98dd63ad68b22d260cd3f9acbec9a93bbd63 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 4 Aug 2010 18:56:51 +0000 Subject: [PATCH] question flags MDL-22643 Manually commenting should not reset the flag state. --- lib/questionlib.php | 1 + mod/quiz/attemptlib.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index 58b5155eee0..fbecc814fc8 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1943,6 +1943,7 @@ function question_process_comment($question, &$state, &$attempt, $comment, $grad // Update the comment and save it in the database $comment = trim($comment); $state->manualcomment = $comment; + $state->newflaggedstate = $state->flagged; if (!$DB->set_field('question_sessions', 'manualcomment', $comment, array('attemptid'=>$attempt->uniqueid, 'questionid'=>$question->id))) { return get_string('errorsavingcomment', 'question', $question); } diff --git a/mod/quiz/attemptlib.php b/mod/quiz/attemptlib.php index 30d66ce3141..20540add13d 100644 --- a/mod/quiz/attemptlib.php +++ b/mod/quiz/attemptlib.php @@ -462,7 +462,7 @@ class quiz_attempt extends quiz { * Static function to create a new quiz_attempt object given an attemptid. * * @param integer $attemptid the attempt id. - * @return object the new quiz_attempt object + * @return quiz_attempt the new quiz_attempt object */ static public function create($attemptid) { global $DB;