Added extra check to upgrade script

pull/4/head
Frode Petterson 2016-05-02 11:05:59 +02:00
parent 4c389c89e3
commit 9d8a35f807
1 changed files with 13 additions and 11 deletions

View File

@ -28,18 +28,20 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) {
*/ */
8: function (parameters, finished) { 8: function (parameters, finished) {
if (parameters.override.overrideButtons) { if (parameters.override) {
// Set new variables if (parameters.override.overrideButtons) {
parameters.override.showSolutionButton = // Set new variables
(parameters.override.overrideShowSolutionButton ? 'on' : 'off'); parameters.override.showSolutionButton =
parameters.override.retryButton = (parameters.override.overrideShowSolutionButton ? 'on' : 'off');
(parameters.override.overrideRetry ? 'on' : 'off'); parameters.override.retryButton =
} (parameters.override.overrideRetry ? 'on' : 'off');
}
// Remove old field variables // Remove old field variables
delete parameters.override.overrideButtons; delete parameters.override.overrideButtons;
delete parameters.override.overrideShowSolutionButton; delete parameters.override.overrideShowSolutionButton;
delete parameters.override.overrideRetry; delete parameters.override.overrideRetry;
}
// Move copyright dialog question label // Move copyright dialog question label
if (parameters.questionLabel) { if (parameters.questionLabel) {