// 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,".
$state->attempt, 'questionid', $question->id)) {
$newest->newgraded = $state->id;
$newest->sumpenalty = $state->sumpenalty;
+ $newest->comment = $state->comment;
update_record('question_sessions', $newest);
}
}
set_config('qtype_truefalse_version', 2006032100);
}
+ if ($oldversion < 2006040600) {
+ table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
+ }
+
return true;
}
set_config('qtype_truefalse_version', 2006032100);
}
+ if ($oldversion < 2006040600) {
+ table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
+ }
+
return true;
}
// 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)?
->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";