Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add HP 6.2 templates; add compatability with Safari (Mac browser); mi…

…croincrement version to 2006091202 (release 2.2.1)
  • Loading branch information...
commit 4b168cfabcffbc8d20b46893042ea8bb165d9b49 1 parent ffa6c35
gbateson authored

Showing 28 changed files with 752 additions and 135 deletions. Show diff stats Hide diff stats

  1. +1 1  mod/hotpot/README.TXT
  2. +158 42 mod/hotpot/hotpot-full.js
  3. +2 2 mod/hotpot/template/default.php
  4. +5 0 mod/hotpot/template/v6.php
  5. +6 2 mod/hotpot/template/v6/djmatch6.ht_
  6. +50 4 mod/hotpot/template/v6/djmatch6.js_
  7. +6 2 mod/hotpot/template/v6/djmix6.ht_
  8. +56 1 mod/hotpot/template/v6/djmix6.js_
  9. +5 2 mod/hotpot/template/v6/fjmatch6.ht_
  10. +24 0 mod/hotpot/template/v6/fjmatch6.js_
  11. +10 1 mod/hotpot/template/v6/hp6.cs_
  12. +6 1 mod/hotpot/template/v6/hp6checkshortanswer.js_
  13. +3 20 mod/hotpot/template/v6/hp6objecttags.ht_
  14. +48 23 mod/hotpot/template/v6/hp6showmessage.js_
  15. +18 7 mod/hotpot/template/v6/hp6utilities.js_
  16. +7 3 mod/hotpot/template/v6/jcloze6.ht_
  17. +57 1 mod/hotpot/template/v6/jcloze6.js_
  18. +7 3 mod/hotpot/template/v6/jcross6.ht_
  19. +82 6 mod/hotpot/template/v6/jcross6.js_
  20. +6 2 mod/hotpot/template/v6/jmatch6.ht_
  21. +58 0 mod/hotpot/template/v6/jmatch6.js_
  22. +6 2 mod/hotpot/template/v6/jmix6.ht_
  23. +54 2 mod/hotpot/template/v6/jmix6.js_
  24. +6 2 mod/hotpot/template/v6/jquiz6.ht_
  25. +64 3 mod/hotpot/template/v6/jquiz6.js_
  26. +4 0 mod/hotpot/template/v6/masher.ht_
  27. +1 1  mod/hotpot/template/v6/testbrowsercheck.htm
  28. +2 2 mod/hotpot/version.php
2  mod/hotpot/README.TXT
... ... @@ -1,5 +1,5 @@
1 1 ==================================================
2   -This is v2.2.0 of the HotPot module for Moodle 1.7
  2 +This is v2.2.1 of the HotPot module for Moodle 1.7
