mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-7308 - Check all the DB columns used to store grades, and make sure they all use a consistent type.
This commit is contained in:
parent
5d6a723d40
commit
f9a2cf86a9
@ -973,8 +973,8 @@
|
||||
<FIELD NAME="questiontextformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="questiontext" NEXT="image"/>
|
||||
<FIELD NAME="image" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="questiontextformat" NEXT="generalfeedback"/>
|
||||
<FIELD NAME="generalfeedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="to store the question feedback" PREVIOUS="image" NEXT="defaultgrade"/>
|
||||
<FIELD NAME="defaultgrade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="generalfeedback" NEXT="penalty"/>
|
||||
<FIELD NAME="penalty" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0.1" SEQUENCE="false" ENUM="false" PREVIOUS="defaultgrade" NEXT="qtype"/>
|
||||
<FIELD NAME="defaultgrade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="generalfeedback" NEXT="penalty"/>
|
||||
<FIELD NAME="penalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0.1" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="defaultgrade" NEXT="qtype"/>
|
||||
<FIELD NAME="qtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="penalty" NEXT="length"/>
|
||||
<FIELD NAME="length" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="qtype" NEXT="stamp"/>
|
||||
<FIELD NAME="stamp" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="length" NEXT="version"/>
|
||||
@ -998,7 +998,7 @@
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="question"/>
|
||||
<FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="answer"/>
|
||||
<FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="question" NEXT="fraction"/>
|
||||
<FIELD NAME="fraction" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="answer" NEXT="feedback"/>
|
||||
<FIELD NAME="fraction" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="answer" NEXT="feedback"/>
|
||||
<FIELD NAME="feedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fraction"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
@ -1025,9 +1025,9 @@
|
||||
<FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="seq_number" NEXT="timestamp"/>
|
||||
<FIELD NAME="timestamp" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="answer" NEXT="event"/>
|
||||
<FIELD NAME="event" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestamp" NEXT="grade"/>
|
||||
<FIELD NAME="grade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="event" NEXT="raw_grade"/>
|
||||
<FIELD NAME="raw_grade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="penalty"/>
|
||||
<FIELD NAME="penalty" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="raw_grade"/>
|
||||
<FIELD NAME="grade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="event" NEXT="raw_grade"/>
|
||||
<FIELD NAME="raw_grade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="grade" NEXT="penalty"/>
|
||||
<FIELD NAME="penalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="raw_grade"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="attempt"/>
|
||||
@ -1042,7 +1042,7 @@
|
||||
<FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="attemptid" NEXT="newest"/>
|
||||
<FIELD NAME="newest" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="questionid" NEXT="newgraded"/>
|
||||
<FIELD NAME="newgraded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="newest" NEXT="sumpenalty"/>
|
||||
<FIELD NAME="sumpenalty" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="newgraded" NEXT="manualcomment"/>
|
||||
<FIELD NAME="sumpenalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="newgraded" NEXT="manualcomment"/>
|
||||
<FIELD NAME="manualcomment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sumpenalty"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
|
@ -617,6 +617,56 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
upgrade_main_savepoint($result, 2008080701);
|
||||
}
|
||||
|
||||
/// Changing the type of all the columns that the question bank uses to store grades to be NUMBER(12, 7).
|
||||
if ($result && $oldversion < 2008081500) {
|
||||
$table = new xmldb_table('question');
|
||||
$field = new xmldb_field('defaultgrade', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'generalfeedback');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081500);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081501) {
|
||||
$table = new xmldb_table('question');
|
||||
$field = new xmldb_field('penalty', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'defaultgrade');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081501);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081502) {
|
||||
$table = new xmldb_table('question_answers');
|
||||
$field = new xmldb_field('fraction', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'answer');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081502);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081503) {
|
||||
$table = new xmldb_table('question_sessions');
|
||||
$field = new xmldb_field('sumpenalty', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'newgraded');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081503);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081504) {
|
||||
$table = new xmldb_table('question_states');
|
||||
$field = new xmldb_field('grade', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'event');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081504);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081505) {
|
||||
$table = new xmldb_table('question_states');
|
||||
$field = new xmldb_field('raw_grade', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'grade');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081505);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081506) {
|
||||
$table = new xmldb_table('question_states');
|
||||
$field = new xmldb_field('penalty', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'raw_grade');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_main_savepoint($result, 2008081506);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
||||
<FIELD NAME="shufflequestions" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="questionsperpage" NEXT="shuffleanswers"/>
|
||||
<FIELD NAME="shuffleanswers" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="shufflequestions" NEXT="questions"/>
|
||||
<FIELD NAME="questions" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shuffleanswers" NEXT="sumgrades"/>
|
||||
<FIELD NAME="sumgrades" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="questions" NEXT="grade"/>
|
||||
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sumgrades" NEXT="timecreated"/>
|
||||
<FIELD NAME="sumgrades" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="questions" NEXT="grade"/>
|
||||
<FIELD NAME="grade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="sumgrades" NEXT="timecreated"/>
|
||||
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="timelimit"/>
|
||||
<FIELD NAME="timelimit" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="password"/>
|
||||
@ -48,7 +48,7 @@
|
||||
<FIELD NAME="quiz" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="uniqueid" NEXT="userid"/>
|
||||
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="quiz" NEXT="attempt"/>
|
||||
<FIELD NAME="attempt" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="sumgrades"/>
|
||||
<FIELD NAME="sumgrades" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="attempt" NEXT="timestart"/>
|
||||
<FIELD NAME="sumgrades" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="attempt" NEXT="timestart"/>
|
||||
<FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sumgrades" NEXT="timefinish"/>
|
||||
<FIELD NAME="timefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timefinish" NEXT="layout"/>
|
||||
@ -69,7 +69,7 @@
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="quiz"/>
|
||||
<FIELD NAME="quiz" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
|
||||
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="quiz" NEXT="grade"/>
|
||||
<FIELD NAME="grade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timemodified"/>
|
||||
<FIELD NAME="grade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="userid" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
@ -85,7 +85,7 @@
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="quiz"/>
|
||||
<FIELD NAME="quiz" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="question"/>
|
||||
<FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="quiz" NEXT="grade"/>
|
||||
<FIELD NAME="grade" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="question"/>
|
||||
<FIELD NAME="grade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="question"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="quiz"/>
|
||||
@ -93,13 +93,13 @@
|
||||
<KEY NAME="question" TYPE="foreign" FIELDS="question" REFTABLE="question" REFFIELDS="id" PREVIOUS="quiz"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="quiz_feedback" COMMENT="Feedback given to students based on their overall score on the test" PREVIOUS="quiz_grades" NEXT="quiz_report">
|
||||
<TABLE NAME="quiz_feedback" COMMENT="Feedback given to students based on their overall score on the test" PREVIOUS="quiz_question_instances" NEXT="quiz_report">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="quizid"/>
|
||||
<FIELD NAME="quizid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="feedbacktext"/>
|
||||
<FIELD NAME="feedbacktext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="quizid" NEXT="mingrade"/>
|
||||
<FIELD NAME="mingrade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedbacktext" NEXT="maxgrade"/>
|
||||
<FIELD NAME="maxgrade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mingrade"/>
|
||||
<FIELD NAME="mingrade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="feedbacktext" NEXT="maxgrade"/>
|
||||
<FIELD NAME="maxgrade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" PREVIOUS="mingrade"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="quizid"/>
|
||||
|
@ -119,6 +119,56 @@ function xmldb_quiz_upgrade($oldversion=0) {
|
||||
upgrade_mod_savepoint($result, 2008081500, 'quiz');
|
||||
}
|
||||
|
||||
/// Changing the type of all the columns that store grades to be NUMBER(10, 5) or similar.
|
||||
if ($result && $oldversion < 2008081501) {
|
||||
$table = new xmldb_table('quiz');
|
||||
$field = new xmldb_field('sumgrades', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'questions');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081501, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081502) {
|
||||
$table = new xmldb_table('quiz');
|
||||
$field = new xmldb_field('grade', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'sumgrades');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081502, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081503) {
|
||||
$table = new xmldb_table('quiz_attempts');
|
||||
$field = new xmldb_field('sumgrades', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'attempt');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081503, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081504) {
|
||||
$table = new xmldb_table('quiz_feedback');
|
||||
$field = new xmldb_field('mingrade', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'feedbacktext');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081504, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081505) {
|
||||
$table = new xmldb_table('quiz_feedback');
|
||||
$field = new xmldb_field('maxgrade', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'mingrade');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081505, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081506) {
|
||||
$table = new xmldb_table('quiz_grades');
|
||||
$field = new xmldb_field('grade', XMLDB_TYPE_NUMBER, '10, 5', null, null, null, null, null, null, 'userid');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081506, 'quiz');
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2008081507) {
|
||||
$table = new xmldb_table('quiz_question_instances');
|
||||
$field = new xmldb_field('grade', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'question');
|
||||
$dbman->change_field_type($table, $field);
|
||||
upgrade_mod_savepoint($result, 2008081507, 'quiz');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
<FIELD NAME="sd" TYPE="number" LENGTH="15" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" DECIMALS="10" PREVIOUS="discriminativeefficiency" NEXT="facility"/>
|
||||
<FIELD NAME="facility" TYPE="number" LENGTH="15" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" DECIMALS="10" PREVIOUS="sd" NEXT="subquestions"/>
|
||||
<FIELD NAME="subquestions" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="facility" NEXT="maxgrade"/>
|
||||
<FIELD NAME="maxgrade" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="subquestions" NEXT="positions"/>
|
||||
<FIELD NAME="maxgrade" TYPE="number" LENGTH="12" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" DECIMALS="7" PREVIOUS="subquestions" NEXT="positions"/>
|
||||
<FIELD NAME="positions" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="positions in which this item appears. Only used for random questions." PREVIOUS="maxgrade"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
|
@ -51,7 +51,16 @@ function xmldb_quizreport_statistics_upgrade($oldversion=0) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($result && $oldversion < 2008081500) {
|
||||
/// Changing type of field maxgrade on table quiz_question_statistics to number
|
||||
$table = new xmldb_table('quiz_question_statistics');
|
||||
$field = new xmldb_field('maxgrade', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null, null, null, 'subquestions');
|
||||
|
||||
/// Launch change of type for field maxgrade
|
||||
$dbman->change_field_type($table, $field);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
$plugin->version = 2008072801; // The (date) version of this module
|
||||
$plugin->version = 2008081500; // The (date) version of this module
|
||||
|
||||
?>
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2008081500; // The (date) version of this module
|
||||
$module->version = 2008081507; // The (date) version of this module
|
||||
$module->requires = 2008072401; // Requires this Moodle version
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
|
@ -188,12 +188,12 @@
|
||||
$table->align = array('center', 'left');
|
||||
$table->size = array('', '');
|
||||
if ($markcolumn) {
|
||||
$table->head[] = get_string('marks', 'quiz') . " / $quiz->sumgrades";
|
||||
$table->head[] = get_string('marks', 'quiz') . ' / ' . quiz_format_grade($quiz, $quiz->sumgrades);
|
||||
$table->align[] = 'center';
|
||||
$table->size[] = '';
|
||||
}
|
||||
if ($gradecolumn) {
|
||||
$table->head[] = get_string('grade') . " / $quiz->grade";
|
||||
$table->head[] = get_string('grade') . ' / ' . quiz_format_grade($quiz, $quiz->grade);
|
||||
$table->align[] = 'center';
|
||||
$table->size[] = '';
|
||||
}
|
||||
|
@ -861,7 +861,7 @@ class default_questiontype {
|
||||
$grade = '--/';
|
||||
}
|
||||
}
|
||||
$grade .= $question->maxgrade;
|
||||
$grade .= question_format_grade($cmoptions, $question->maxgrade);
|
||||
}
|
||||
|
||||
$comment = $state->manualcomment;
|
||||
@ -993,7 +993,7 @@ class default_questiontype {
|
||||
// Display the grading details from the last graded state
|
||||
$grade = new stdClass;
|
||||
$grade->cur = question_format_grade($cmoptions, $state->last_graded->grade);
|
||||
$grade->max = $question->maxgrade;
|
||||
$grade->max = question_format_grade($cmoptions, $question->maxgrade);
|
||||
$grade->raw = question_format_grade($cmoptions, $state->last_graded->raw_grade);
|
||||
|
||||
// let student know wether the answer was correct
|
||||
@ -1018,7 +1018,7 @@ class default_questiontype {
|
||||
if ('' !== $state->last_graded->penalty && ((float)$state->last_graded->penalty) > 0.0) {
|
||||
// A penalty was applied so display it
|
||||
echo ' ';
|
||||
print_string('gradingdetailspenalty', 'quiz', $state->last_graded->penalty);
|
||||
print_string('gradingdetailspenalty', 'quiz', question_format_grade($cmoptions, $state->last_graded->penalty));
|
||||
} else {
|
||||
/* No penalty was applied even though the answer was
|
||||
not correct (eg. a syntax error) so tell the student
|
||||
|
@ -401,7 +401,7 @@ class question_shortanswer_qtype extends default_questiontype {
|
||||
// Display the grading details from the last graded state
|
||||
$grade = new stdClass;
|
||||
$grade->cur = question_format_grade($cmoptions, $state->last_graded->grade);
|
||||
$grade->max = $question->maxgrade;
|
||||
$grade->max = question_format_grade($cmoptions, $question->maxgrade);
|
||||
$grade->raw = question_format_grade($cmoptions, $state->last_graded->raw_grade);
|
||||
|
||||
// let student know wether the answer was correct
|
||||
|
@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2008081200; // YYYYMMDD = date of the last version bump
|
||||
$version = 2008081506; // YYYYMMDD = date of the last version bump
|
||||
// XX = daily increments
|
||||
|
||||
$release = '2.0 dev (Build: 20080815)'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user