]> git.mjollnir.org Git - moodle.git/commitdiff
Introduce field for teacher comments, in preparation for manual grading
authorgustav_delius <gustav_delius>
Thu, 6 Apr 2006 16:42:00 +0000 (16:42 +0000)
committergustav_delius <gustav_delius>
Thu, 6 Apr 2006 16:42:00 +0000 (16:42 +0000)
lib/questionlib.php
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php
mod/quiz/version.php
question/preview.php

index c852955f66023625401a1ff91dfeb60790556d9e..920b3fe3cc75ad8f5cd081135cab963d8da1046a 100644 (file)
@@ -573,7 +573,7 @@ function get_question_states(&$questions, $cmoptions, $attempt) {
 
     // The question field must be listed first so that it is used as the
     // array index in the array returned by get_records_sql
-    $statefields = 'n.questionid as question, s.*, n.sumpenalty';
+    $statefields = 'n.questionid as question, s.*, n.sumpenalty, n.comment';
     // Load the newest states for the questions
     $sql = "SELECT $statefields".
            "  FROM {$CFG->prefix}question_states s,".
@@ -715,6 +715,7 @@ function save_question_session(&$question, &$state) {
              $state->attempt, 'questionid', $question->id)) {
                 $newest->newgraded = $state->id;
                 $newest->sumpenalty = $state->sumpenalty;
+                $newest->comment = $state->comment;
                 update_record('question_sessions', $newest);
             }
         }
index 8a2dece17722e2dc7e0a07e61b88fa780cf3e04c..52ccb519023f09812e0b03461975222797745dc3 100644 (file)
@@ -1003,6 +1003,10 @@ function quiz_upgrade($oldversion) {
         set_config('qtype_truefalse_version', 2006032100);
     }
 
+    if ($oldversion < 2006040600) {
+        table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
+    }
+
     return true;
 }
 
index 1752929e25a33e8cc0e5e3216d15305e69a9509e..83e2cd3d5001a407e3d06f6340769f589cb6dc3a 100644 (file)
@@ -1172,6 +1172,10 @@ function quiz_upgrade($oldversion) {
         set_config('qtype_truefalse_version', 2006032100);
     }
 
+    if ($oldversion < 2006040600) {
+        table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
+    }
+
     return true;
 }
 
index 322b5a03a06f4ad9cacdc871ee680e25b7a7c54a..21b4264c6cb13eb7a3235c3992987b02063eaf02 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2006032200;   // The (date) version of this module
+$module->version  = 2006040600;   // The (date) version of this module
 $module->requires = 2006022400;   // Requires this Moodle version
 $module->cron     = 0;            // How often should cron check this module (seconds)?
 
index a5acadf65aa901440f50cf672c3c946ac2b6fe85..7658dfaf057faf587969d0b15c8cbfdbffbffb4e 100644 (file)
          ->get_correct_responses($questions[$id], $curstate);
     }
 
-    $strpreview = get_string('previewquestion', 'quiz');
+    $strpreview = get_string('preview', 'quiz').' '.s($questions[$id]->name);
     print_header($strpreview);
     print_heading($strpreview);
 
-    echo '<p align="center">' . get_string('modulename', 'quiz') . ': ';
-    if (empty($quizid)) {
-        echo '[' . get_string('default', 'quiz') . ']';
-    } else {
+    if (!empty($quizid)) {
+        echo '<p align="center">'.get_string('modulename', 'quiz') . ': ';
         p($quiz->name);
+        echo "</p>\n";
     }
-    echo '<br />'.get_string('question', 'quiz').': ';
-    p($questions[$id]->name);
-    echo "</p>\n";
     $number = 1;
     echo "<form method=\"post\" action=\"preview.php\" autocomplete=\"off\">\n";
     echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";