3 3 ==================================================
4 4
5 5 This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle.
200 mod/hotpot/hotpot-full.js
@@ -1014,9 +1014,23 @@ function GetJClozeQuestionDetails(hp, v) {
1014 1014 if (r!=2.1) { // exclude Find-It 3a
1015 1015 for (var i=0, ii=0; i<I[q][1].length; i++) {
1016 1016 var s = I[q][1][i][0];
1017   - if (typeof(s)=='string' && s!='' && (s.toUpperCase() != correct.toUpperCase())) {
1018   - x[ii++] = s;
1019   - }
  1017 + if (typeof(s)=='string' && s!='') {
  1018 + if (s.toUpperCase() == correct.toUpperCase()) {
  1019 + var is_ignored = false;
  1020 + } else {
  1021 + // DropDown 2.4
  1022 + var is_ignored = true;
  1023 + var iii_max = HP[_wrong][q] ? HP[_wrong][q].length : 0;
  1024 + for (var iii=0; iii<iii_max; iii++) {
  1025 + if (s.toUpperCase() == HP[_wrong][q][iii].toUpperCase()) {
  1026 + var is_ignored = false;
  1027 + }
  1028 + }
  1029 + }
  1030 + if (is_ignored) {
  1031 + x[ii++] = s;
  1032 + }
  1033 + }
1020 1034 }
1021 1035 }
1022 1036 qDetails += hpHiddenField(Q+'ignored', x);
@@ -1347,8 +1361,15 @@ function GetJQuizAnswerDetails(q, flag) {
1347 1361 var x = new Array();
1348 1362 } else {
1349 1363 // get required part of 'x' and convert to array
1350   - var i = x.lastIndexOf('|');
1351   - var x = x.substring((flag==2 ? (i+1) : 1), ((flag==0 || flag==2) ? x.length : i)).split('|');
  1364 + if (x.charAt(0)=='|') {
  1365 + // HP 6.0 and 6.1 (always has leading bar)
  1366 + var i = x.lastIndexOf('|');
  1367 + var x = x.substring((flag==2 ? (i+1) : 1), ((flag==0 || flag==2) ? x.length : i)).split('|');
  1368 + } else {
  1369 + // HP 6.2 (no leading delimiter)
  1370 + var i = x.lastIndexOf(' | ');
  1371 + var x = x.substring((flag==2 ? (i+3) : 0), ((flag==0 || flag==2) ? x.length : i)).split(' | ');
  1372 + }
1352 1373 }
1353 1374 for (var i=0; i<x.length; i++) {
1354 1375 var a = new Array();
@@ -1364,14 +1385,33 @@ function GetJQuizAnswerDetails(q, flag) {
1364 1385 x[i] = a.join('+');
1365 1386 }
1366 1387 } else if (x) { // multiple-choice, short-answer and hybrid
1367   - // remove trailing comma and convert to array
1368   - x = x.substring(0, x.length-1).split(',');
  1388 + if (x.charAt(x.length-1)==',') {
  1389 + // HP 6.0 and 6.1 (always has trailing comma)
  1390 + x = x.substring(0, x.length-1).split(',');
  1391 + } else {
  1392 + // HP 6.2 (short answer also contains student entered text)
  1393 + x = x.split(' | ');
  1394 + }
1369 1395 if (flag) {
1370 1396 var a = new Array();
1371 1397 if (flag==1 || flag==2 || flag==3) {
1372 1398 for (var i=0; i<x.length; i++) {
1373   - var ii = I[q][3][(x[i].charCodeAt(0)-65)][2];
1374   - if(((flag==1 || flag==2) && ii==1) || (flag==3 && ii==0)) a.push(x[i]);
  1399 + var is_correct = false;
  1400 + if (x[i].length==1) { // single letter
  1401 + var ii = x[i].charCodeAt(0) - 65;
  1402 + if (I[q][3] && I[q][3][ii] && I[q][3][ii][2]) {
  1403 + var is_correct = true;
  1404 + }
  1405 + }
  1406 + if (is_correct) {
  1407 + if (flag==2) {
  1408 + a.push(x[i]);
  1409 + }
  1410 + } else {
  1411 + if (flag==1 || flag==3) {
  1412 + a.push(x[i]);
  1413 + }
  1414 + }
1375 1415 }
1376 1416 }
1377 1417 if (flag==1) {
@@ -1392,8 +1432,12 @@ function GetJQuizAnswerDetails(q, flag) {
1392 1432 // convert answer indexes to values, if required
1393 1433 if (JQuiz[6]==false) {
1394 1434 for (var i=0; i<x.length; i++) {
1395   - var ii = x[i].charCodeAt(0) - 65;
1396   - x[i] = I[q][3][ii][0];
  1435 + if (x[i].length==1) { // single letter
  1436 + var ii = x[i].charCodeAt(0) - 65;
  1437 + if (I[q][3] && I[q][3][ii]) {
  1438 + x[i] = I[q][3][ii][0];
  1439 + }
  1440 + }
1397 1441 }
1398 1442 }
1399 1443 } else {
@@ -1504,7 +1548,7 @@ function hpClickClue(hp, t, v, args) {
1504 1548 }
1505 1549 function hpClickCheck(hp, t, v, args) {
1506 1550 if (t==2) { // JCloze
1507   - if (v==5 || v==6) {
  1551 + if (v==5 || v==6) {
1508 1552 var r = hpRottmeier();
1509 1553 var already_correct = 'true';
1510 1554 if (r==0) {
@@ -1526,7 +1570,18 @@ function hpClickCheck(hp, t, v, args) {
1526 1570 if (hp==5) {
1527 1571 g = eval('document.Cloze.Gap'+i+'.value');
1528 1572 } else if (hp==6) {
1529   - g = Get_SelectedDropValue(i);
  1573 + var ii = Get_SelectedDropValue(i);
  1574 + if (isNaN(ii) || ii<0) { // 'null' || -1
  1575 + g = ''; // no guess yet
  1576 + } else {
  1577 + if (window.MakeIndividualDropdowns) {
  1578 + var is_wrong = (ii!=0);
  1579 + g = I[i][1][ii][0];
  1580 + } else {
  1581 + var is_wrong = (ii!=i);
  1582 + g = I[ii][1][0][0];
  1583 + }
  1584 + }
1530 1585 }
1531 1586 } else if (r==2.1 && i==args[0]) { // Find-It 3a
1532 1587 g = I[i][1][0][0];
@@ -1539,18 +1594,22 @@ function hpClickCheck(hp, t, v, args) {
1539 1594 // is this a new guess at this gap?
1540 1595 if (ii==0 || g!=HP[_guesses][i][ii-1]) {
1541 1596 HP[_guesses][i][ii] = g;
1542   - var G = g.toUpperCase();
1543   -
1544   - var ii_max = I[i][1].length;
1545   - for (var ii=0; ii<ii_max; ii++) {
1546   - if (window.CaseSensitive) {
1547   - if (g==I[i][1][ii][0]) break;
1548   - } else {
1549   - if (G==I[i][1][ii][0].toUpperCase()) break;
1550   - }
1551   - }
1552   -
1553   - if (ii==ii_max) { // guess is wrong
  1597 + if (r==1) {
  1598 + // Rottmeier DropDown 2.4
  1599 + // do nothing
  1600 + } else {
  1601 + var G = g.toUpperCase();
  1602 + var ii_max = I[i][1].length;
  1603 + for (var ii=0; ii<ii_max; ii++) {
  1604 + if (window.CaseSensitive) {
  1605 + if (g==I[i][1][ii][0]) break;
  1606 + } else {
  1607 + if (G==I[i][1][ii][0].toUpperCase()) break;
  1608 + }
  1609 + }
  1610 + var is_wrong = (ii==ii_max);
  1611 + }
  1612 + if (is_wrong) { // guess is wrong
1554 1613 if (!HP[_wrong][i]) HP[_wrong][i] = new Array();
1555 1614 var ii_max = HP[_wrong][i].length;
1556 1615 for (var ii=0; ii<ii_max; ii++) {
@@ -1770,7 +1829,7 @@ function hpClickCheck(hp, t, v, args) {
1770 1829 }
1771 1830 }
1772 1831 }
1773   - return true;
  1832 + //return true;
1774 1833 }
1775 1834 function hpClickCheckJCrossV5V6(hp, v, AD, q, row, col) {
1776 1835 // v is the version of Hot Potatoes
@@ -1888,7 +1947,7 @@ function hpHiddenField(name, value, comma, forceHTML) {
1888 1947 if (comma==null) comma = ',';
1889 1948 for (var i=0; i<i_max; i++) {
1890 1949 values[i] = trim(values[i]);
1891   - if (values[i]!='') {
  1950 + if (values[i]!=null && values[i]!='') {
1892 1951 value += (i==0 ? '' : comma) + encode_entities(values[i]);
1893 1952 }
1894 1953 }
@@ -1991,12 +2050,19 @@ function getFuncCode(fn, extraCode, anchorCode, beforeAnchor) {
1991 2050 }
1992 2051 return s;
1993 2052 }
1994   -function getArgsStr(args) {
  2053 +function getArgsStr(args, addQuotes) {
1995 2054 // make s(tring) version of function args array
1996 2055 var s = '';
1997 2056 var i_max = args.length;
1998 2057 for (var i=0; i<i_max; i++) {
1999   - s += '"' + args[i] + '",';
  2058 + if (addQuotes) {
  2059 + s += '"' + args[i] + '",';
  2060 + } else {
  2061 + if (s) {
  2062 + s += ',';
  2063 + }
  2064 + s += args[i];
  2065 + }
2000 2066 }
2001 2067 return s;
2002 2068 }
@@ -2141,6 +2207,38 @@ function hpFeedback() {
2141 2207 // ********************
2142 2208 // intercept clicks
2143 2209 // ********************
  2210 +function hpNewFunction(f, a, s) {
  2211 + if (window.C && C.safari) {
  2212 + if (f=='CheckAnswers') {
  2213 + if (s.indexOf('TotalChars-State[i].HintsAndChecks/')>=0) {
  2214 + // special fix for "CheckAnswers" in JCloze
  2215 + s = s.replace(/TotalChars-State\[i\]\.HintsAndChecks/g, '(TotalChars-State[i].HintsAndChecks)');
  2216 + }
  2217 + if (s.indexOf('CorrectLetters-Penalties/')>=0) {
  2218 + // special fix for "CheckAnswers" in JMatch
  2219 + s = s.replace(/CorrectLetters-Penalties/g, '(CorrectLetters-Penalties)');
  2220 + }
  2221 + if (s.indexOf('TotCorrectChoices-Penalties/')>=0) {
  2222 + // special fix for "CheckAnswers" in JMix (v6)
  2223 + s = s.replace(/TotCorrectChoices-Penalties/g, '(TotCorrectChoices-Penalties)');
  2224 + }
  2225 + if (s.indexOf('TotalCorrect-Penalties/')>=0) {
  2226 + // special fix for "CheckAnswers" in JMix (v6+) Drag-and_Drop
  2227 + s = s.replace(/TotalCorrect-Penalties/g, '(TotalCorrect-Penalties)');
  2228 + }
  2229 + }
  2230 + if (s.indexOf('replace(\\[')>=0) {
  2231 + s = s.replace(/\\\[/g, '/\\[');
  2232 + s = s.replace(/\\\]/g, '\\]/g');
  2233 + }
  2234 + if (s.indexOf('for (i')>=0) {
  2235 + s = s.replace(/for \(/g, 'for (var ');
  2236 + }
  2237 + eval('window.' + f + '=function(' + getArgsStr(a) + '){' + s + '}');
  2238 + } else {
  2239 + eval('window.' + f + '=new Function(' + getArgsStr(a, true) + 's);');
  2240 + }
  2241 +}
2144 2242 function hpInterceptFeedback() {
2145 2243 // modify the function which writes feedback
2146 2244 // v6: ShowMessage(Feedback)
@@ -2165,7 +2263,7 @@ function hpInterceptFeedback() {
2165 2263 if (a[0] && window.FEEDBACK && FEEDBACK[0]) {
2166 2264 s = a[0] + "+='<br /><br />" + '<a href="javascript:hpFeedback();">' + FEEDBACK[6] + "</A>';" + s;
2167 2265 }
2168   - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');
  2266 + hpNewFunction(f, a, s);
2169 2267 }
2170 2268 }
2171 2269 function hpInterceptHints() {
@@ -2228,7 +2326,7 @@ function hpInterceptHints() {
2228 2326 // add the e(x)tra code, if any, to the start of the hint (f)unction
2229 2327 if (x) {
2230 2328 var s = getFuncCode(f, x, '', true);
2231   - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');
  2329 + hpNewFunction(f, a, s);
2232 2330 }
2233 2331 }
2234 2332 function hpInterceptClues() {
@@ -2283,7 +2381,8 @@ function hpInterceptClues() {
2283 2381 // add the e(x)tra code, if any, to the start of the clue (f)unction
2284 2382 if (x) {
2285 2383 var s = getFuncCode(f, x, '', true);
2286   - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');
  2384 + var s = getFuncCode(f, '', '', true);
  2385 + hpNewFunction(f, a, s);
2287 2386 }
2288 2387 }
2289 2388 function hpInterceptChecks() {
@@ -2325,7 +2424,7 @@ function hpInterceptChecks() {
2325 2424 if (x) {
2326 2425 x = "if(!Finished&&State[QNum].length&&State[QNum][0]<0){" + x + "hpClick(3,args)}";
2327 2426 var s = getFuncCode(f[i], x, '', true);
2328   - eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);');
  2427 + hpNewFunction(f[i], a, s);
2329 2428 }
2330 2429 }
2331 2430 }
@@ -2365,7 +2464,7 @@ function hpInterceptChecks() {
2365 2464 }
2366 2465 if (f) {
2367 2466 var s = getFuncCode(f, x, '', true);
2368   - eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');
  2467 + hpNewFunction(f, a, s);
2369 2468 }
2370 2469 // JMatch has three possible check functions, depending on the version
2371 2470 // (NB: other quiz types also have these functions)
@@ -2375,7 +2474,7 @@ function hpInterceptChecks() {
2375 2474 var a = getFuncArgs(f[i], true);
2376 2475 if (a.length==0) {
2377 2476 var s = getFuncCode(f[i], "hpClick(3);", '', true);
2378   - eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);');
  2477 + hpNewFunction(f[i], a, s);
2379 2478 break; // out of the loop
2380 2479 }
2381 2480 }
@@ -2661,7 +2760,13 @@ function hpScore() {
2661 2760 } else if (t==3) { // jcross
2662 2761 if (v==3) x = hpScoreEngine(1, CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex==a[i]");
2663 2762 else if (v==4) x = hpScoreEngine(1, WinLetters, "ConvertCase(GetBoxValue(i),1).charAt(0)==a[i].charAt(0)");
2664   - else if (v==5 || v==6) x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii]==G[i][ii]", "L[i][ii]");
  2763 + else if (v==5 || v==6) {
  2764 + if (window.CaseSensitive) { // HP 6.2
  2765 + x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii]==G[i][ii]", "L[i][ii]");
  2766 + } else {
  2767 + x = hpScoreEngine(1, L, "", "L[i]", "L[i][ii] && L[i][ii].toUpperCase()==G[i][ii].toUpperCase()", "L[i][ii]");
  2768 + }
  2769 + }
2665 2770 } else if (t==4) { // jmatch
2666 2771 if (v==3) x = hpScoreEngine(1, CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex==a[i]");
2667 2772 else if (v==4) x = hpScoreEngine(1, Draggables, "a[i].correct=='1'");
@@ -2742,7 +2847,13 @@ function hpFinished() {
2742 2847 } else if (t==3) { // jcross
2743 2848 if (v==3) x = hpFinishedEngine(document.Crossword.elements, "ConvertCase(is.mac?unescape(MacStringToWin(a[i].value)):a[i].value,1)!=Letters[i]");
2744 2849 else if (v==4) x = hpFinishedEngine(WinLetters, "ConvertCase(GetBoxValue(i),1).charAt(0) != a[i].charAt(0)");
2745   - else if (v==5 || v==6) x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii]!=G[i][ii]");
  2850 + else if (v==5 || v==6) {
  2851 + if (window.CaseSensitive) { // 6.2
  2852 + x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii]!=G[i][ii]");
  2853 + } else {
  2854 + x = hpFinishedEngine(L, "", "L[i]", "L[i][ii] && L[i][ii].toUpperCase()!=G[i][ii].toUpperCase()");
  2855 + }
  2856 + }
2746 2857 } else if (t==4) { // jmatch
2747 2858 if (v==3) x = hpFinishedEngine(CorrectAnswers, "document.QuizForm.elements[i*2].selectedIndex != a[i]");
2748 2859 else if (v==4) x = hpFinishedEngine(Draggables, "a[i].correct!='1'");
@@ -2801,9 +2912,9 @@ function hpIsStrict() {
2801 2912 // **************
2802 2913 // initialization
2803 2914 // **************
2804   -hpInterceptFeedback();
2805   -hpInterceptHints();
2806   -hpInterceptClues();
  2915 +//hpInterceptFeedback();
  2916 +//hpInterceptHints();
  2917 +//hpInterceptClues();
2807 2918 hpInterceptChecks();
2808 2919 function hpFindForm(formname, w) {
2809 2920 if (w==null) w = self;
@@ -2867,8 +2978,13 @@ if (DB[7] && DB[8] && !is_LMS()) {
2867 2978 var p = getPrompt(window.GetUserName || window.StartUp);
2868 2979 var c = getStartUpCode(window.StartUp);
2869 2980 if (p && c) {
2870   - window.StartUp = new Function('QuizLogin("' + p + '")');
2871   - window.StartQuiz = new Function(c);
  2981 + if (window.C && C.safari) {
  2982 + eval('window.StartUp=function(){QuizLogin("' + p + '")}');
  2983 + eval('window.StartQuiz=function(){' + c + '}');
  2984 + } else {
  2985 + window.StartUp = new Function('QuizLogin("' + p + '")');
  2986 + window.StartQuiz = new Function(c);
  2987 + }
2872 2988 // "QuizLogin" finshes by calling "StartQuiz"
2873 2989 }
2874 2990 // reassign the SendResults function
4 mod/hotpot/template/default.php
@@ -24,11 +24,11 @@ function expand_blocks($tag) {
24 24 // [1] the full block name (including optional leading 'str' or 'incl')
25 25 // [2] leading 'incl' or 'str', if any
26 26 // [3] the real block name ([1] without [2])
27   - $search = '/\[\/((incl|str)?(\w+))\]/';
  27 + $search = '/\[\/((incl|str)?((?:\w|\.)+))\]/';
28 28 preg_match_all($search, $this->$tag, $names);
29 29 $i_max = count($names[0]);
30 30 for ($i=0; $i<$i_max; $i++) {
31   - $method = $this->parent->template_dir.'_expand_'.$names[3][$i];
  31 + $method = $this->parent->template_dir.'_expand_'.str_replace('.', '', $names[3][$i]);
32 32 if (method_exists($this, $method)) {
33 33 eval('$value=$this->'.$method.'();');
34 34 $search = '/\['.$names[1][$i].'\](.*?)\[\/'.$names[1][$i].'\]/s';
5 mod/hotpot/template/v6.php
@@ -324,6 +324,11 @@ function v6_expand_NavBarJS() {
324 324 return $this->v6_expand_NavButtons();
325 325 }
326 326
  327 + // switch off scorm
  328 + function v6_expand_Scorm12() {
  329 + return false;
  330 + }
  331 +
327 332 // js files (all quiz types)
328 333
329 334 function v6_expand_JSBrowserCheck() {
8 mod/hotpot/template/v6/djmatch6.ht_
@@ -29,6 +29,10 @@
29 29
30 30 <!--
31 31
  32 +[inclScorm1.2]
  33 +[strJSScorm_1_2]
  34 +[/inclScorm1.2]
  35 +
32 36 [strJSBrowserCheck]
33 37
34 38 [strJSButtons]
@@ -59,7 +63,7 @@
59 63
60 64 </head>
61 65
62   -<body onload="TimerStartUp()" id="TheBody">
  66 +<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
63 67 <!-- BeginTopNavButtons -->
64 68
65 69 [inclNavButtons]
@@ -80,7 +84,7 @@
80 84 </div>
81 85
82 86 <div id="InstructionsDiv" class="StdDiv">
83   - <p id="Instructions">[strInstructions]</p>
  87 + <div id="Instructions">[strInstructions]</div>
84 88 </div>
85 89
86 90 <div class="StdDiv" id="CheckButtonDiv">
54 mod/hotpot/template/v6/djmatch6.js_
... ... @@ -1,4 +1,32 @@
1 1
  2 +[inclScorm1.2]
  3 +//JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE
  4 +
  5 +function SetScormScore(){
  6 +//Reports the current score and any other information back to the LMS
  7 + if (API != null){
  8 + API.LMSSetValue('cmi.core.score.raw', Score);
  9 +
  10 +
  11 +//Now send a detailed reports on the item
  12 + var ItemLabel = 'Matching';
  13 + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel);
  14 + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel);
  15 + API.LMSSetValue('cmi.objectives.0.status', API.LMSGetValue('cmi.core.lesson_status'));
  16 + API.LMSSetValue('cmi.objectives.0.score.min', '0');
  17 + API.LMSSetValue('cmi.objectives.0.score.max', '100');
  18 + API.LMSSetValue('cmi.objectives.0.score.raw', Score);
  19 +//We can only use the performance type, because we're storing multiple responses of various types.
  20 + API.LMSSetValue('cmi.interactions.0.type', 'performance');
  21 + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried);
  22 +
  23 + API.LMSCommit('');
  24 + }
  25 +}
  26 +[/inclScorm1.2]
  27 +
  28 +//JMATCH-SPECIFIC CORE JAVASCRIPT CODE
  29 +
2 30 var CorrectResponse = '[strGuessCorrect]';
3 31 var IncorrectResponse = '[strGuessIncorrect]';
4 32 var YourScoreIs = '[strYourScoreIs]';
@@ -20,6 +48,7 @@ var LeftColPos = 100;
20 48 var RightColPos = 500;
21 49 var DragTop = 120;
22 50 var Finished = false;
  51 +var AnswersTried = '';
23 52
24 53 //Fixed and draggable card arrays
25 54 FC = new Array();
@@ -69,6 +98,10 @@ function DroppedOnFixed(DNum){
69 98
70 99 function StartUp(){
71 100
  101 +[inclScorm1.2]
  102 + ScormStartUp();
  103 +[/inclScorm1.2]
  104 +
72 105 [inclSendResults]
73 106 GetUserName();
74 107 [/inclSendResults]
@@ -140,10 +173,9 @@ function StartUp(){
140 173 if (TempInt > WidestRight){WidestRight = TempInt;}
141 174 }
142 175
143   - var HeightToSet = Highest;
144   - if (C.gecko||C.ie5mac){HeightToSet -= 12;}
145   - var WidthToSet = WidestRight;
146   - if (C.gecko||C.ie5mac){WidthToSet -= 12;}
  176 +//Fix for 6.2: the reduction by 12 seems to be required -- no idea why!
  177 + var HeightToSet = Highest-12;
  178 + var WidthToSet = WidestRight-12;
147 179
148 180 for (i=0; i<D.length; i++){
149 181 DC[i].SetT(CurrTop);
@@ -262,8 +294,11 @@ function CheckAnswers(){
262 294 var Feedback = '';
263 295
264 296 //for each fixed, check to see if the tag value for the draggable is the same as the fixed
  297 + if (AnswersTried.length > 0){AnswersTried += ' | ';}
265 298 var i, j;
266 299 for (i=0; i<D.length; i++){
  300 + if (i>0){AnswersTried += ',';}
  301 + AnswersTried += D[i][1] + '.' + D[i][2] + '';
267 302 if ((D[i][2] == D[i][1])&&(D[i][2] > 0)){
268 303 TotalCorrect++;
269 304 }
@@ -307,6 +342,14 @@ function CheckAnswers(){
307 342 setTimeout('Finish()', SubmissionTimeout);
308 343 WriteToInstructions(Feedback);
309 344 }
  345 +[inclScorm1.2]
  346 + if (AllDone == true){
  347 + SetScormComplete();
  348 + }
  349 + else{
  350 + SetScormIncomplete();
  351 + }
  352 +[/inclScorm1.2]
310 353 }
311 354
312 355 [inclTimer]
@@ -318,6 +361,9 @@ function TimesUp() {
318 361 TimeOver = true;
319 362 CheckAnswers();
320 363 Locked = true;
  364 +[inclScorm1.2]
  365 + SetScormTimedOut();
  366 +[/inclScorm1.2]
321 367 }
322 368 [/inclTimer]
323 369
8 mod/hotpot/template/v6/djmix6.ht_
@@ -29,6 +29,10 @@
29 29
30 30 <!--
31 31
  32 +[inclScorm1.2]
  33 +[strJSScorm_1_2]
  34 +[/inclScorm1.2]
  35 +
32 36 [strJSBrowserCheck]
33 37
34 38 [strJSButtons]
@@ -59,7 +63,7 @@
59 63
60 64 </head>
61 65
62   -<body onload="TimerStartUp()" id="TheBody">
  66 +<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
63 67 <!-- BeginTopNavButtons -->
64 68
65 69 [inclNavButtons]
@@ -80,7 +84,7 @@
80 84 </div>
81 85
82 86 <div id="InstructionsDiv" class="StdDiv">
83   - <p id="Instructions">[strInstructions]</p>
  87 + <div id="Instructions">[strInstructions]</div>
84 88 </div>
85 89
86 90 <div class="StdDiv" id="CheckButtonDiv">
57 mod/hotpot/template/v6/djmix6.js_
... ... @@ -1,3 +1,35 @@
  1 +[inclScorm1.2]
  2 +//JMMIX-SPECIFIC SCORM-RELATED JAVASCRIPT CODE
  3 +
  4 +function SetScormScore(){
  5 +//Reports the current score and any other information back to the LMS
  6 + if (API != null){
  7 + API.LMSSetValue('cmi.core.score.raw', Score);
  8 +
  9 +//Now send a detailed reports on the item
  10 + var ItemLabel = 'Item_1';
  11 + API.LMSSetValue('cmi.objectives.0.id', 'obj'+ItemLabel);
  12 + API.LMSSetValue('cmi.interactions.0.id', 'int'+ItemLabel);
  13 + if (Finished == true){
  14 + API.LMSSetValue('cmi.objectives.0.status', 'completed');
  15 + }
  16 + else{
  17 + API.LMSSetValue('cmi.objectives.0.status', 'incomplete');
  18 + }
  19 +
  20 + API.LMSSetValue('cmi.objectives.0.score.min', '0');
  21 + API.LMSSetValue('cmi.objectives.0.score.max', '100');
  22 + API.LMSSetValue('cmi.objectives.0.score.raw', Score);
  23 +//We can only use the performance type, because we're storing multiple responses of various types.
  24 + API.LMSSetValue('cmi.interactions.0.type', 'performance');
  25 + API.LMSSetValue('cmi.interactions.0.student_response', AnswersTried);
  26 +
  27 +
  28 + API.LMSCommit('');
  29 + }
  30 +}
  31 +[/inclScorm1.2]
  32 +
1 33 //JMIX DRAG-DROP OUTPUT FORMAT CODE
2 34
3 35 var Punctuation = '[strPunctuation]';
@@ -37,6 +69,7 @@ var DivWidth = 600;
37 69 var LeftColPos = 100;
38 70 var DragTop = 120;
39 71 var DragNumber = -1;
  72 +var AnswersTried = '';
40 73
41 74 Lines = new Array();
42 75
@@ -211,6 +244,9 @@ function CheckAnswer(CheckType){
211 244 }
212 245 }
213 246 WellDone = '<span class="CorrectAnswer">' + CompiledOutput + '</span><br /><br />' + CorrectResponse + '<br />';
  247 +
  248 + if (AnswersTried.length > 0){AnswersTried += ' | ';}
  249 + AnswersTried += CompiledOutput;
214 250
215 251 //Do score calculation here
216 252 Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length);
@@ -227,7 +263,10 @@ function CheckAnswer(CheckType){
227 263 }
228 264
229 265 else{
230   - TryAgain = '<span class="Guess">' + CompileString(GuessSequence) + '</span><br /><br />';
  266 + var WrongGuess = CompileString(GuessSequence);
  267 + if (AnswersTried.length > 0){AnswersTried += ' | ';}
  268 + AnswersTried += WrongGuess;
  269 + TryAgain = '<span class="Guess">' + WrongGuess + '</span><br /><br />';
231 270 if ((CheckType == 0)||(LongestCorrect.length==0)){
232 271 TryAgain += IncorrectResponse + '<br />';
233 272 }
@@ -267,6 +306,15 @@ function CheckAnswer(CheckType){
267 306 setTimeout('Finish()', SubmissionTimeout);
268 307 WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
269 308 }
  309 +
  310 +[inclScorm1.2]
  311 + if (AllDone == true){
  312 + SetScormComplete();
  313 + }
  314 + else{
  315 + SetScormIncomplete();
  316 + }
  317 +[/inclScorm1.2]
270 318 }
271 319
272 320
@@ -396,6 +444,10 @@ function StartUp(){
396 444 GetUserName();
397 445 [/inclSendResults]
398 446
  447 +[inclScorm1.2]
  448 + ScormStartUp();
  449 +[/inclScorm1.2]
  450 +
399 451 [inclPreloadImages]
400 452 PreloadImages([PreloadImageList]);
401 453 [/inclPreloadImages]
@@ -517,5 +569,8 @@ function TimesUp() {
517 569 TimeOver = true;
518 570 CheckAnswer(0);
519 571 Locked = true;
  572 +[inclScorm1.2]
  573 + SetScormTimedOut();
  574 +[/inclScorm1.2]
520 575 }
521 576 [/inclTimer]
7 mod/hotpot/template/v6/fjmatch6.ht_
@@ -29,6 +29,9 @@
29 29
30 30 <!--
31 31
  32 +[inclScorm1.2]
  33 +[strJSScorm_1_2]
  34 +[/inclScorm1.2]
32 35
33 36 [strJSBrowserCheck]
34 37
@@ -48,7 +51,7 @@
48 51 </head>
49 52 <!--<body>Fool those dumb ad-inserting ISPs</body>-->
50 53
51   -<body onload="StartUp()" id="TheBody">
  54 +<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="SetScormBrowseTime(); CheckLMSFinish()"[/inclScorm1.2]>
52 55
53 56 <!-- BeginTopNavButtons -->
54 57
@@ -66,7 +69,7 @@
66 69 </div>
67 70
68 71 <div id="InstructionsDiv" class="StdDiv">
69   - <p id="Instructions">[strInstructions]</p>
  72 + <div id="Instructions">[strInstructions]</div>
70 73 </div>
71 74
72 75 <div id="MainDiv" class="StdDiv">
24 mod/hotpot/template/v6/fjmatch6.js_
... ... @@ -1,4 +1,17 @@
1 1
  2 +[inclScorm1.2]
  3 +//JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE
  4 +
  5 +function SetScormBrowseTime(){
  6 +if (API != null){
  7 + API.LMSSetValue('cmi.core.session_time', MillisecondsToTime((new Date()).getTime() - ScormStartTime));
  8 + API.LMSCommit('');
  9 + }
  10 +}
  11 +[/inclScorm1.2]
  12 +
  13 +//JMATCH-SPECIFIC CORE JAVASCRIPT CODE
  14 +
2 15 var CurrItem = null;
3 16 var Stage = 2;
4 17 var QList = new Array();
@@ -34,6 +47,17 @@ function SetUpItems(){
34 47 function StartUp(){
35 48
36 49 SetUpItems();
  50 +
  51 +[inclScorm1.2]
  52 + initAPI(window);
  53 + if (API != null){
  54 + API.LMSInitialize('');
  55 + API.LMSSetValue('cmi.core.lesson_status', 'browsed');
  56 + API.LMSSetValue('cmi.comments', 'This exercise has no checking or scoring features.');
  57 + API.LMSCommit('');
  58 + }
  59 +[/inclScorm1.2]
  60 +
37 61
38 62 [inclPreloadImages]
39 63 PreloadImages([PreloadImageList]);
11 mod/hotpot/template/v6/hp6.cs_
@@ -6,6 +6,12 @@
6 6
7 7 /* Made with executable version [strFullVersionInfo] */
8 8
  9 +
  10 +/* Hack to hide a nested Quicktime player from IE, which can't handle it. */
  11 +* html object.MediaPlayerNotForIE {
  12 + display: none;
  13 +}
  14 +
9 15 body{
10 16 font-family: [strFontFace];
11 17 [inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
@@ -381,6 +387,7 @@ div#ClueEntry{
381 387 div.Keypad{
382 388 text-align: center;
383 389 display: none; /* initially hidden, shown if needed */
  390 + margin-bottom: 0.5em;
384 391 }
385 392
386 393 div.Keypad button{
@@ -408,7 +415,9 @@ textarea{
408 415 }
409 416
410 417 .QuestionText{
411   -
  418 + text-align: left;
  419 + margin: 0px;
  420 + font-size: 100%;
412 421 }
413 422
414 423 .Answer{
7 mod/hotpot/template/v6/hp6checkshortanswer.js_
@@ -186,8 +186,13 @@ function CheckShortAnswer(QNum){
186 186 CA.GetBestMatch();
187 187
188 188 //Store any match in the state tracking field
  189 + if (State[QNum][5].length > 0){State[QNum][5] += ' | ';}
189 190 if (CA.MatchNum > -1){
190   - State[QNum][5] += String.fromCharCode(65+CA.MatchNum) + ',';
  191 + State[QNum][5] += String.fromCharCode(65+CA.MatchNum);
  192 + }
  193 +//Else store the student's answer
  194 + else{
  195 + State[QNum][5] += G;
191 196 }
192 197
193 198 //Add the percent correct value for this answer to the Q State (works for all
23 mod/hotpot/template/v6/hp6objecttags.ht_
... ... @@ -1,18 +1,7 @@
1 1
2   -[QuickTime Player]
3   -<object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" data="[strFilePath]" width="[strWidth]" height="[strHeight]">
4   -<param name="src" value="[strFilePath]" />
5   -<param name="autoplay" value="false" />
6   -<param name="controller" value="true" />
7   -<object type="audio/quicktime" data="[strFilePath]" width="[strWidth]" height="[strHeight]">
8   -<param name="src" value="[strFilePath]" />
9   -<param name="autoplay" value="false" />
10   -<param name="controller" value="true" />
11   -[strContent]</object>
12   -</object>[/QuickTime Player]
  2 +[QuickTime Player]<object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" data="[strFilePath]" width="[strWidth]" height="[strHeight]" type="audio/quicktime"><param name="src" value="[strFilePath]" /> <param name="autoplay" value="false" /> <param name="controller" value="true" /> <object class="MediaPlayerNotForIE" type="video/quicktime" data="[strFilePath]" width="[strWidth]" height="[strHeight]"> <param name="src" value="[strFilePath]" /> <param name="autoplay" value="false" /> <param name="controller" value="true" /> [strContent]</object> </object>[/QuickTime Player]
13 3
14   -[Windows Media Player]
15   -<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="[strWidth]" height="[strHeight]">
  4 +[Windows Media Player]<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="[strWidth]" height="[strHeight]">
16 5 <param name="url" value="[strFilePath]" />
17 6 <param name="autostart" value="false" />
18 7 <param name="showcontrols" value="true" />[strContent]</object>
@@ -26,10 +15,4 @@
26 15 <param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
27 16 [strContent]</object>[/Real Player]
28 17
29   -[Flash Player]
30   -<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
31   -codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0"
32   -type="application/x-shockwave-flash"
33   -width="[strWidth]" height="[strHeight]">
34   -<param name="movie" value="[strFilePath]" />
35   -[strContent]</object>[/Flash Player]
  18 +[Flash Player]<object codebase="[strFilePath]" type="application/x-shockwave-flash" width="[strWidth]" height="[strHeight]" data="[strFilePath]"> <param name="movie" value="[strFilePath]" />[strContent]</object>[/Flash Player]
71 mod/hotpot/template/v6/hp6showmessage.js_
@@ -6,49 +6,74 @@ var topZ = 1000;
6 6
7 7 function ShowMessage(Feedback){
8 8 var Output = Feedback + '<br /><br />';
  9 + document.getElementById('FeedbackContent').innerHTML = Output;
  10 + var FDiv = document.getElementById('FeedbackDiv');
  11 + topZ++;
  12 + FDiv.style.zIndex = topZ;
  13 + FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
9 14
10   - var obj = document.getElementById('FeedbackContent');
11   - if (obj) {
12   - obj.innerHTML = Output;
13   - }
14   - var obj = document.getElementById('FeedbackDiv');
15   - if (obj) {
16   - topZ++;
17   - obj.style.zIndex = topZ;
18   - obj.style.top = TopSettingWithScrollOffset(30) + 'px';
19   - obj.style.display = 'block';
20   - }
  15 + FDiv.style.display = 'block';
21 16
22 17 ShowElements(false, 'input');
23 18 ShowElements(false, 'select');
24 19 ShowElements(false, 'object');
  20 + ShowElements(true, 'object', 'FeedbackContent');
25 21
26 22 //Focus the OK button
27   - var obj = document.getElementById('FeedbackOKButton');
28   - if (obj) {
29   - setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
30   - }
  23 + setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
31 24
32 25 //[inclPreloadImages]
33 26 // RefreshImages();
34 27 //[/inclPreloadImages]
35 28 }
36 29
37   -function ShowElements(Show, TagName){
38   -//Special for IE bug -- hide all the form elements that will show through the popup
39   - if (C.ie){
40   - var Els = document.getElementsByTagName(TagName);
41   - for (var i=0; i<Els.length; i++){
  30 +function ShowElements(Show, TagName, ContainerToReverse){
  31 +// added third argument to allow objects in the feedback box to appear
  32 +//IE bug -- hide all the form elements that will show through the popup
  33 +//FF on Mac bug : doesn't redisplay objects whose visibility is set to visible
  34 +//unless the object's display property is changed
  35 +
  36 + //get container object (by Id passed in, or use document otherwise)
  37 + TopNode = document.getElementById(ContainerToReverse);
  38 + var Els;
  39 + if (TopNode != null) {
  40 + Els = TopNode.getElementsByTagName(TagName);
  41 + } else {
  42 + Els = document.getElementsByTagName(TagName);
  43 + }
  44 +
  45 + for (var i=0; i<Els.length; i++){
  46 + if (TagName == "object") {
  47 + //manipulate object elements in all browsers
42 48 if (Show == true){
43   - Els[i].style.display = 'inline';
  49 + Els[i].style.visibility = 'visible';
  50 + //get Mac FireFox to manipulate display, to force screen redraw
  51 + if (C.mac && C.gecko) {Els[i].style.display = '';}
44 52 }
45 53 else{
46   - Els[i].style.display = 'none';
  54 + Els[i].style.visibility = 'hidden';
  55 + if (C.mac && C.gecko) {Els[i].style.display = 'none';}
  56 + }
  57 + }
  58 + else {
  59 + // tagName is either input or select (that is, Form Elements)
  60 + // ie6 has a problem with Form elements, so manipulate those
  61 + if (C.ie) {
  62 + if (C.ieVer < 7) {
  63 + if (Show == true){
  64 + Els[i].style.visibility = 'visible';
  65 + }
  66 + else{
  67 + Els[i].style.visibility = 'hidden';
  68 + }
  69 + }
47 70 }
48 71 }
49   - }
  72 + }
50 73 }
51 74
  75 +
  76 +
52 77 function HideFeedback(){
53 78 document.getElementById('FeedbackDiv').style.display = 'none';
54 79 ShowElements(true, 'input');
25 mod/hotpot/template/v6/hp6utilities.js_
@@ -22,25 +22,36 @@ function GetPageXY(El) {
22 22 }
23 23
24 24 function GetScrollTop(){
25   - if (document.documentElement && document.documentElement.scrollTop){
26   - return document.documentElement.scrollTop;
  25 + if (typeof(window.pageYOffset) == 'number'){
  26 + return window.pageYOffset;
27 27 }
28 28 else{
29   - if (document.body){
30   - return document.body.scrollTop;
  29 + if ((document.body)&&(document.body.scrollTop)){
  30 + return document.body.scrollTop;
31 31 }
32 32 else{
33   - return window.pageYOffset;
  33 + if ((document.documentElement)&&(document.documentElement.scrollTop)){
  34 + return document.documentElement.scrollTop;
  35 + }
  36 + else{
  37 + return 0;
  38 + }
34 39 }
35 40 }
36 41 }
37 42
38 43 function GetViewportHeight(){
39   - if (window.innerHeight){
  44 + if (typeof window.innerHeight != 'undefined'){
40 45 return window.innerHeight;
41 46 }
42 47 else{
43   - return document.getElementsByTagName('body')[0].clientHeight;
  48 + if (((typeof document.documentElement != 'undefined')&&(typeof document.documentElement.clientHeight !=
  49 + 'undefined'))&&(document.documentElement.clientHeight != 0)){
  50 + return document.documentElement.clientHeight;
  51 + }
  52 + else{
  53 + return document.getElementsByTagName('body')[0].clientHeight;
  54 + }
44 55 }
45 56 }
46 57
10 mod/hotpot/template/v6/jcloze6.ht_
@@ -29,6 +29,10 @@
29 29
30 30 <!--
31 31
  32 +[inclScorm1.2]
  33 +[strJSScorm_1_2]
  34 +[/inclScorm1.2]
  35 +
32 36 [strJSBrowserCheck]
33 37
34 38 [strJSButtons]
@@ -58,7 +62,7 @@
58 62
59 63 </head>
60 64
61   -<body onload="StartUp()" id="TheBody">
  65 +<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
62 66
63 67 <!-- BeginTopNavButtons -->
64 68
@@ -80,7 +84,7 @@
80 84 </div>
81 85
82 86 <div id="InstructionsDiv" class="StdDiv">
83   - <p id="Instructions">[strInstructions]</p>
  87 + <div id="Instructions">[strInstructions]</div>
84 88 </div>
85 89
86 90 [inclReading]
@@ -126,7 +130,7 @@
126 130 </div>
127 131
128 132 [inclKeypad]
129   -<div class="Keypad">
  133 +<div class="Keypad" id="CharacterKeypad">
130 134 [strKeypad]
131 135 </div>
132 136 [/inclKeypad]
58 mod/hotpot/template/v6/jcloze6.js_
... ... @@ -1,4 +1,39 @@
1 1
  2 +[inclScorm1.2]
  3 +//JCLOZE-SPECIFIC SCORM-RELATED JAVASCRIPT CODE
  4 +
  5 +function SetScormScore(){
  6 +//Reports the current score and any other information back to the LMS
  7 + if (API != null){
  8 + API.LMSSetValue('cmi.core.score.raw', Score);
  9 +//Now send detailed reports about each item
  10 + for (var i=0; i<State.length; i++){
  11 + var ThisItemGuesses = '';
  12 + var GapLabel = 'Gap_' + (i+1).toString();
  13 + var ThisItemScore = Math.floor(State[i].ItemScore * 100) + '';
  14 + API.LMSSetValue('cmi.objectives.' + i + '.id', 'obj'+GapLabel);
  15 + API.LMSSetValue('cmi.interactions.' + i + '.id', 'int'+GapLabel);
  16 + API.LMSSetValue('cmi.objectives.' + i + '.score.raw', ThisItemScore);
  17 + API.LMSSetValue('cmi.objectives.' + i + '.score.min', '0');
  18 + API.LMSSetValue('cmi.objectives.' + i + '.score.max', '100');
  19 + if (State[i].AnsweredCorrectly == true){
  20 + API.LMSSetValue('cmi.objectives.' + i + '.status', 'completed');
  21 + }
  22 + else{
  23 + API.LMSSetValue('cmi.objectives.' + i + '.status', 'incomplete');
  24 + }
  25 + for (var j=0; j<State[i].Guesses.length; j++){
  26 + if (j>0){ThisItemGuesses += ' | ';}
  27 + ThisItemGuesses += State[i].Guesses[j];
  28 + }
  29 + API.LMSSetValue('cmi.interactions.' + i + '.type', 'fill-in');
  30 + API.LMSSetValue('cmi.interactions.' + i + '.student_response', ThisItemGuesses);
  31 + }
  32 + API.LMSCommit('');
  33 + }
  34 +}
  35 +[/inclScorm1.2]
  36 +
2 37 //JCLOZE CORE JAVASCRIPT CODE
3 38
4 39 function ItemState(){
@@ -31,6 +66,14 @@ State = new Array();
31 66
32 67 function StartUp(){
33 68 RemoveBottomNavBarForIE();
  69 +//Show a keypad if there is one (added bugfix for 6.0.4.12)
  70 + if (document.getElementById('CharacterKeypad') != null){
  71 + document.getElementById('CharacterKeypad').style.display = 'block';
  72 + }
  73 +
  74 +[inclScorm1.2]
  75 + ScormStartUp();
  76 +[/inclScorm1.2]
34 77
35 78 [inclSendResults]
36 79 GetUserName();
@@ -62,7 +105,7 @@ function ShowClue(ItemNum){
62 105 }
63 106
64 107 function SaveCurrentAnswers(){
65   - var Ans = ''
  108 + var Ans = '';
66 109 for (var i=0; i<I.length; i++){
67 110 Ans = GetGapValue(i);
68 111 if ((Ans.length > 0)&&(Ans != State[i].Guesses[State[i].Guesses.length-1])){
@@ -146,6 +189,7 @@ function CheckAnswers(){
146 189 CompileGuesses();
147 190
148 191 if ((AllCorrect == true)||(Finished == true)){
  192 +
149 193 [inclSendResults]
150 194 setTimeout('SendResults(' + TotalScore + ')', 50);
151 195 [/inclSendResults]
@@ -157,6 +201,14 @@ function CheckAnswers(){
157 201 Finished = true;
158 202 setTimeout('Finish()', SubmissionTimeout);
159 203 }
  204 +[inclScorm1.2]
  205 + if (AllCorrect == true){
  206 + SetScormComplete();
  207 + }
  208 + else{
  209 + SetScormIncomplete();
  210 + }
  211 +[/inclScorm1.2]
160 212 }
161 213
162 214 function TrackFocus(BoxNumber){
@@ -299,6 +351,7 @@ function GetHint(GapNum){
299 351 }
300 352
301 353 function ShowHint(){
  354 + if (document.getElementById('FeedbackDiv').style.display == 'block'){return;}
302 355 if (Locked == true){return;}
303 356 var CurrGap = FindCurrent();
304 357 if (CurrGap < 0){return;}
@@ -330,5 +383,8 @@ function TimesUp() {
330 383 Finished = true;
331 384 CheckAnswers();
332 385 Locked = true;
  386 +[inclScorm1.2]
  387 + SetScormTimedOut();
  388 +[/inclScorm1.2]
333 389 }
334 390 [/inclTimer]
10 mod/hotpot/template/v6/jcross6.ht_
@@ -29,6 +29,10 @@
29 29
30 30 <!--
31 31
  32 +[inclScorm1.2]
  33 +[strJSScorm_1_2]
  34 +[/inclScorm1.2]
  35 +
32 36 [strJSBrowserCheck]
33 37
34 38 [strJSButtons]
@@ -58,7 +62,7 @@
58 62
59 63 </head>
60 64
61   -<body onload="StartUp()" id="TheBody">
  65 +<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
62 66
63 67 <!-- BeginTopNavButtons -->
64 68
@@ -80,7 +84,7 @@
80 84 </div>
81 85
82 86 <div id="InstructionsDiv" class="StdDiv">
83   - <p id="Instructions">[strInstructions]</p>
  87 + <div id="Instructions">[strInstructions]</div>
84 88 </div>
85 89
86 90 [inclReading]
@@ -102,7 +106,7 @@
102 106 <div id="MainDiv" class="StdDiv">
103 107
104 108 [inclKeypad]
105   -<div class="Keypad" style="float: left;">
  109 +<div class="Keypad" id="CharacterKeypad" style="float: left;">
106