From: gustav_delius
Date: Thu, 6 Apr 2006 16:42:00 +0000 (+0000)
Subject: Introduce field for teacher comments, in preparation for manual grading
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3a5a6f59a3fdf2fa5c40e7a054ad0aedb910eedd;p=moodle.git
Introduce field for teacher comments, in preparation for manual grading
---
diff --git a/lib/questionlib.php b/lib/questionlib.php
index c852955f66..920b3fe3cc 100644
--- a/lib/questionlib.php
+++ b/lib/questionlib.php
@@ -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);
}
}
diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php
index 8a2dece177..52ccb51902 100644
--- a/mod/quiz/db/mysql.php
+++ b/mod/quiz/db/mysql.php
@@ -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;
}
diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php
index 1752929e25..83e2cd3d50 100644
--- a/mod/quiz/db/postgres7.php
+++ b/mod/quiz/db/postgres7.php
@@ -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;
}
diff --git a/mod/quiz/version.php b/mod/quiz/version.php
index 322b5a03a0..21b4264c6c 100644
--- a/mod/quiz/version.php
+++ b/mod/quiz/version.php
@@ -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)?
diff --git a/question/preview.php b/question/preview.php
index a5acadf65a..7658dfaf05 100644
--- a/question/preview.php
+++ b/question/preview.php
@@ -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 '' . get_string('modulename', 'quiz') . ': ';
- if (empty($quizid)) {
- echo '[' . get_string('default', 'quiz') . ']';
- } else {
+ if (!empty($quizid)) {
+ echo '
'.get_string('modulename', 'quiz') . ': ';
p($quiz->name);
+ echo "
\n";
}
- echo '
'.get_string('question', 'quiz').': ';
- p($questions[$id]->name);
- echo "
\n";
$number = 1;
echo "