"attemptonlast". Seems to work.
$result = NULL; // Default
$questions = NULL; // Default
- if ($quiz->eachattemptbuildsonthelast) {
+ if ($quiz->attemptonlast) {
$latestfinishedattempt->attempt = 0;
foreach ($attempts as $attempt) {
if ($attempt->timefinish
execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD eachattemptbuildsonthelast TINYINT(4) DEFAULT '0' NOT NULL AFTER `attempts` ");
}
+ if ($oldversion < 2003080400) {
+ table_column("quiz", "eachattemptbuildsonthelast", "attemptonlast", "TINYINT", "4", "UNSIGNED", "0", "NOT NULL", "");
+ }
+
return true;
}
`timeopen` int(10) unsigned NOT NULL default '0',
`timeclose` int(10) unsigned NOT NULL default '0',
`attempts` smallint(6) NOT NULL default '0',
- `eachattemptbuildsonthelast` tinyint(4) NOT NULL default '0',
+ `attemptonlast` tinyint(4) NOT NULL default '0',
`feedback` tinyint(4) NOT NULL default '0',
`correctanswers` tinyint(4) NOT NULL default '1',
`grademethod` tinyint(4) NOT NULL default '1',
if (!isset($form->attempts)) {
$form->attempts = 0;
}
- if (!isset($form->eachattemptbuildsonthelast)) {
- $form->eachattemptbuildsonthelast = 0;
+ if (!isset($form->attemptonlast)) {
+ $form->attemptonlast = 0;
}
if (!isset($form->grademethod)) {
$form->grademethod = "";
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
- choose_from_menu($options, "eachattemptbuildsonthelast",
- "$form->eachattemptbuildsonthelast", "");
+ choose_from_menu($options, "attemptonlast",
+ "$form->attemptonlast", "");
helpbutton("eachattemptbuildsonthelast",
get_string("eachattemptbuildsonthelast", "quiz"),
"quiz");