add HP 6.2 templates; add compatability with Safari (Mac browser); microincrement version to 2006091202 (release 2.2.1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
==================================================
|
||||
This is v2.2.0 of the HotPot module for Moodle 1.7
|
||||
This is v2.2.1 of the HotPot module for Moodle 1.7
|
||||
==================================================
|
||||
|
||||
This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle.
|
||||
|
||||
+158
-42
@@ -1014,9 +1014,23 @@ function GetJClozeQuestionDetails(hp, v) {
|
||||
if (r!=2.1) { // exclude Find-It 3a
|
||||
for (var i=0, ii=0; i<I[q][1].length; i++) {
|
||||
var s = I[q][1][i][0];
|
||||
if (typeof(s)=='string' && s!='' && (s.toUpperCase() != correct.toUpperCase())) {
|
||||
x[ii++] = s;
|
||||
}
|
||||
if (typeof(s)=='string' && s!='') {
|
||||
if (s.toUpperCase() == correct.toUpperCase()) {
|
||||
var is_ignored = false;
|
||||
} else {
|
||||
// DropDown 2.4
|
||||
var is_ignored = true;
|
||||
var iii_max = HP[_wrong][q] ? HP[_wrong][q].length : 0;
|
||||
for (var iii=0; iii<iii_max; iii++) {
|
||||
if (s.toUpperCase() == HP[_wrong][q][iii].toUpperCase()) {
|
||||
var is_ignored = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_ignored) {
|
||||
x[ii++] = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
qDetails += hpHiddenField(Q+'ignored', x);
|
||||
@@ -1347,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<x.length; i++) {
|
||||
var a = new Array();
|
||||
@@ -1364,14 +1385,33 @@ function GetJQuizAnswerDetails(q, flag) {
|
||||
x[i] = a.join('+');
|
||||
}
|
||||
} else if (x) { // multiple-choice, short-answer and hybrid
|
||||
// remove trailing comma and convert to array
|
||||
x = x.substring(0, x.length-1).split(',');
|
||||
if (x.charAt(x.length-1)==',') {
|
||||
// HP 6.0 and 6.1 (always has trailing comma)
|
||||
x = x.substring(0, x.length-1).split(',');
|
||||
} else {
|
||||
// HP 6.2 (short answer also contains student entered text)
|
||||
x = x.split(' | ');
|
||||
}
|
||||
if (flag) {
|
||||
var a = new Array();
|
||||
if (flag==1 || flag==2 || flag==3) {
|
||||
for (var i=0; i<x.length; i++) {
|
||||
var ii = I[q][3][(x[i].charCodeAt(0)-65)][2];
|
||||
if(((flag==1 || flag==2) && ii==1) || (flag==3 && ii==0)) a.push(x[i]);
|
||||
var is_correct = false;
|
||||
if (x[i].length==1) { // single letter
|
||||
var ii = x[i].charCodeAt(0) - 65;
|
||||
if (I[q][3] && I[q][3][ii] && I[q][3][ii][2]) {
|
||||
var is_correct = true;
|
||||
}
|
||||
}
|
||||
if (is_correct) {
|
||||
if (flag==2) {
|
||||
a.push(x[i]);
|
||||
}
|
||||
} else {
|
||||
if (flag==1 || flag==3) {
|
||||
a.push(x[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag==1) {
|
||||
@@ -1392,8 +1432,12 @@ function GetJQuizAnswerDetails(q, flag) {
|
||||
// convert answer indexes to values, if required
|
||||
if (JQuiz[6]==false) {
|
||||
for (var i=0; i<x.length; i++) {
|
||||
var ii = x[i].charCodeAt(0) - 65;
|
||||
x[i] = I[q][3][ii][0];
|
||||
if (x[i].length==1) { // single letter
|
||||
var ii = x[i].charCodeAt(0) - 65;
|
||||
if (I[q][3] && I[q][3][ii]) {
|
||||
x[i] = I[q][3][ii][0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1504,7 +1548,7 @@ function hpClickClue(hp, t, v, args) {
|
||||
}
|
||||
function hpClickCheck(hp, t, v, args) {
|
||||
if (t==2) { // JCloze
|
||||
if (v==5 || v==6) {
|
||||
if (v==5 || v==6) {
|
||||
var r = hpRottmeier();
|
||||
var already_correct = 'true';
|
||||
if (r==0) {
|
||||
@@ -1526,7 +1570,18 @@ function hpClickCheck(hp, t, v, args) {
|
||||
if (hp==5) {
|
||||
g = eval('document.Cloze.Gap'+i+'.value');
|
||||
} else if (hp==6) {
|
||||
g = Get_SelectedDropValue(i);
|
||||
var ii = Get_SelectedDropValue(i);
|
||||
if (isNaN(ii) || ii<0) { // 'null' || -1
|
||||
g = ''; // no guess yet
|
||||
} else {
|
||||
if (window.MakeIndividualDropdowns) {
|
||||
var is_wrong = (ii!=0);
|
||||
g = I[i][1][ii][0];
|
||||
} else {
|
||||
var is_wrong = (ii!=i);
|
||||
g = I[ii][1][0][0];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (r==2.1 && i==args[0]) { // Find-It 3a
|
||||
g = I[i][1][0][0];
|
||||
@@ -1539,18 +1594,22 @@ function hpClickCheck(hp, t, v, args) {
|
||||
// is this a new guess at this gap?
|
||||
if (ii==0 || g!=HP[_guesses][i][ii-1]) {
|
||||
HP[_guesses][i][ii] = g;
|
||||
var G = g.toUpperCase();
|
||||
|
||||
var ii_max = I[i][1].length;
|
||||
for (var ii=0; ii<ii_max; ii++) {
|
||||
if (window.CaseSensitive) {
|
||||
if (g==I[i][1][ii][0]) break;
|
||||
} else {
|
||||
if (G==I[i][1][ii][0].toUpperCase()) break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ii==ii_max) { // guess is wrong
|
||||
if (r==1) {
|
||||
// Rottmeier DropDown 2.4
|
||||
// do nothing
|
||||
} else {
|
||||
var G = g.toUpperCase();
|
||||
var ii_max = I[i][1].length;
|
||||
for (var ii=0; ii<ii_max; ii++) {
|
||||
if (window.CaseSensitive) {
|
||||
if (g==I[i][1][ii][0]) break;
|
||||
} else {
|
||||
if (G==I[i][1][ii][0].toUpperCase()) break;
|
||||
}
|
||||
}
|
||||
var is_wrong = (ii==ii_max);
|
||||
}
|
||||
if (is_wrong) { // guess is wrong
|
||||
if (!HP[_wrong][i]) HP[_wrong][i] = new Array();
|
||||
var ii_max = HP[_wrong][i].length;
|
||||
for (var ii=0; ii<ii_max; ii++) {
|
||||
@@ -1770,7 +1829,7 @@ function hpClickCheck(hp, t, v, args) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
//return true;
|
||||
}
|
||||
function hpClickCheckJCrossV5V6(hp, v, AD, q, row, col) {
|
||||
// v is the version of Hot Potatoes
|
||||
@@ -1888,7 +1947,7 @@ function hpHiddenField(name, value, comma, forceHTML) {
|
||||
if (comma==null) comma = ',';
|
||||
for (var i=0; i<i_max; i++) {
|
||||
values[i] = trim(values[i]);
|
||||
if (values[i]!='') {
|
||||
if (values[i]!=null && values[i]!='') {
|
||||
value += (i==0 ? '' : comma) + encode_entities(values[i]);
|
||||
}
|
||||
}
|
||||
@@ -1991,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<i_max; i++) {
|
||||
s += '"' + args[i] + '",';
|
||||
if (addQuotes) {
|
||||
s += '"' + args[i] + '",';
|
||||
} else {
|
||||
if (s) {
|
||||
s += ',';
|
||||
}
|
||||
s += args[i];
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@@ -2141,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)
|
||||
@@ -2165,7 +2263,7 @@ function hpInterceptFeedback() {
|
||||
if (a[0] && window.FEEDBACK && FEEDBACK[0]) {
|
||||
s = a[0] + "+='<br /><br />" + '<a href="javascript:hpFeedback();">' + FEEDBACK[6] + "</A>';" + s;
|
||||
}
|
||||
eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');
|
||||
hpNewFunction(f, a, s);
|
||||
}
|
||||
}
|
||||
function hpInterceptHints() {
|
||||
@@ -2228,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() {
|
||||
@@ -2283,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() {
|
||||
@@ -2325,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2365,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)
|
||||
@@ -2375,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
|
||||
}
|
||||
}
|
||||
@@ -2661,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'");
|
||||
@@ -2742,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'");
|
||||
@@ -2801,9 +2912,9 @@ function hpIsStrict() {
|
||||
// **************
|
||||
// initialization
|
||||
// **************
|
||||
hpInterceptFeedback();
|
||||
hpInterceptHints();
|
||||
hpInterceptClues();
|
||||
//hpInterceptFeedback();
|
||||
//hpInterceptHints();
|
||||
//hpInterceptClues();
|
||||
hpInterceptChecks();
|
||||
function hpFindForm(formname, w) {
|
||||
if (w==null) w = self;
|
||||
@@ -2867,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
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -59,7 +63,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="TimerStartUp()" id="TheBody">
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
<div class="StdDiv" id="CheckButtonDiv">
|
||||
|
||||
@@ -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<D.length; i++){
|
||||
DC[i].SetT(CurrTop);
|
||||
@@ -262,8 +294,11 @@ function CheckAnswers(){
|
||||
var Feedback = '';
|
||||
|
||||
//for each fixed, check to see if the tag value for the draggable is the same as the fixed
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
var i, j;
|
||||
for (i=0; i<D.length; i++){
|
||||
if (i>0){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]
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -59,7 +63,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="TimerStartUp()" id="TheBody">
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
<div class="StdDiv" id="CheckButtonDiv">
|
||||
|
||||
@@ -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 = '<span class="CorrectAnswer">' + CompiledOutput + '</span><br /><br />' + CorrectResponse + '<br />';
|
||||
|
||||
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 = '<span class="Guess">' + CompileString(GuessSequence) + '</span><br /><br />';
|
||||
var WrongGuess = CompileString(GuessSequence);
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
AnswersTried += WrongGuess;
|
||||
TryAgain = '<span class="Guess">' + WrongGuess + '</span><br /><br />';
|
||||
if ((CheckType == 0)||(LongestCorrect.length==0)){
|
||||
TryAgain += IncorrectResponse + '<br />';
|
||||
}
|
||||
@@ -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]
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
@@ -48,7 +51,7 @@
|
||||
</head>
|
||||
<!--<body>Fool those dumb ad-inserting ISPs</body>-->
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="SetScormBrowseTime(); CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -66,7 +69,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
|
||||
[QuickTime Player]
|
||||
<object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" data="[strFilePath]" width="[strWidth]" height="[strHeight]">
|
||||
<param name="src" value="[strFilePath]" />
|
||||
<param name="autoplay" value="false" />
|
||||
<param name="controller" value="true" />
|
||||
<object type="audio/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]
|
||||
[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]
|
||||
|
||||
[Windows Media Player]
|
||||
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="[strWidth]" height="[strHeight]">
|
||||
[Windows Media Player]<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="[strWidth]" height="[strHeight]">
|
||||
<param name="url" value="[strFilePath]" />
|
||||
<param name="autostart" value="false" />
|
||||
<param name="showcontrols" value="true" />[strContent]</object>
|
||||
@@ -26,10 +15,4 @@
|
||||
<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
|
||||
[strContent]</object>[/Real Player]
|
||||
|
||||
[Flash Player]
|
||||
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0"
|
||||
type="application/x-shockwave-flash"
|
||||
width="[strWidth]" height="[strHeight]">
|
||||
<param name="movie" value="[strFilePath]" />
|
||||
[strContent]</object>[/Flash Player]
|
||||
[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]
|
||||
|
||||
@@ -6,49 +6,74 @@ var topZ = 1000;
|
||||
|
||||
function ShowMessage(Feedback){
|
||||
var Output = Feedback + '<br /><br />';
|
||||
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<Els.length; i++){
|
||||
function ShowElements(Show, TagName, ContainerToReverse){
|
||||
// added third argument to allow objects in the feedback box to appear
|
||||
//IE bug -- hide all the form elements that will show through the popup
|
||||
//FF on Mac bug : doesn't redisplay objects whose visibility is set to visible
|
||||
//unless the object's display property is changed
|
||||
|
||||
//get container object (by Id passed in, or use document otherwise)
|
||||
TopNode = document.getElementById(ContainerToReverse);
|
||||
var Els;
|
||||
if (TopNode != null) {
|
||||
Els = TopNode.getElementsByTagName(TagName);
|
||||
} else {
|
||||
Els = document.getElementsByTagName(TagName);
|
||||
}
|
||||
|
||||
for (var i=0; i<Els.length; i++){
|
||||
if (TagName == "object") {
|
||||
//manipulate object elements in all browsers
|
||||
if (Show == true){
|
||||
Els[i].style.display = 'inline';
|
||||
Els[i].style.visibility = 'visible';
|
||||
//get Mac FireFox to manipulate display, to force screen redraw
|
||||
if (C.mac && C.gecko) {Els[i].style.display = '';}
|
||||
}
|
||||
else{
|
||||
Els[i].style.display = 'none';
|
||||
Els[i].style.visibility = 'hidden';
|
||||
if (C.mac && C.gecko) {Els[i].style.display = 'none';}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// tagName is either input or select (that is, Form Elements)
|
||||
// ie6 has a problem with Form elements, so manipulate those
|
||||
if (C.ie) {
|
||||
if (C.ieVer < 7) {
|
||||
if (Show == true){
|
||||
Els[i].style.visibility = 'visible';
|
||||
}
|
||||
else{
|
||||
Els[i].style.visibility = 'hidden';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function HideFeedback(){
|
||||
document.getElementById('FeedbackDiv').style.display = 'none';
|
||||
ShowElements(true, 'input');
|
||||
|
||||
@@ -22,25 +22,36 @@ function GetPageXY(El) {
|
||||
}
|
||||
|
||||
function GetScrollTop(){
|
||||
if (document.documentElement && document.documentElement.scrollTop){
|
||||
return document.documentElement.scrollTop;
|
||||
if (typeof(window.pageYOffset) == 'number'){
|
||||
return window.pageYOffset;
|
||||
}
|
||||
else{
|
||||
if (document.body){
|
||||
return document.body.scrollTop;
|
||||
if ((document.body)&&(document.body.scrollTop)){
|
||||
return document.body.scrollTop;
|
||||
}
|
||||
else{
|
||||
return window.pageYOffset;
|
||||
if ((document.documentElement)&&(document.documentElement.scrollTop)){
|
||||
return document.documentElement.scrollTop;
|
||||
}
|
||||
else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GetViewportHeight(){
|
||||
if (window.innerHeight){
|
||||
if (typeof window.innerHeight != 'undefined'){
|
||||
return window.innerHeight;
|
||||
}
|
||||
else{
|
||||
return document.getElementsByTagName('body')[0].clientHeight;
|
||||
if (((typeof document.documentElement != 'undefined')&&(typeof document.documentElement.clientHeight !=
|
||||
'undefined'))&&(document.documentElement.clientHeight != 0)){
|
||||
return document.documentElement.clientHeight;
|
||||
}
|
||||
else{
|
||||
return document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -58,7 +62,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
@@ -126,7 +130,7 @@
|
||||
</div>
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad">
|
||||
<div class="Keypad" id="CharacterKeypad">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
@@ -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; i<State.length; i++){
|
||||
var ThisItemGuesses = '';
|
||||
var GapLabel = 'Gap_' + (i+1).toString();
|
||||
var ThisItemScore = Math.floor(State[i].ItemScore * 100) + '';
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.id', 'obj'+GapLabel);
|
||||
API.LMSSetValue('cmi.interactions.' + i + '.id', 'int'+GapLabel);
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.score.raw', ThisItemScore);
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.score.min', '0');
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.score.max', '100');
|
||||
if (State[i].AnsweredCorrectly == true){
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.status', 'completed');
|
||||
}
|
||||
else{
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.status', 'incomplete');
|
||||
}
|
||||
for (var j=0; j<State[i].Guesses.length; j++){
|
||||
if (j>0){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<I.length; i++){
|
||||
Ans = GetGapValue(i);
|
||||
if ((Ans.length > 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]
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -58,7 +62,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
@@ -102,7 +106,7 @@
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad" style="float: left;">
|
||||
<div class="Keypad" id="CharacterKeypad" style="float: left;">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
@@ -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,6 +45,7 @@ var Score = 0;
|
||||
var InTextBox = false;
|
||||
var Locked = false;
|
||||
var TimeOver = false;
|
||||
var CaseSensitive = [boolCaseSensitive];
|
||||
|
||||
var InputStuff = '<form method="post" action="" onsubmit="return false;"><span class="ClueNum">[strClueNum]: </span>';
|
||||
InputStuff += '[strClue] <input onfocus="CurrentBox=this;InTextBox=true;" onblur="InTextBox=false;" id="[strBoxId]" type="edit" size="[strEditSize]" maxlength="[strMaxLength]"></input>';
|
||||
@@ -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<L[i].length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
if (CaseSensitive == true){
|
||||
LetterFromKey = L[i][j];
|
||||
LetterFromGuess = G[i][j];
|
||||
}
|
||||
else {
|
||||
LetterFromKey = L[i][j].toUpperCase();
|
||||
LetterFromGuess = G[i][j].toUpperCase();
|
||||
}
|
||||
if (LetterFromGuess != LetterFromKey){
|
||||
// if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
@@ -182,7 +228,16 @@ function ShowHint(Across,ClueNum,x,y,BoxId){
|
||||
while (i<L.length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
if (CaseSensitive == true){
|
||||
LetterFromKey = L[i][j];
|
||||
LetterFromGuess = G[i][j];
|
||||
}
|
||||
else {
|
||||
LetterFromKey = L[i][j].toUpperCase();
|
||||
LetterFromGuess = G[i][j].toUpperCase();
|
||||
}
|
||||
if (LetterFromGuess != LetterFromKey){
|
||||
// if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
@@ -214,13 +269,23 @@ function CheckAnswers(){
|
||||
var AllCorrect = true;
|
||||
var TotLetters = 0;
|
||||
var CorrectLetters = 0;
|
||||
|
||||
var LetterFromKey = '';
|
||||
var LetterFromGuess = '';
|
||||
|
||||
//Check each letter
|
||||
for (var i=0; i<L.length; i++){
|
||||
for (var j=0; j<L[i].length; j++){
|
||||
if (L[i][j] != ''){
|
||||
TotLetters++;
|
||||
if (G[i][j] != L[i][j]){
|
||||
if (CaseSensitive == true) {
|
||||
LetterFromKey = L[i][j];
|
||||
LetterFromGuess = G[i][j];
|
||||
}
|
||||
else {
|
||||
LetterFromKey = L[i][j].toUpperCase();
|
||||
LetterFromGuess = G[i][j].toUpperCase();
|
||||
}
|
||||
if (LetterFromGuess != LetterFromKey){
|
||||
G[i][j] = '';
|
||||
//Blank that square in the grid
|
||||
SetGridSquareValue(i,j,'');
|
||||
@@ -264,6 +329,14 @@ function CheckAnswers(){
|
||||
Finished = true;
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
[inclScorm1.2]
|
||||
if (AllCorrect == true){
|
||||
SetScormComplete();
|
||||
}
|
||||
else{
|
||||
SetScormIncomplete();
|
||||
}
|
||||
[/inclScorm1.2]
|
||||
}
|
||||
|
||||
function Finish(){
|
||||
@@ -293,5 +366,8 @@ function TimesUp() {
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
[inclScorm1.2]
|
||||
SetScormTimedOut();
|
||||
[/inclScorm1.2]
|
||||
}
|
||||
[/inclTimer]
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -58,7 +62,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
|
||||
@@ -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; i<Status[0][3].length; i++){
|
||||
if (i>0){AnswersTried += ' | ';}
|
||||
for (var j=0; j<Status.length; j++){
|
||||
if (j>0){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]
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -58,7 +62,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -80,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
|
||||
@@ -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 = ' <a class="ExSegment" href="javascript:void(0)" onclick="AddSegment([SegmentNumber])" title="[strClickToAdd]">[CurrentSegment]</a> ';
|
||||
@@ -209,6 +240,9 @@ function CheckAnswer(CheckType){
|
||||
|
||||
WellDone = '<span class="Answer">' + Output + '</span><br /><br />' + CorrectResponse + '<br />';
|
||||
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
AnswersTried += Output;
|
||||
|
||||
//Do score calculation here
|
||||
Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length);
|
||||
WellDone += YourScoreIs + ' ' + Score + '%.<br />';
|
||||
@@ -224,7 +258,10 @@ function CheckAnswer(CheckType){
|
||||
}
|
||||
|
||||
else{
|
||||
TryAgain = '<span class="Answer">' + CompileString(GuessSequence) + '</span><br /><br />';
|
||||
var WrongGuess = CompileString(GuessSequence);
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
AnswersTried += WrongGuess;
|
||||
TryAgain = '<span class="Answer">' + WrongGuess + '</span><br /><br />';
|
||||
if (CheckType == 0){
|
||||
TryAgain += IncorrectResponse + '<br />';
|
||||
}
|
||||
@@ -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]
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
<!--
|
||||
|
||||
[inclScorm1.2]
|
||||
[strJSScorm_1_2]
|
||||
[/inclScorm1.2]
|
||||
|
||||
[strJSBrowserCheck]
|
||||
|
||||
[strJSButtons]
|
||||
@@ -62,7 +66,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="StartUp()" id="TheBody">
|
||||
<body onload="StartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
@@ -84,7 +88,7 @@
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
<div id="Instructions">[strInstructions]</div>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
|
||||
@@ -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<State.length; i++){
|
||||
if (State[i] != null){
|
||||
var ItemLabel = 'Item_' + (i+1).toString();
|
||||
var ThisItemScore = '';
|
||||
var ThisItemStatus = '';
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.id', 'obj'+ItemLabel);
|
||||
API.LMSSetValue('cmi.interactions.' + i + '.id', 'int'+ItemLabel);
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.score.min', '0');
|
||||
API.LMSSetValue('cmi.objectives.' + i + '.score.max', '100');
|
||||
if (State[i][2] > 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<Children.length; i++){
|
||||
if (Children[i].className=="HiddenReading"){
|
||||
document.getElementById('ReadingDiv').innerHTML = Children[i].innerHTML;
|
||||
@@ -205,6 +246,10 @@ function StartUp(){
|
||||
//Stash the instructions so they can be redisplayed
|
||||
strInstructions = document.getElementById('InstructionsDiv').innerHTML;
|
||||
|
||||
[inclScorm1.2]
|
||||
ScormStartUp();
|
||||
[/inclScorm1.2]
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
@@ -315,7 +360,8 @@ function CheckMCAnswer(QNum, ANum, Btn){
|
||||
|
||||
//Store the try number in the answer part of the State array, for tracking purposes
|
||||
State[QNum][1][ANum] = State[QNum][2];
|
||||
State[QNum][5] += String.fromCharCode(65+ANum) + ',';
|
||||
if (State[QNum][5].length > 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 += '</fields></hpnetresult>';
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
[inclScorm1.2]
|
||||
else{
|
||||
SetScormIncomplete();
|
||||
}
|
||||
[/inclScorm1.2]
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
<!-- Made with executable version [strFullVersionInfo] -->
|
||||
|
||||
<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
|
||||
|
||||
[strHeaderCode]
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body{
|
||||
|
||||
@@ -13,7 +13,7 @@ Testing browser check code
|
||||
|
||||
<script type="text/javascript" src="hp6browsercheck.js_"></script>
|
||||
|
||||
<base href="http://web.uvic.ca/hrd/hotpot/" />
|
||||
<base href="http://hotpot.uvic.ca/" />
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/// Code fragment to define the version of hotpot
|
||||
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
$module->version = 2006091201; // release date of this version (see note below)
|
||||
$module->release = 'v2.2.0'; // human-friendly version name (used in mod/hotpot/lib.php)
|
||||
$module->version = 2006091202; // release date of this version (see note below)
|
||||
$module->release = 'v2.2.1'; // human-friendly version name (used in mod/hotpot/lib.php)
|
||||
$module->requires = 2006080900; // Requires this Moodle version
|
||||
$module->cron = 0; // period for cron to check this module (secs)
|
||||
// interpretation of YYYYMMDDXY version numbers
|
||||
|
||||
Reference in New Issue
Block a user