Skip to content

Commit

Permalink
Pages crash if trackVideo is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Jul 7, 2022
1 parent 2613309 commit 83ec7a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -304,7 +304,12 @@
// Calculate progress
progress = XThelperDetermineProgress(videoState);
}
switch (x_currentPageXML.getAttribute('trackVideo')) {
let trackVideoSetting = 'no_mcqs';
if (x_currentPageXML.getAttribute('trackVideo') != undefined)
{
trackVideoSetting = x_currentPageXML.getAttribute('trackVideo');
}
switch (trackVideoSetting) {
case 'yes':
totalScore = (mcqScore + progress) / 2;
break;
Expand Down
Expand Up @@ -265,7 +265,12 @@
// Calculate progress
progress = XThelperDetermineProgress(videoState);
}
switch (x_currentPageXML.getAttribute('trackVideo')) {
let trackVideoSetting = 'no_mcqs';
if (x_currentPageXML.getAttribute('trackVideo') != undefined)
{
trackVideoSetting = x_currentPageXML.getAttribute('trackVideo');
}
switch (trackVideoSetting) {
case 'yes':
totalScore = (mcqScore + progress) / 2;
break;
Expand Down

0 comments on commit 83ec7a7

Please sign in to comment.