From 3b494b543cf6538c09028abbeb3e8e7a50013070 Mon Sep 17 00:00:00 2001 From: gbateson Date: Thu, 3 May 2007 00:22:50 +0000 Subject: [PATCH] add HP 6.2 templates; add compatability with Safari (Mac browser); microincrement version to 2007020201 (release 2.4.1) --- mod/hotpot/README.TXT | 6 +- mod/hotpot/hotpot-full.js | 179 +++++++++++++----- mod/hotpot/template/default.php | 4 +- mod/hotpot/template/v6.php | 5 + mod/hotpot/template/v6/djmatch6.ht_ | 8 +- mod/hotpot/template/v6/djmatch6.js_ | 54 +++++- mod/hotpot/template/v6/djmix6.ht_ | 8 +- mod/hotpot/template/v6/djmix6.js_ | 57 +++++- mod/hotpot/template/v6/fjmatch6.ht_ | 7 +- mod/hotpot/template/v6/fjmatch6.js_ | 24 +++ mod/hotpot/template/v6/hp6.cs_ | 11 +- .../template/v6/hp6checkshortanswer.js_ | 7 +- mod/hotpot/template/v6/hp6objecttags.ht_ | 23 +-- mod/hotpot/template/v6/hp6sendresults.js_ | 22 +-- mod/hotpot/template/v6/hp6showmessage.js_ | 71 ++++--- mod/hotpot/template/v6/hp6utilities.js_ | 25 ++- mod/hotpot/template/v6/jcloze6.ht_ | 10 +- mod/hotpot/template/v6/jcloze6.js_ | 58 +++++- mod/hotpot/template/v6/jcross6.ht_ | 10 +- mod/hotpot/template/v6/jcross6.js_ | 90 ++++++++- mod/hotpot/template/v6/jmatch6.ht_ | 8 +- mod/hotpot/template/v6/jmatch6.js_ | 58 ++++++ mod/hotpot/template/v6/jmix6.ht_ | 8 +- mod/hotpot/template/v6/jmix6.js_ | 56 +++++- mod/hotpot/template/v6/jquiz6.ht_ | 8 +- mod/hotpot/template/v6/jquiz6.js_ | 67 ++++++- mod/hotpot/template/v6/masher.ht_ | 4 + mod/hotpot/template/v6/testbrowsercheck.htm | 2 +- mod/hotpot/version.php | 4 +- 29 files changed, 741 insertions(+), 153 deletions(-) diff --git a/mod/hotpot/README.TXT b/mod/hotpot/README.TXT index 7d44982ae0..32ff96a2c0 100644 --- a/mod/hotpot/README.TXT +++ b/mod/hotpot/README.TXT @@ -1,12 +1,12 @@ ================================================== -This is v2.3.0 of the HotPot module for Moodle 1.8 +This is v2.4.1 of the HotPot module for Moodle 1.9 ================================================== This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle. It has been tested on: - Hot Potatoes 6 - - Moodle 1.8 - - PHP 4.1 thru 5.1.2 + - Moodle 1.9 + - PHP 4.1 thru 5.2 - MySQL 4.x thru 5.0 - PostgreSQL 7.3 thru 8.2 diff --git a/mod/hotpot/hotpot-full.js b/mod/hotpot/hotpot-full.js index 55a95d0ba0..45d3651f9c 100644 --- a/mod/hotpot/hotpot-full.js +++ b/mod/hotpot/hotpot-full.js @@ -288,7 +288,7 @@ if (window.JQuiz==null) { JQuiz[5] = false; // show number of checks of incorrect answers (legacy field superceded by [12]) // HP6 v6 quizzes only JQuiz[6] = false; // show answer value (false) or A,B,C... index (true) - JQuiz[7] = true; // show all students answers + JQuiz[7] = false; // show all students answers JQuiz[8] = true; // show student's wrong answers JQuiz[9] = true; // show ignored answers (not relevant for multi-select questions) JQuiz[10] = true; // show score weightings @@ -518,11 +518,11 @@ function QuizLogin(LoginPrompt) { if (Login[0]) { // user name var v = getCookie(self, 'UserName'); html += '' - + '' + MSG[0] + ' :' + + '' + MSG[0] + ' :' + '' ; if (typeof(Login[0])=='boolean') { // text box - html += ''; + html += ''; } else { // drop down menu of names // pattern to match commas and white space var comma = (window.RegExp) ? new RegExp('\\s*,\\s*') : ','; @@ -530,7 +530,7 @@ function QuizLogin(LoginPrompt) { if (typeof(Login[0])=='string') { Login[0] = Login[0].split(comma); } - html += '' + '' ; for(var i=0; i'; + html += '' + MSG[1] + ' :'; } if (Login[2]) { // user email var v = getCookie(self, 'UserEmail'); - html += '' + MSG[2] +' :'; + html += '' + MSG[2] +' :'; } if (Login[3]) { // quiz password var v = getCookie(self, 'Password'); - html += '' + MSG[3] + ' :'; + html += '' + MSG[3] + ' :'; } if (Login[4]) { // cookie lifespan var v = getCookie(self, 'CookieExpiry'); html += '' - + '' + MSG[4] + ' :' + + '' + MSG[4] + ' :' + '' + ' ' - + '' + + ' ' + + '' + '' + '' + '' @@ -856,7 +856,7 @@ function AddStudentDetailsToResultForm() { sDetails += hpHiddenField('email', window.UserEmail); } if (sDetails && window.RegExp) { - // insert sDetails before '' + // insert sDetails before '' var r = new RegExp(']*Score[^>]*><\\/input>', 'i'); var m = r.exec(ResultForm); if (m) { @@ -1361,8 +1361,15 @@ function GetJQuizAnswerDetails(q, flag) { var x = new Array(); } else { // get required part of 'x' and convert to array - var i = x.lastIndexOf('|'); - var x = x.substring((flag==2 ? (i+1) : 1), ((flag==0 || flag==2) ? x.length : i)).split('|'); + if (x.charAt(0)=='|') { + // HP 6.0 and 6.1 (always has leading bar) + var i = x.lastIndexOf('|'); + var x = x.substring((flag==2 ? (i+1) : 1), ((flag==0 || flag==2) ? x.length : i)).split('|'); + } else { + // HP 6.2 (no leading delimiter) + var i = x.lastIndexOf(' | '); + var x = x.substring((flag==2 ? (i+3) : 0), ((flag==0 || flag==2) ? x.length : i)).split(' | '); + } } for (var i=0; i' + value + ''; } else { - field = ''; + field = ''; } return field; } @@ -2020,12 +2050,19 @@ function getFuncCode(fn, extraCode, anchorCode, beforeAnchor) { } return s; } -function getArgsStr(args) { +function getArgsStr(args, addQuotes) { // make s(tring) version of function args array var s = ''; var i_max = args.length; for (var i=0; i' + '' - + '' - + '' + + '' - + '' + + '' + '' - + '
' + FEEDBACK[7] + ':' + document.title + '
' + FEEDBACK[8] + ': ' + + '
' + FEEDBACK[7] + ':' + document.title + '
' + FEEDBACK[8] + ': ' ; if (typeof(FEEDBACK[1])=='string') { html += FEEDBACK[1] + hpHiddenField('recipient', FEEDBACK[1], ',', true); @@ -2119,9 +2156,9 @@ function hpFeedback() { } } html += '
' + FEEDBACK[9] + ':
' + FEEDBACK[9] + ':
 ' + + '
 ' + hpHiddenField('realname', FEEDBACK[2], ',', true) + hpHiddenField('email', FEEDBACK[3], ',', true) + hpHiddenField('subject', document.title, ',', true) @@ -2135,10 +2172,10 @@ function hpFeedback() { var i_max = FEEDBACK[1].length; if (i_max>1) { // several teachers html += '' - + '
' + + '' + '' - + '' - + '' + + '
' + FEEDBACK[7] + ':' + document.title + '
' + FEEDBACK[8] + ': ' + + '
' + FEEDBACK[7] + ':' + document.title + '
' + FEEDBACK[8] + ': ' ; html += ' ' + + '
 ' + '
' ; } else if (i_max==1) { // one teacher @@ -2170,6 +2207,38 @@ function hpFeedback() { // ******************** // intercept clicks // ******************** +function hpNewFunction(f, a, s) { + if (window.C && C.safari) { + if (f=='CheckAnswers') { + if (s.indexOf('TotalChars-State[i].HintsAndChecks/')>=0) { + // special fix for "CheckAnswers" in JCloze + s = s.replace(/TotalChars-State\[i\]\.HintsAndChecks/g, '(TotalChars-State[i].HintsAndChecks)'); + } + if (s.indexOf('CorrectLetters-Penalties/')>=0) { + // special fix for "CheckAnswers" in JMatch + s = s.replace(/CorrectLetters-Penalties/g, '(CorrectLetters-Penalties)'); + } + if (s.indexOf('TotCorrectChoices-Penalties/')>=0) { + // special fix for "CheckAnswers" in JMix (v6) + s = s.replace(/TotCorrectChoices-Penalties/g, '(TotCorrectChoices-Penalties)'); + } + if (s.indexOf('TotalCorrect-Penalties/')>=0) { + // special fix for "CheckAnswers" in JMix (v6+) Drag-and_Drop + s = s.replace(/TotalCorrect-Penalties/g, '(TotalCorrect-Penalties)'); + } + } + if (s.indexOf('replace(\\[')>=0) { + s = s.replace(/\\\[/g, '/\\['); + s = s.replace(/\\\]/g, '\\]/g'); + } + if (s.indexOf('for (i')>=0) { + s = s.replace(/for \(/g, 'for (var '); + } + eval('window.' + f + '=function(' + getArgsStr(a) + '){' + s + '}'); + } else { + eval('window.' + f + '=new Function(' + getArgsStr(a, true) + 's);'); + } +} function hpInterceptFeedback() { // modify the function which writes feedback // v6: ShowMessage(Feedback) @@ -2194,7 +2263,7 @@ function hpInterceptFeedback() { if (a[0] && window.FEEDBACK && FEEDBACK[0]) { s = a[0] + "+='

" + '' + FEEDBACK[6] + "';" + s; } - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);'); + hpNewFunction(f, a, s); } } function hpInterceptHints() { @@ -2257,7 +2326,7 @@ function hpInterceptHints() { // add the e(x)tra code, if any, to the start of the hint (f)unction if (x) { var s = getFuncCode(f, x, '', true); - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);'); + hpNewFunction(f, a, s); } } function hpInterceptClues() { @@ -2312,7 +2381,8 @@ function hpInterceptClues() { // add the e(x)tra code, if any, to the start of the clue (f)unction if (x) { var s = getFuncCode(f, x, '', true); - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);'); + var s = getFuncCode(f, '', '', true); + hpNewFunction(f, a, s); } } function hpInterceptChecks() { @@ -2354,7 +2424,7 @@ function hpInterceptChecks() { if (x) { x = "if(!Finished&&State[QNum].length&&State[QNum][0]<0){" + x + "hpClick(3,args)}"; var s = getFuncCode(f[i], x, '', true); - eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);'); + hpNewFunction(f[i], a, s); } } } @@ -2394,7 +2464,7 @@ function hpInterceptChecks() { } if (f) { var s = getFuncCode(f, x, '', true); - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);'); + hpNewFunction(f, a, s); } // JMatch has three possible check functions, depending on the version // (NB: other quiz types also have these functions) @@ -2404,7 +2474,7 @@ function hpInterceptChecks() { var a = getFuncArgs(f[i], true); if (a.length==0) { var s = getFuncCode(f[i], "hpClick(3);", '', true); - eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);'); + hpNewFunction(f[i], a, s); break; // out of the loop } } @@ -2690,7 +2760,13 @@ function hpScore() { } else if (t==3) { // jcross if (v==3) x = hpScoreEngine(1, CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex==a[i]"); else if (v==4) x = hpScoreEngine(1, WinLetters, "ConvertCase(GetBoxValue(i),1).charAt(0)==a[i].charAt(0)"); - else if (v==5 || v==6) x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii]==G[i][ii]", "L[i][ii]"); + else if (v==5 || v==6) { + if (window.CaseSensitive) { // HP 6.2 + x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii]==G[i][ii]", "L[i][ii]"); + } else { + x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii].toUpperCase()==G[i][ii].toUpperCase()", "L[i][ii]"); + } + } } else if (t==4) { // jmatch if (v==3) x = hpScoreEngine(1, CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex==a[i]"); else if (v==4) x = hpScoreEngine(1, Draggables, "a[i].correct=='1'"); @@ -2771,7 +2847,13 @@ function hpFinished() { } else if (t==3) { // jcross if (v==3) x = hpFinishedEngine(document.Crossword.elements, "ConvertCase(is.mac?unescape(MacStringToWin(a[i].value)):a[i].value,1)!=Letters[i]"); else if (v==4) x = hpFinishedEngine(WinLetters, "ConvertCase(GetBoxValue(i),1).charAt(0) != a[i].charAt(0)"); - else if (v==5 || v==6) x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii]!=G[i][ii]"); + else if (v==5 || v==6) { + if (window.CaseSensitive) { // 6.2 + x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii]!=G[i][ii]"); + } else { + x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii].toUpperCase()!=G[i][ii].toUpperCase()"); + } + } } else if (t==4) { // jmatch if (v==3) x = hpFinishedEngine(CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex != a[i]"); else if (v==4) x = hpFinishedEngine(Draggables, "a[i].correct!='1'"); @@ -2830,9 +2912,9 @@ function hpIsStrict() { // ************** // initialization // ************** -hpInterceptFeedback(); -hpInterceptHints(); -hpInterceptClues(); +//hpInterceptFeedback(); +//hpInterceptHints(); +//hpInterceptClues(); hpInterceptChecks(); function hpFindForm(formname, w) { if (w==null) w = self; @@ -2896,8 +2978,13 @@ if (DB[7] && DB[8] && !is_LMS()) { var p = getPrompt(window.GetUserName || window.StartUp); var c = getStartUpCode(window.StartUp); if (p && c) { - window.StartUp = new Function('QuizLogin("' + p + '")'); - window.StartQuiz = new Function(c); + if (window.C && C.safari) { + eval('window.StartUp=function(){QuizLogin("' + p + '")}'); + eval('window.StartQuiz=function(){' + c + '}'); + } else { + window.StartUp = new Function('QuizLogin("' + p + '")'); + window.StartQuiz = new Function(c); + } // "QuizLogin" finshes by calling "StartQuiz" } // reassign the SendResults function diff --git a/mod/hotpot/template/default.php b/mod/hotpot/template/default.php index 4f35b28e3f..b570e4b340 100644 --- a/mod/hotpot/template/default.php +++ b/mod/hotpot/template/default.php @@ -24,11 +24,11 @@ class hotpot_xml_template_default { // [1] the full block name (including optional leading 'str' or 'incl') // [2] leading 'incl' or 'str', if any // [3] the real block name ([1] without [2]) - $search = '/\[\/((incl|str)?(\w+))\]/'; + $search = '/\[\/((incl|str)?((?:\w|\.)+))\]/'; preg_match_all($search, $this->$tag, $names); $i_max = count($names[0]); for ($i=0; $i<$i_max; $i++) { - $method = $this->parent->template_dir.'_expand_'.$names[3][$i]; + $method = $this->parent->template_dir.'_expand_'.str_replace('.', '', $names[3][$i]); if (method_exists($this, $method)) { eval('$value=$this->'.$method.'();'); $search = '/\['.$names[1][$i].'\](.*?)\[\/'.$names[1][$i].'\]/s'; diff --git a/mod/hotpot/template/v6.php b/mod/hotpot/template/v6.php index 72886764a5..71c32661a7 100644 --- a/mod/hotpot/template/v6.php +++ b/mod/hotpot/template/v6.php @@ -324,6 +324,11 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default { return $this->v6_expand_NavButtons(); } + // switch off scorm + function v6_expand_Scorm12() { + return false; + } + // js files (all quiz types) function v6_expand_JSBrowserCheck() { diff --git a/mod/hotpot/template/v6/djmatch6.ht_ b/mod/hotpot/template/v6/djmatch6.ht_ index 37141ff76f..04a96e1686 100644 --- a/mod/hotpot/template/v6/djmatch6.ht_ +++ b/mod/hotpot/template/v6/djmatch6.ht_ @@ -29,6 +29,10 @@ [inclNavButtons] @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
diff --git a/mod/hotpot/template/v6/djmatch6.js_ b/mod/hotpot/template/v6/djmatch6.js_ index 2ca48f9aa9..65a148a947 100644 --- a/mod/hotpot/template/v6/djmatch6.js_ +++ b/mod/hotpot/template/v6/djmatch6.js_ @@ -1,4 +1,32 @@ +[inclScorm1.2] +//JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); + + +//Now send a detailed reports on the item + var ItemLabel = 'Matching'; + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel); + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel); + API.LMSSetValue('cmi.objectives.0.status', API.LMSGetValue('cmi.core.lesson_status')); + API.LMSSetValue('cmi.objectives.0.score.min', '0'); + API.LMSSetValue('cmi.objectives.0.score.max', '100'); + API.LMSSetValue('cmi.objectives.0.score.raw', Score); +//We can only use the performance type, because we're storing multiple responses of various types. + API.LMSSetValue('cmi.interactions.0.type', 'performance'); + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried); + + API.LMSCommit(''); + } +} +[/inclScorm1.2] + +//JMATCH-SPECIFIC CORE JAVASCRIPT CODE + var CorrectResponse = '[strGuessCorrect]'; var IncorrectResponse = '[strGuessIncorrect]'; var YourScoreIs = '[strYourScoreIs]'; @@ -20,6 +48,7 @@ var LeftColPos = 100; var RightColPos = 500; var DragTop = 120; var Finished = false; +var AnswersTried = ''; //Fixed and draggable card arrays FC = new Array(); @@ -69,6 +98,10 @@ function DroppedOnFixed(DNum){ function StartUp(){ +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] + [inclSendResults] GetUserName(); [/inclSendResults] @@ -140,10 +173,9 @@ function StartUp(){ if (TempInt > WidestRight){WidestRight = TempInt;} } - var HeightToSet = Highest; - if (C.gecko||C.ie5mac){HeightToSet -= 12;} - var WidthToSet = WidestRight; - if (C.gecko||C.ie5mac){WidthToSet -= 12;} +//Fix for 6.2: the reduction by 12 seems to be required -- no idea why! + var HeightToSet = Highest-12; + var WidthToSet = WidestRight-12; for (i=0; i 0){AnswersTried += ' | ';} var i, j; for (i=0; i0){AnswersTried += ',';} + AnswersTried += D[i][1] + '.' + D[i][2] + ''; if ((D[i][2] == D[i][1])&&(D[i][2] > 0)){ TotalCorrect++; } @@ -307,6 +342,14 @@ function CheckAnswers(){ setTimeout('Finish()', SubmissionTimeout); WriteToInstructions(Feedback); } +[inclScorm1.2] + if (AllDone == true){ + SetScormComplete(); + } + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } [inclTimer] @@ -318,6 +361,9 @@ function TimesUp() { TimeOver = true; CheckAnswers(); Locked = true; +[inclScorm1.2] + SetScormTimedOut(); +[/inclScorm1.2] } [/inclTimer] diff --git a/mod/hotpot/template/v6/djmix6.ht_ b/mod/hotpot/template/v6/djmix6.ht_ index d954337e41..1fb8c7c9fc 100644 --- a/mod/hotpot/template/v6/djmix6.ht_ +++ b/mod/hotpot/template/v6/djmix6.ht_ @@ -29,6 +29,10 @@ [inclNavButtons] @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
diff --git a/mod/hotpot/template/v6/djmix6.js_ b/mod/hotpot/template/v6/djmix6.js_ index 8059a7c070..e568c04660 100644 --- a/mod/hotpot/template/v6/djmix6.js_ +++ b/mod/hotpot/template/v6/djmix6.js_ @@ -1,3 +1,35 @@ +[inclScorm1.2] +//JMMIX-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); + +//Now send a detailed reports on the item + var ItemLabel = 'Item_1'; + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel); + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel); + if (Finished == true){ + API.LMSSetValue('cmi.objectives.0.status', 'completed'); + } + else{ + API.LMSSetValue('cmi.objectives.0.status', 'incomplete'); + } + + API.LMSSetValue('cmi.objectives.0.score.min', '0'); + API.LMSSetValue('cmi.objectives.0.score.max', '100'); + API.LMSSetValue('cmi.objectives.0.score.raw', Score); +//We can only use the performance type, because we're storing multiple responses of various types. + API.LMSSetValue('cmi.interactions.0.type', 'performance'); + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried); + + + API.LMSCommit(''); + } +} +[/inclScorm1.2] + //JMIX DRAG-DROP OUTPUT FORMAT CODE var Punctuation = '[strPunctuation]'; @@ -37,6 +69,7 @@ var DivWidth = 600; var LeftColPos = 100; var DragTop = 120; var DragNumber = -1; +var AnswersTried = ''; Lines = new Array(); @@ -211,6 +244,9 @@ function CheckAnswer(CheckType){ } } WellDone = '' + CompiledOutput + '

' + CorrectResponse + '
'; + + if (AnswersTried.length > 0){AnswersTried += ' | ';} + AnswersTried += CompiledOutput; //Do score calculation here Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length); @@ -227,7 +263,10 @@ function CheckAnswer(CheckType){ } else{ - TryAgain = '' + CompileString(GuessSequence) + '

'; + var WrongGuess = CompileString(GuessSequence); + if (AnswersTried.length > 0){AnswersTried += ' | ';} + AnswersTried += WrongGuess; + TryAgain = '' + WrongGuess + '

'; if ((CheckType == 0)||(LongestCorrect.length==0)){ TryAgain += IncorrectResponse + '
'; } @@ -267,6 +306,15 @@ function CheckAnswer(CheckType){ setTimeout('Finish()', SubmissionTimeout); WriteToInstructions(YourScoreIs + ' ' + Score + '%.'); } + +[inclScorm1.2] + if (AllDone == true){ + SetScormComplete(); + } + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } @@ -396,6 +444,10 @@ function StartUp(){ GetUserName(); [/inclSendResults] +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] + [inclPreloadImages] PreloadImages([PreloadImageList]); [/inclPreloadImages] @@ -517,5 +569,8 @@ function TimesUp() { TimeOver = true; CheckAnswer(0); Locked = true; +[inclScorm1.2] + SetScormTimedOut(); +[/inclScorm1.2] } [/inclTimer] diff --git a/mod/hotpot/template/v6/fjmatch6.ht_ b/mod/hotpot/template/v6/fjmatch6.ht_ index 3ec5d096b6..2a22c60e52 100644 --- a/mod/hotpot/template/v6/fjmatch6.ht_ +++ b/mod/hotpot/template/v6/fjmatch6.ht_ @@ -29,6 +29,9 @@ - + @@ -66,7 +69,7 @@
-

[strInstructions]

+
[strInstructions]
diff --git a/mod/hotpot/template/v6/fjmatch6.js_ b/mod/hotpot/template/v6/fjmatch6.js_ index 79db982d86..988ac5435a 100644 --- a/mod/hotpot/template/v6/fjmatch6.js_ +++ b/mod/hotpot/template/v6/fjmatch6.js_ @@ -1,4 +1,17 @@ +[inclScorm1.2] +//JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormBrowseTime(){ +if (API != null){ + API.LMSSetValue('cmi.core.session_time', MillisecondsToTime((new Date()).getTime() - ScormStartTime)); + API.LMSCommit(''); + } +} +[/inclScorm1.2] + +//JMATCH-SPECIFIC CORE JAVASCRIPT CODE + var CurrItem = null; var Stage = 2; var QList = new Array(); @@ -34,6 +47,17 @@ function SetUpItems(){ function StartUp(){ SetUpItems(); + +[inclScorm1.2] + initAPI(window); + if (API != null){ + API.LMSInitialize(''); + API.LMSSetValue('cmi.core.lesson_status', 'browsed'); + API.LMSSetValue('cmi.comments', 'This exercise has no checking or scoring features.'); + API.LMSCommit(''); + } +[/inclScorm1.2] + [inclPreloadImages] PreloadImages([PreloadImageList]); diff --git a/mod/hotpot/template/v6/hp6.cs_ b/mod/hotpot/template/v6/hp6.cs_ index 2ea245bcda..05c9b3e700 100644 --- a/mod/hotpot/template/v6/hp6.cs_ +++ b/mod/hotpot/template/v6/hp6.cs_ @@ -6,6 +6,12 @@ /* Made with executable version [strFullVersionInfo] */ + +/* Hack to hide a nested Quicktime player from IE, which can't handle it. */ +* html object.MediaPlayerNotForIE { + display: none; +} + body{ font-family: [strFontFace]; [inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor] @@ -381,6 +387,7 @@ div#ClueEntry{ div.Keypad{ text-align: center; display: none; /* initially hidden, shown if needed */ + margin-bottom: 0.5em; } div.Keypad button{ @@ -408,7 +415,9 @@ textarea{ } .QuestionText{ - + text-align: left; + margin: 0px; + font-size: 100%; } .Answer{ diff --git a/mod/hotpot/template/v6/hp6checkshortanswer.js_ b/mod/hotpot/template/v6/hp6checkshortanswer.js_ index ce7357f4e8..f3570d4d3a 100644 --- a/mod/hotpot/template/v6/hp6checkshortanswer.js_ +++ b/mod/hotpot/template/v6/hp6checkshortanswer.js_ @@ -186,8 +186,13 @@ function CheckShortAnswer(QNum){ CA.GetBestMatch(); //Store any match in the state tracking field + if (State[QNum][5].length > 0){State[QNum][5] += ' | ';} if (CA.MatchNum > -1){ - State[QNum][5] += String.fromCharCode(65+CA.MatchNum) + ','; + State[QNum][5] += String.fromCharCode(65+CA.MatchNum); + } +//Else store the student's answer + else{ + State[QNum][5] += G; } //Add the percent correct value for this answer to the Q State (works for all diff --git a/mod/hotpot/template/v6/hp6objecttags.ht_ b/mod/hotpot/template/v6/hp6objecttags.ht_ index 5079028582..ad0e157764 100644 --- a/mod/hotpot/template/v6/hp6objecttags.ht_ +++ b/mod/hotpot/template/v6/hp6objecttags.ht_ @@ -1,18 +1,7 @@ -[QuickTime Player] - - - - - - - - -[strContent] -[/QuickTime Player] +[QuickTime Player] [strContent] [/QuickTime Player] -[Windows Media Player] - +[Windows Media Player] [strContent] @@ -26,10 +15,4 @@ [strContent][/Real Player] -[Flash Player] - - -[strContent][/Flash Player] +[Flash Player] [strContent][/Flash Player] diff --git a/mod/hotpot/template/v6/hp6sendresults.js_ b/mod/hotpot/template/v6/hp6sendresults.js_ index cff751d134..b860ec8f05 100644 --- a/mod/hotpot/template/v6/hp6sendresults.js_ +++ b/mod/hotpot/template/v6/hp6sendresults.js_ @@ -6,17 +6,17 @@ var UserName = ''; var StartTime = (new Date()).toLocaleString(); var ResultForm = '
'; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -ResultForm += ''; -[inclPageBGColor]ResultForm += '';[/inclPageBGColor] -ResultForm += ''; -ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +ResultForm += ''; +[inclPageBGColor]ResultForm += '';[/inclPageBGColor] +ResultForm += ''; +ResultForm += ''; ResultForm += '
'; function GetUserName(){ diff --git a/mod/hotpot/template/v6/hp6showmessage.js_ b/mod/hotpot/template/v6/hp6showmessage.js_ index 98a33c2b08..58dde4675f 100644 --- a/mod/hotpot/template/v6/hp6showmessage.js_ +++ b/mod/hotpot/template/v6/hp6showmessage.js_ @@ -6,49 +6,74 @@ var topZ = 1000; function ShowMessage(Feedback){ var Output = Feedback + '

'; + document.getElementById('FeedbackContent').innerHTML = Output; + var FDiv = document.getElementById('FeedbackDiv'); + topZ++; + FDiv.style.zIndex = topZ; + FDiv.style.top = TopSettingWithScrollOffset(30) + 'px'; - var obj = document.getElementById('FeedbackContent'); - if (obj) { - obj.innerHTML = Output; - } - var obj = document.getElementById('FeedbackDiv'); - if (obj) { - topZ++; - obj.style.zIndex = topZ; - obj.style.top = TopSettingWithScrollOffset(30) + 'px'; - obj.style.display = 'block'; - } + FDiv.style.display = 'block'; ShowElements(false, 'input'); ShowElements(false, 'select'); ShowElements(false, 'object'); + ShowElements(true, 'object', 'FeedbackContent'); //Focus the OK button - var obj = document.getElementById('FeedbackOKButton'); - if (obj) { - setTimeout("document.getElementById('FeedbackOKButton').focus()", 50); - } + setTimeout("document.getElementById('FeedbackOKButton').focus()", 50); //[inclPreloadImages] // RefreshImages(); //[/inclPreloadImages] } -function ShowElements(Show, TagName){ -//Special for IE bug -- hide all the form elements that will show through the popup - if (C.ie){ - var Els = document.getElementsByTagName(TagName); - for (var i=0; i - + @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
[inclReading] @@ -126,7 +130,7 @@ [inclKeypad] -
+
[strKeypad]
[/inclKeypad] diff --git a/mod/hotpot/template/v6/jcloze6.js_ b/mod/hotpot/template/v6/jcloze6.js_ index 95b0c53d0c..3a22cce217 100644 --- a/mod/hotpot/template/v6/jcloze6.js_ +++ b/mod/hotpot/template/v6/jcloze6.js_ @@ -1,4 +1,39 @@ +[inclScorm1.2] +//JCLOZE-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); +//Now send detailed reports about each item + for (var i=0; i0){ThisItemGuesses += ' | ';} + ThisItemGuesses += State[i].Guesses[j]; + } + API.LMSSetValue('cmi.interactions.' + i + '.type', 'fill-in'); + API.LMSSetValue('cmi.interactions.' + i + '.student_response', ThisItemGuesses); + } + API.LMSCommit(''); + } +} +[/inclScorm1.2] + //JCLOZE CORE JAVASCRIPT CODE function ItemState(){ @@ -31,6 +66,14 @@ State = new Array(); function StartUp(){ RemoveBottomNavBarForIE(); +//Show a keypad if there is one (added bugfix for 6.0.4.12) + if (document.getElementById('CharacterKeypad') != null){ + document.getElementById('CharacterKeypad').style.display = 'block'; + } + +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] [inclSendResults] GetUserName(); @@ -62,7 +105,7 @@ function ShowClue(ItemNum){ } function SaveCurrentAnswers(){ - var Ans = '' + var Ans = ''; for (var i=0; i 0)&&(Ans != State[i].Guesses[State[i].Guesses.length-1])){ @@ -146,6 +189,7 @@ function CheckAnswers(){ CompileGuesses(); if ((AllCorrect == true)||(Finished == true)){ + [inclSendResults] setTimeout('SendResults(' + TotalScore + ')', 50); [/inclSendResults] @@ -157,6 +201,14 @@ function CheckAnswers(){ Finished = true; setTimeout('Finish()', SubmissionTimeout); } +[inclScorm1.2] + if (AllCorrect == true){ + SetScormComplete(); + } + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } function TrackFocus(BoxNumber){ @@ -299,6 +351,7 @@ function GetHint(GapNum){ } function ShowHint(){ + if (document.getElementById('FeedbackDiv').style.display == 'block'){return;} if (Locked == true){return;} var CurrGap = FindCurrent(); if (CurrGap < 0){return;} @@ -330,5 +383,8 @@ function TimesUp() { Finished = true; CheckAnswers(); Locked = true; +[inclScorm1.2] + SetScormTimedOut(); +[/inclScorm1.2] } [/inclTimer] \ No newline at end of file diff --git a/mod/hotpot/template/v6/jcross6.ht_ b/mod/hotpot/template/v6/jcross6.ht_ index 706af6956b..bcaeea9768 100644 --- a/mod/hotpot/template/v6/jcross6.ht_ +++ b/mod/hotpot/template/v6/jcross6.ht_ @@ -29,6 +29,10 @@ @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
[inclReading] @@ -102,7 +106,7 @@
[inclKeypad] -
+
[strKeypad]
[/inclKeypad] diff --git a/mod/hotpot/template/v6/jcross6.js_ b/mod/hotpot/template/v6/jcross6.js_ index 11833c4544..26c911ff05 100644 --- a/mod/hotpot/template/v6/jcross6.js_ +++ b/mod/hotpot/template/v6/jcross6.js_ @@ -1,3 +1,31 @@ +[inclScorm1.2] +//JCROSS-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); + +//Now send a detailed reports on the item + var ItemLabel = 'Crossword'; + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel); + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel); + if (Finished == true){ + API.LMSSetValue('cmi.objectives.0.status', 'completed'); + } + else{ + API.LMSSetValue('cmi.objectives.0.status', 'incomplete'); + } + API.LMSSetValue('cmi.objectives.0.score.min', '0'); + API.LMSSetValue('cmi.objectives.0.score.max', '100'); + API.LMSSetValue('cmi.objectives.0.score.raw', Score); +//We're not sending any student response data, so we can set this to a non-standard value + API.LMSSetValue('cmi.interactions.0.type', 'crossword'); + + API.LMSCommit(''); + } +} +[/inclScorm1.2] //JCROSS CORE JAVASCRIPT CODE @@ -17,9 +45,10 @@ var Score = 0; var InTextBox = false; var Locked = false; var TimeOver = false; +var CaseSensitive = [boolCaseSensitive]; var InputStuff = '
[strClueNum]: '; -InputStuff += '[strClue] '; +InputStuff += '[strClue] '; InputStuff += ''; InputStuff += '[inclHint][/inclHint]'; InputStuff += '
'; @@ -29,6 +58,14 @@ var Finished = false; function StartUp(){ RemoveBottomNavBarForIE(); +//Show a keypad if there is one (added bugfix for 6.0.4.12) + if (document.getElementById('CharacterKeypad') != null){ + document.getElementById('CharacterKeypad').style.display = 'block'; + } +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] + AcrossCaption = document.getElementById('CluesAcrossLabel').innerHTML; DownCaption = document.getElementById('CluesDownLabel').innerHTML; [inclSendResults] @@ -126,8 +163,6 @@ function SplitStringToPerceivedChars(InString, PC){ } function EnterAnswer(Guess,Across,AnsLength,x,y){ - Guess = Guess.toUpperCase(); - var PC = new Array(); SplitStringToPerceivedChars(Guess, PC); @@ -161,12 +196,23 @@ function SetGridSquareValue(x,y,Val){ function ShowHint(Across,ClueNum,x,y,BoxId){ var i=x; var j=y; + var LetterFromGuess = ''; + var LetterFromKey = ''; var OutString = ''; if (Across==true){ while (j - + @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
[inclReading] diff --git a/mod/hotpot/template/v6/jmatch6.js_ b/mod/hotpot/template/v6/jmatch6.js_ index a1153f4320..1922189d8e 100644 --- a/mod/hotpot/template/v6/jmatch6.js_ +++ b/mod/hotpot/template/v6/jmatch6.js_ @@ -1,4 +1,39 @@ +[inclScorm1.2] +//JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); + +//Now send a detailed reports on the item + var ItemLabel = 'Matching'; + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel); + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel); + API.LMSSetValue('cmi.objectives.0.status', API.LMSGetValue('cmi.core.lesson_status')); + API.LMSSetValue('cmi.objectives.0.score.min', '0'); + API.LMSSetValue('cmi.objectives.0.score.max', '100'); + API.LMSSetValue('cmi.objectives.0.score.raw', Score); +//We can only use the performance type, because we're storing multiple responses of various types. + API.LMSSetValue('cmi.interactions.0.type', 'performance'); + + var AnswersTried = ''; + for (var i=0; i0){AnswersTried += ' | ';} + for (var j=0; j0){AnswersTried += ',';} + AnswersTried += j + '.' + Status[j][3][i]; + } + } + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried); + API.LMSCommit(''); + } +} +[/inclScorm1.2] + +//JMATCH CORE JAVASCRIPT CODE + var CorrectIndicator = '[strCorrectIndicator]'; var IncorrectIndicator = '[strIncorrectIndicator]'; var YourScoreIs = '[strYourScoreIs]'; @@ -19,6 +54,10 @@ var QsToShow = [QsToShow]; function StartUp(){ RemoveBottomNavBarForIE(); +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] + [inclSendResults] GetUserName(); [/inclSendResults] @@ -49,6 +88,7 @@ function CreateStatusArrays(){ Status[x][0] = 0; // Item not matched correctly yet Status[x][1] = 0; //Tries at this item so far Status[x][2] = Selects[x].id; //Store a ref to the original drop-down + Status[x][3] = new Array(); //Sequence of guesses for this item } } @@ -182,6 +222,8 @@ function CheckAnswers(){ //Get a pointer to the drop-down Select = document.getElementById(Status[i][2]); Key = GetKeyFromSelect(Select); +//Save the answer given + Status[i][3].push(Select.options[Select.selectedIndex].value); //Check the answer if (Select.options[Select.selectedIndex].value == Key){ @@ -198,6 +240,10 @@ function CheckAnswers(){ Parent.nextSibling.innerHTML = IncorrectIndicator; } } + else{ +//Add a copy of the last (correct) answer. + Status[i][3].push(Status[i][3][Status[i][3].length-1]); + } //If it's correct, count it if (Status[i][0] == 1){ TotCorrectChoices++; @@ -235,6 +281,15 @@ function CheckAnswers(){ //Show the feedback ShowMessage(Feedback); + +[inclScorm1.2] + if (AllDone == true){ + SetScormComplete(); + } + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } [inclTimer] @@ -247,6 +302,9 @@ function TimesUp() { Finished = true; CheckAnswers(); Locked = true; +[inclScorm1.2] + SetScormTimedOut(); +[/inclScorm1.2] } [/inclTimer] diff --git a/mod/hotpot/template/v6/jmix6.ht_ b/mod/hotpot/template/v6/jmix6.ht_ index a25997b185..54c92d46dd 100644 --- a/mod/hotpot/template/v6/jmix6.ht_ +++ b/mod/hotpot/template/v6/jmix6.ht_ @@ -29,6 +29,10 @@ @@ -80,7 +84,7 @@
-

[strInstructions]

+
[strInstructions]
[inclReading] diff --git a/mod/hotpot/template/v6/jmix6.js_ b/mod/hotpot/template/v6/jmix6.js_ index 18d1fe0de9..52dbd73ac6 100644 --- a/mod/hotpot/template/v6/jmix6.js_ +++ b/mod/hotpot/template/v6/jmix6.js_ @@ -1,5 +1,35 @@ -//JMIX STANDARD OUTPUT FORMAT CODE +[inclScorm1.2] +//JMIX-SPECIFIC SCORM-RELATED JAVASCRIPT CODE +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); + +//Now send a detailed reports on the item + var ItemLabel = 'Item_1'; + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel); + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel); + if (Finished == true){ + API.LMSSetValue('cmi.objectives.0.status', 'completed'); + } + else{ + API.LMSSetValue('cmi.objectives.0.status', 'incomplete'); + } + + API.LMSSetValue('cmi.objectives.0.score.min', '0'); + API.LMSSetValue('cmi.objectives.0.score.max', '100'); + API.LMSSetValue('cmi.objectives.0.score.raw', Score); +//We can only use the performance type, because we're storing multiple responses of various types. + API.LMSSetValue('cmi.interactions.0.type', 'performance'); + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried); + + API.LMSCommit(''); + } +} +[/inclScorm1.2] + +//JMIX STANDARD OUTPUT FORMAT CODE var CorrectResponse = '[strGuessCorrect]'; var IncorrectResponse = '[strGuessIncorrect]'; @@ -13,6 +43,7 @@ var Finished = false; var TimeOver = false; var Score = 0; var strInstructions = ''; +var AnswersTried = ''; var SegmentTemplate = '   [CurrentSegment]   '; @@ -209,6 +240,9 @@ function CheckAnswer(CheckType){ WellDone = '' + Output + '

' + CorrectResponse + '
'; + if (AnswersTried.length > 0){AnswersTried += ' | ';} + AnswersTried += Output; + //Do score calculation here Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length); WellDone += YourScoreIs + ' ' + Score + '%.
'; @@ -224,7 +258,10 @@ function CheckAnswer(CheckType){ } else{ - TryAgain = '' + CompileString(GuessSequence) + '

'; + var WrongGuess = CompileString(GuessSequence); + if (AnswersTried.length > 0){AnswersTried += ' | ';} + AnswersTried += WrongGuess; + TryAgain = '' + WrongGuess + '

'; if (CheckType == 0){ TryAgain += IncorrectResponse + '
'; } @@ -276,6 +313,14 @@ function CheckAnswer(CheckType){ setTimeout('Finish()', SubmissionTimeout); WriteToInstructions(YourScoreIs + ' ' + Score + '%.'); } +[inclScorm1.2] + if (AllDone == true){ + SetScormComplete(); + } + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } function FindSegment(SegID){ @@ -299,6 +344,10 @@ function StartUp(){ GetUserName(); [/inclSendResults] +[inclScorm1.2] + ScormStartUp(); +[/inclScorm1.2] + [inclPreloadImages] PreloadImages([PreloadImageList]); [/inclPreloadImages] @@ -353,5 +402,8 @@ function TimesUp() { Finished = true; CheckAnswer(0); Locked = true; +[inclScorm1.2] + SetScormTimedOut(); +[/inclScorm1.2] } [/inclTimer] \ No newline at end of file diff --git a/mod/hotpot/template/v6/jquiz6.ht_ b/mod/hotpot/template/v6/jquiz6.ht_ index b26834c233..3cedaefe1f 100644 --- a/mod/hotpot/template/v6/jquiz6.ht_ +++ b/mod/hotpot/template/v6/jquiz6.ht_ @@ -29,6 +29,10 @@ @@ -84,7 +88,7 @@
-

[strInstructions]

+
[strInstructions]
[inclReading] diff --git a/mod/hotpot/template/v6/jquiz6.js_ b/mod/hotpot/template/v6/jquiz6.js_ index 92f331bf84..cf1a4f73cf 100644 --- a/mod/hotpot/template/v6/jquiz6.js_ +++ b/mod/hotpot/template/v6/jquiz6.js_ @@ -1,4 +1,43 @@ +[inclScorm1.2] +//JQUIZ-SPECIFIC SCORM-RELATED JAVASCRIPT CODE + +function SetScormScore(){ +//Reports the current score and any other information back to the LMS + if (API != null){ + API.LMSSetValue('cmi.core.score.raw', Score); +//Now send detailed reports about each item + for (var i=0; i 0){ + ThisItemScore = Math.floor(State[i][0] * 100) + ''; + ThisItemStatus = 'completed'; + } + else{ + ThisItemScore = '0'; + ThisItemStatus = 'incomplete'; + } + API.LMSSetValue('cmi.objectives.' + i + '.score.raw', ThisItemScore); + API.LMSSetValue('cmi.objectives.' + i + '.status', ThisItemStatus); + API.LMSSetValue('cmi.interactions.' + i + '.weighting', I[i][0]); +//We can only use the performance type, because we're storing multiple responses of various types. + API.LMSSetValue('cmi.interactions.' + i + '.type', 'performance'); + API.LMSSetValue('cmi.interactions.' + i + '.student_response', State[i][5]); + } + } + + API.LMSCommit(''); + } +} +[/inclScorm1.2] + //JQUIZ CORE JAVASCRIPT CODE var CurrQNum = 0; @@ -24,6 +63,7 @@ var State = new Array(); var Feedback = ''; var TimeOver = false; var strInstructions = ''; +var Locked = false; //The following variable can be used to add a message explaining that //the question is finished, so no further marking will take place. @@ -153,7 +193,8 @@ function ShowSpecialReadingForQuestion(){ document.getElementById('ReadingDiv').innerHTML = ''; } if (QArray[CurrQNum] != null){ - var Children = QArray[CurrQNum].childNodes; +//Fix for 6.0.4.25 + var Children = QArray[CurrQNum].getElementsByTagName('div'); for (var i=0; i 0){State[QNum][5] += ' | ';} + State[QNum][5] += String.fromCharCode(65+ANum); //Should this answer be accepted as correct? if (I[QNum][3][ANum][2] < 1){ @@ -446,7 +492,7 @@ function CheckMultiSelAnswer(QNum){ var ShouldBeChecked; var Matches = 0; - State[QNum][5] += '|'; + if (State[QNum][5].length > 0){State[QNum][5] += ' | ';} //Check if there are any mismatches Feedback = ''; @@ -563,6 +609,16 @@ function CheckFinished(){ [inclTimer] window.clearInterval(Interval); [/inclTimer] + +[inclScorm1.2] + if (TimeOver == true){ + SetScormTimedOut(); + } + else{ + SetScormComplete(); + } +[/inclScorm1.2] + TimeOver = true; Locked = true; @@ -582,6 +638,11 @@ function CheckFinished(){ Detail += ''; setTimeout('Finish()', SubmissionTimeout); } +[inclScorm1.2] + else{ + SetScormIncomplete(); + } +[/inclScorm1.2] } [inclTimer] diff --git a/mod/hotpot/template/v6/masher.ht_ b/mod/hotpot/template/v6/masher.ht_ index d6755b708d..fa795d8f30 100644 --- a/mod/hotpot/template/v6/masher.ht_ +++ b/mod/hotpot/template/v6/masher.ht_ @@ -11,6 +11,10 @@ + + +[strHeaderCode] +