mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Renamed column question_sessions->comment at Eloy's request since comment is a DB reserved word.
I have not been able to test this fully, because I cannot assign roles (e.g. Student and Teacher) in 1.7dev at the moment to test a student answering an essay question then a teacher grading it. However, I have tested as much as possible as admin and cannot get any errors.
This commit is contained in:
parent
dd4a1bca28
commit
3e3e5a4030
11 changed files with 27 additions and 19 deletions
|
@ -54,7 +54,7 @@
|
|||
</TABLE>
|
||||
<TABLE name="question_sessions">
|
||||
<FIELDS>
|
||||
<FIELD name="comment" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
||||
<FIELD name="manualcomment" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
||||
<SQL_DETECT_USER>
|
||||
SELECT qa.userid
|
||||
FROM {$CFG->prefix}question_sessions qs,
|
||||
|
|
|
@ -1132,6 +1132,10 @@ function quiz_upgrade($oldversion) {
|
|||
");
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2006082400) {
|
||||
$success = $success && table_column('question_sessions', 'comment', 'manualcomment', 'text', '', '', '');
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ CREATE TABLE prefix_question_sessions (
|
|||
newest int(10) unsigned NOT NULL default '0',
|
||||
newgraded int(10) unsigned NOT NULL default '0',
|
||||
sumpenalty float NOT NULL default '0',
|
||||
comment text NOT NULL default '',
|
||||
manualcomment text NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY attemptid (attemptid,questionid)
|
||||
) TYPE=MyISAM COMMENT='Gives ids of the newest open and newest graded states';
|
||||
|
|
|
@ -1454,6 +1454,10 @@ function quiz_upgrade($oldversion) {
|
|||
");
|
||||
}
|
||||
|
||||
if ($success && $oldversion < 2006082400) {
|
||||
$success = $success && table_column('question_sessions', 'comment', 'manualcomment', 'text', '', '', '');
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ CREATE TABLE prefix_question_sessions (
|
|||
newest integer NOT NULL default '0',
|
||||
newgraded integer NOT NULL default '0',
|
||||
sumpenalty real NOT NULL default '0',
|
||||
comment text NOT NULL default ''
|
||||
manualcomment text NOT NULL default ''
|
||||
);
|
||||
CREATE UNIQUE INDEX prefix_question_sessions_attempt_idx ON prefix_question_sessions (attemptid,questionid);
|
||||
|
||||
|
|
|
@ -367,8 +367,8 @@ class quiz_report extends quiz_default_report {
|
|||
|
||||
$options = quiz_get_reviewoptions($quiz, $attempt, true);
|
||||
unset($options->questioncommentlink);
|
||||
$copy = $state->comment;
|
||||
$state->comment = '';
|
||||
$copy = $state->manualcomment;
|
||||
$state->manualcomment = '';
|
||||
|
||||
$options->readonly = 1;
|
||||
|
||||
|
@ -381,7 +381,7 @@ class quiz_report extends quiz_default_report {
|
|||
|
||||
$prefix = "manualgrades[$attempt->uniqueid]";
|
||||
$grade = round($state->last_graded->grade, 3);
|
||||
$state->comment = $copy;
|
||||
$state->manualcomment = $copy;
|
||||
|
||||
include($CFG->dirroot . '/question/comment.html');
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
|
||||
$session = get_record('question_sessions', 'attemptid', $attempt->uniqueid, 'questionid', $question->id);
|
||||
$state->sumpenalty = $session->sumpenalty;
|
||||
$state->comment = $session->comment;
|
||||
$state->manualcomment = $session->manualcomment;
|
||||
restore_question_state($question, $state);
|
||||
$state->last_graded = $state;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006082300; // The (date) version of this module
|
||||
$module->version = 2006082400; // The (date) version of this module
|
||||
$module->requires = 2006080900; // Requires this Moodle version
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue