mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-29627 quiz old popup int column => new browsersecurity column.
The new column store more meaningful string constants.
This commit is contained in:
parent
0eafc98852
commit
4344c5d5d9
15 changed files with 170 additions and 46 deletions
|
@ -49,7 +49,7 @@ class backup_quiz_activity_structure_step extends backup_questions_activity_stru
|
|||
'questionsperpage', 'shufflequestions', 'shuffleanswers',
|
||||
'questions', 'sumgrades', 'grade', 'timecreated',
|
||||
'timemodified', 'timelimit', 'password', 'subnet',
|
||||
'popup', 'delay1', 'delay2', 'showuserpicture',
|
||||
'browsersecurity', 'delay1', 'delay2', 'showuserpicture',
|
||||
'showblocks'));
|
||||
|
||||
$qinstances = new backup_nested_element('question_instances');
|
||||
|
|
|
@ -195,6 +195,21 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st
|
|||
mod_quiz_display_options::AFTER_CLOSE : 0);
|
||||
}
|
||||
|
||||
// The old popup column from from <= 2.1 need to be mapped to
|
||||
// the new browsersecurity. MDL-29627
|
||||
if (!isset($data->browsersecurity)) {
|
||||
if (empty($data->popup)) {
|
||||
$data->browsersecurity = '-';
|
||||
} else if ($data->popup == 1) {
|
||||
$data->browsersecurity = 'securewindow';
|
||||
} else if ($data->popup == 2) {
|
||||
$data->browsersecurity = 'safebrowser';
|
||||
} else {
|
||||
$data->preferredbehaviour = '-';
|
||||
}
|
||||
unset($data->popup);
|
||||
}
|
||||
|
||||
// insert the quiz record
|
||||
$newitemid = $DB->insert_record('quiz', $data);
|
||||
// immediately after inserting "activity" record, call this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue