]> git.mjollnir.org Git - moodle.git/commitdiff
Minor updates:
authormark-nielsen <mark-nielsen>
Sat, 8 Apr 2006 21:46:59 +0000 (21:46 +0000)
committermark-nielsen <mark-nielsen>
Sat, 8 Apr 2006 21:46:59 +0000 (21:46 +0000)
  comments no longer print inside the question (only in the textfield)
  fixed problem with quotes by adding addslashes

mod/quiz/report/grading/report.php

index e922f4031add366c3fbc2c68ba47bf344a99ff1d..819854896826c653ebaca7cd01ad15b63af0001d 100644 (file)
@@ -71,6 +71,7 @@ class quiz_report extends quiz_default_report {
 
                 // If the state has changed save it and update the quiz grade
                 if ($state->changed) {
+                    $state->responses[''] = isset($state->responses['']) ? addslashes($state->responses['']) : ''; // should this go in save_question_session?
                     save_question_session($question, $state);
                     quiz_save_best_grade($quiz, $attempt->userid);
                 }
@@ -362,6 +363,8 @@ class quiz_report extends quiz_default_report {
 
             $options = quiz_get_reviewoptions($quiz, $attempt, true);
             unset($options->questioncommentlink);
+            $copy = $state->comment;
+            $state->comment = '';
 
             $options->readonly = 1;
 
@@ -372,9 +375,10 @@ class quiz_report extends quiz_default_report {
 
             print_question($question, $state, '', $quiz, $options);
             
-            $prefix = "manualgrades[$attempt->uniqueid]";
-            $grade = round($state->last_graded->grade, 3);
-
+            $prefix         = "manualgrades[$attempt->uniqueid]";
+            $grade          = round($state->last_graded->grade, 3);
+            $state->comment = $copy;
+            
             include($CFG->wwwroot.'/question/comment.html');
             
             echo '</div>';