Introduce field for teacher comments, in preparation for manual grading
This commit is contained in:
+2
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)?
|
||||
|
||||
|
||||
@@ -176,19 +176,15 @@
|
||||
->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";
|
||||
|
||||
Reference in New Issue
Block a user