mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
standardize white space, including line endings
This commit is contained in:
parent
ca091dc198
commit
90fb280427
@ -1,27 +1,27 @@
|
||||
<!--
|
||||
// PLEASE NOTE that this version is more recent than the incorrectly
|
||||
// numbered v6.1, dated 2003.11.17. From now on, version numbers will
|
||||
// PLEASE NOTE that this version is more recent than the incorrectly
|
||||
// numbered v6.1, dated 2003.11.17. From now on, version numbers will
|
||||
// follow those of Hot Potatoes.
|
||||
/* hot-potatoes.js (v6.0.4.0 - 2005.02.18)
|
||||
* =======================================
|
||||
* by Gordon Bateson, February 2003
|
||||
* Copyright (c) 2003 Gordon Bateson. All Rights Reserved.
|
||||
*
|
||||
* You are hereby granted a royalty free license to use or modify this
|
||||
* software provided that this copyright notice appears on all copies.
|
||||
* You are hereby granted a royalty free license to use or modify this
|
||||
* software provided that this copyright notice appears on all copies.
|
||||
*
|
||||
* This software is provided "AS IS" without a warranty of any kind.
|
||||
*
|
||||
* Documentation and downloads may be available from:
|
||||
*
|
||||
* Documentation and downloads may be available from:
|
||||
* http://www.kanazawa-gu.ac.jp/~gordon/research/hot-potatoes/
|
||||
*/
|
||||
// This JavaScript library modifies the SendResults and StartUp functions
|
||||
// This JavaScript library modifies the SendResults and StartUp functions
|
||||
// used by hotpot v5 and v6, so that more (or less!) details about the
|
||||
// student can be input, and more details of a quiz's questions and answers
|
||||
// student can be input, and more details of a quiz's questions and answers
|
||||
// can be submitted to the server when the quiz is finished
|
||||
// If the arrays below (Login, DB, JBC, ...) are set BEFORE calling this
|
||||
// script, they will NOT be overwritten. Any array that is not set, will
|
||||
// use the defaults below. This is useful if you want to use different
|
||||
// If the arrays below (Login, DB, JBC, ...) are set BEFORE calling this
|
||||
// script, they will NOT be overwritten. Any array that is not set, will
|
||||
// use the defaults below. This is useful if you want to use different
|
||||
// settings for different quizzes.
|
||||
// ************
|
||||
// Login Screen
|
||||
@ -29,7 +29,7 @@
|
||||
if (window.Login==null) {
|
||||
Login = new Array();
|
||||
Login[0] = true; // Show prompt for user name
|
||||
// This can also be a string of user names ...
|
||||
// This can also be a string of user names ...
|
||||
// Login[0] = "Guest,Peter,Paul,Mary,Webmaster";
|
||||
// or an array of user names (and on-screen texts) (and passwords) ...
|
||||
// Login[0] = new Array("Guest", "001,Peter,xxxx", "002,Paul,yyyy", "003,Mary,zzzz", "Webmaster");
|
||||
@ -42,21 +42,21 @@ if (window.Login==null) {
|
||||
// new Array("Webmaster")
|
||||
// );
|
||||
Login[1] = true; // Show prompt for student's UserID
|
||||
// If there is no password prompt (i.e. Logon[3] is false), this value
|
||||
// If there is no password prompt (i.e. Logon[3] is false), this value
|
||||
// will be checked against the password information, if any, in Login[0]
|
||||
Login[2] = false; // Show prompt for student's email
|
||||
Login[3] = false; // Show prompt for quiz password, and check this value against
|
||||
Login[3] = false; // Show prompt for quiz password, and check this value against
|
||||
// the password information, if any, in Login[0]
|
||||
// This can also be a string required to start the quiz ...
|
||||
// Login[3] = "password";
|
||||
Login[4] = true; // Show prompt for the cookie expiry date
|
||||
// If false, cookies expire at the end of the current session
|
||||
Login[5] = "guest,webmaster"
|
||||
// guest user names (case insensitive) ...
|
||||
// Login[5] = "guest,webmaster";
|
||||
// guest user names (case insensitive) ...
|
||||
// Login[5] = "guest,webmaster";
|
||||
// These users do NOT need to fill in other login fields
|
||||
// and their quiz results are NOT added to the database
|
||||
// the Login prompts and error messages
|
||||
// the Login prompts and error messages
|
||||
// are defined in the MSG array (see below)
|
||||
}
|
||||
// *********
|
||||
@ -65,25 +65,25 @@ if (window.Login==null) {
|
||||
if (window.DB==null) {
|
||||
DB = new Array();
|
||||
DB[0] = true; // append form fields to database on server
|
||||
// If you are NOT using BFormMail's database feature,
|
||||
// If you are NOT using BFormMail's database feature,
|
||||
// set DB[0]=false, and you can then safely ignore DB[1 to 5]
|
||||
DB[1] = "/home/gordon/public_html/cgi/hot-potatoes-data";
|
||||
DB[1] = "/home/gordon/public_html/cgi/hot-potatoes-data";
|
||||
// append_db folder path (no trailing slash)
|
||||
// Can be either an absolute path e.g. "/home/gordon/public_html/cgi/hot-potatoes-data"
|
||||
// or a relative (to CGI bin) path e.g. "hot-potatoes-data"
|
||||
DB[2] = "hot-potatoes";
|
||||
DB[2] = "hot-potatoes";
|
||||
// append_db file name (no extension)
|
||||
// If left blank, the quiz file name, without extension, will be used
|
||||
// i.e. each quiz will have its results stored in a different file.
|
||||
// If filled in, this file will store the results for ALL quizzes.
|
||||
// Database files and folders must be set up BEFORE running the quiz
|
||||
// Database files and folders must be set up BEFORE running the quiz
|
||||
// must have appropriate access privileges (on Unix, use "chmod 666").
|
||||
DB[3] = ""; // append_db extension (if left blank, ".txt" will be used)
|
||||
DB[4] = ""; // db_fields (if left blank, ALL quiz fields will be sent)
|
||||
DB[5] = ""; // db_delimiter (if left blank, tab will be used)
|
||||
DB[6] = "REMOTE_ADDR,HTTP_USER_AGENT";
|
||||
DB[6] = "REMOTE_ADDR,HTTP_USER_AGENT";
|
||||
// env_report ('REMOTE_ADDR','HTTP_USER_AGENT' and a few others)
|
||||
// for a complete description of these fields are, see ...
|
||||
// for a complete description of these fields are, see ...
|
||||
// http://www.infosheet.com/stuff/BFormMail.readme
|
||||
// Switches DB[7] and DB[8] force the settings in the ResultForm
|
||||
// In v5 and v6 quizzes, these settings wil be override those in the original quiz
|
||||
@ -94,7 +94,7 @@ if (window.DB==null) {
|
||||
DB[8] = ''; // email address to which results should be sent
|
||||
// e.g. gordon@kanazawa-gu.ac.jp
|
||||
}
|
||||
// By default the quiz's question's scores will be returned.
|
||||
// By default the quiz's question's scores will be returned.
|
||||
// If you want more detailed information, set the flags below:
|
||||
// ********
|
||||
// JBC
|
||||
@ -162,16 +162,16 @@ if (window.JCloze==null) {
|
||||
// [0] : (unused)
|
||||
// [1] : array of JCLOZE_ANSWER_TEXTs
|
||||
// [2] : clue for this answer
|
||||
// JCLOZE_ANSWER_TEXT :
|
||||
// JCLOZE_ANSWER_TEXT :
|
||||
// [0] : array (seems unnecessary, just the text would be enough?)
|
||||
// [0] : text of possible answer
|
||||
// State : array of JCLOZE_ANSWER_STATEs
|
||||
// JCLOZE_ANSWER_STATE (v5) :
|
||||
// JCLOZE_ANSWER_STATE (v5) :
|
||||
// [0] : clue asked for or not
|
||||
// [1] : number of hints (show next letter) and penalties ('check' an incorrect answer)
|
||||
// [2] : length of answer matched
|
||||
// [3] : score for this item
|
||||
// [4] : already answered correctly
|
||||
// [4] : already answered correctly
|
||||
// [5] : answer entered in text box (right or not)
|
||||
// JCLOZE_ANSWER_STATE (v6)
|
||||
// this.ClueGiven = false;
|
||||
@ -196,16 +196,16 @@ if (window.JCross==null) {
|
||||
JCross[8] = true; // show number of checks
|
||||
// there are no "ignored" answers for JCross quizzes
|
||||
}
|
||||
// JCross quizzes use the following global variables:
|
||||
// JCross quizzes use the following global variables:
|
||||
// L : letters (of correct answers)
|
||||
// C : clue numbers (CL in v6)
|
||||
// G : guesses
|
||||
// 'L', 'C' ('CL') and 'G' are all 2-dimensional arrays (rows x cols)
|
||||
//
|
||||
// v5 quizzes additionally use the following single-dimension arrays
|
||||
// A : clues for across (horizontal) words
|
||||
// D : clues for down (vertical) words
|
||||
// N.B. form is only sent when all answers are correct so
|
||||
// A : clues for across (horizontal) words
|
||||
// D : clues for down (vertical) words
|
||||
// N.B. form is only sent when all answers are correct so
|
||||
// you can't find out what 'wrong' answers were entered
|
||||
// ********
|
||||
// JMatch
|
||||
@ -251,7 +251,7 @@ if (window.JMatch==null) {
|
||||
// [0] : text
|
||||
// [1] : tag of the F item to which it SHOULD be dragged
|
||||
// [2] : tag of the F item to which it was dragged (initally 0)
|
||||
// N.B. form is only sent when all answers are correct so
|
||||
// N.B. form is only sent when all answers are correct so
|
||||
// you can't find out what 'wrong' answers were entered
|
||||
// ********
|
||||
// JMix
|
||||
@ -266,8 +266,8 @@ if (window.JMix==null) {
|
||||
JMix[5] = true; // show number of checks
|
||||
JMix[6] = true; // show number of hints (=show next word)
|
||||
}
|
||||
// JMix quizzes use the global variables
|
||||
// 'Segments', 'GuessSequence' and 'Penalties'
|
||||
// JMix quizzes use the global variables
|
||||
// 'Segments', 'GuessSequence' and 'Penalties'
|
||||
// Segments : array of JMix_QUESTIONs
|
||||
// JMix_QUESTION:
|
||||
// [0] : text
|
||||
@ -305,7 +305,7 @@ if (window.JQuiz==null) {
|
||||
// [0] : array (seems unnecessary, just the text would be enough?)
|
||||
// [0] : text of possible answer
|
||||
// Status : array of JQUIZ_ANSWER_STATEs
|
||||
// JQUIZ_ANSWER_STATE :
|
||||
// JQUIZ_ANSWER_STATE :
|
||||
// [0] : question done or not
|
||||
// [1] : number of wrong checks
|
||||
// [2] : number of hints asked for
|
||||
@ -324,23 +324,23 @@ if (window.JQuiz==null) {
|
||||
// [1] : feedback text
|
||||
// [2] : correct answer flag (1=a correct answer, 0=a wrong answer)
|
||||
// [3] : weighted score (as percentage) if correct
|
||||
// [4] : flag (usually set to 1, but for hybrid answers that are not
|
||||
// [4] : flag (usually set to 1, but for hybrid answers that are not
|
||||
// to be included in multiple choice options, it is set to 0)
|
||||
// State : array of JQUIZ_QUESTION_STATEs
|
||||
// JQUIZ_QUESTION_STATE :
|
||||
// JQUIZ_QUESTION_STATE :
|
||||
// [0] : score (-1 shows not done yet)
|
||||
// [1] : array showing on which number try each JQUIZ_ANSWER was selected
|
||||
// [2] : number of attempts at this question
|
||||
// [3] : total of weighted scores of correct answers that were selected
|
||||
// i.e. each time a correct answer is selected,
|
||||
// i.e. each time a correct answer is selected,
|
||||
// its JQUIZ_ANSWER[3] weighting is added to this total
|
||||
// so when all the correct answers have been selected, this will be 100
|
||||
// [4] : penalties incurred for hints (score is set to zero if >= 1)
|
||||
// [5] : - for multiple choice, short-answer and hybrid questions, this is a
|
||||
// comma-delimited list showing order in which answers were chosen
|
||||
// - for multi-select fields, this is bar-delimted ('|') list of settings
|
||||
// showing whether each checkbox was selected ('Y') on not ('N') when the
|
||||
// 'Check' button was clicked. The final item in the list will be the
|
||||
// - for multi-select fields, this is bar-delimted ('|') list of settings
|
||||
// showing whether each checkbox was selected ('Y') on not ('N') when the
|
||||
// 'Check' button was clicked. The final item in the list will be the
|
||||
// settings for the correct answer.
|
||||
// N.B. JBC, JMatch(v5) and JQuiz(v5) all use global variables 'I' and 'Status'
|
||||
// JBC : I[0].length==3 && !window.RItems
|
||||
@ -624,7 +624,7 @@ function checkOK(w, n){
|
||||
function getValue(w, n, flag) {
|
||||
var obj = w.document.forms[0].elements[n];
|
||||
var TYPE = obj.type.toUpperCase(); // required for ns4 (win)
|
||||
if (obj.options && TYPE.indexOf('SELECT')>=0){
|
||||
if (obj.options && TYPE.indexOf('SELECT')>=0){
|
||||
var v = obj.options[obj.selectedIndex].value;
|
||||
} else {
|
||||
var v = obj.value;
|
||||
@ -634,7 +634,7 @@ function getValue(w, n, flag) {
|
||||
if (n=='Password' || (n=='UserID' && !Login[3])) {
|
||||
var pwd = getPassword(w);
|
||||
if (pwd && v!=pwd) msg = MSG[n=='Password' ? 13 : 14];
|
||||
}
|
||||
}
|
||||
if (n=='UserEmail' && window.RegExp) {
|
||||
var r = '(\\w|-)+';
|
||||
r = r + '(\\.' + r + ')';
|
||||
@ -784,7 +784,7 @@ function SendAllResults(Score) {
|
||||
// if this is a Netscape browser, check if the referer will be set OK
|
||||
if (navigator.appName=='Netscape' && (location.protocol=='file:' || navigator.userAgent.indexOf('Netscape6')>=0)) {
|
||||
// ns4 and ns7 set referer to 'file:// ...' when running a quiz offline
|
||||
// ns6.2 (at least) always sets referer to 'about:blank'
|
||||
// ns6.2 (at least) always sets referer to 'about:blank'
|
||||
// Netscape's setting of referer can cause BFormMail
|
||||
// to reject the form, so encode the form data as a URL
|
||||
var url = form.action;
|
||||
@ -931,11 +931,11 @@ function GetQuestionDetails() {
|
||||
var hp = hpVersion();
|
||||
var t = hpQuizType();
|
||||
var v = hpQuizVersion();
|
||||
return (t==1) ? GetJbcQuestionDetails(hp, v) :
|
||||
(t==2) ? GetJClozeQuestionDetails(hp, v) :
|
||||
(t==3) ? GetJCrossQuestionDetails(hp, v) :
|
||||
(t==4) ? GetJMatchQuestionDetails(hp, v) :
|
||||
(t==5) ? GetJMixQuestionDetails(hp, v) :
|
||||
return (t==1) ? GetJbcQuestionDetails(hp, v) :
|
||||
(t==2) ? GetJClozeQuestionDetails(hp, v) :
|
||||
(t==3) ? GetJCrossQuestionDetails(hp, v) :
|
||||
(t==4) ? GetJMatchQuestionDetails(hp, v) :
|
||||
(t==5) ? GetJMixQuestionDetails(hp, v) :
|
||||
(t==6) ? GetJQuizQuestionDetails(hp, v) :
|
||||
(t==7) ? GetRhubarbDetails(hp, v) :
|
||||
(t==8) ? GetSequiturDetails(hp, v) : '';
|
||||
@ -944,7 +944,7 @@ function GetJbcQuestionDetails(hp, v) {
|
||||
qDetails = '';
|
||||
// check the quiz version
|
||||
if (hp==5 || hp==6) {
|
||||
// get question details
|
||||
// get question details
|
||||
for(var q=0; q<I.length; q++) {
|
||||
// initialize strings to hold answer details
|
||||
var aDetails = new Array();
|
||||
@ -953,7 +953,7 @@ function GetJbcQuestionDetails(hp, v) {
|
||||
aDetails[2] = new Array(); // ignored
|
||||
// get answer details
|
||||
for(var a=0; a<I[q][1].length; a++) {
|
||||
var i = (Status[q][1][a]=='R') ? 0 : (Status[q][1][a]=='0') ? 2 : 1;
|
||||
var i = (Status[q][1][a]=='R') ? 0 : (Status[q][1][a]=='0') ? 2 : 1;
|
||||
aDetails[i][aDetails[i].length] = (JBC[6] ? a : I[q][1][a][0]);
|
||||
}
|
||||
// format 'Q' (a padded, two-digit version of 'q')
|
||||
@ -1076,19 +1076,19 @@ function GetJCrossQuestionDetails(hp, v) {
|
||||
for (var row=0; row<L.length; row++) {
|
||||
for (var col=0; col<L[row].length; col++) {
|
||||
// increment letter count, if required
|
||||
if (L[row][col]) letters++;
|
||||
if (L[row][col]) letters++;
|
||||
// show answers and clues, if required
|
||||
var q = (hp==5) ? C[row][col] : CL[row][col];
|
||||
if (q) {
|
||||
for (var i=0; i<2; i++) { // 0==across, 1==down
|
||||
var AD = (i==0) ? 'A' : 'D';
|
||||
var acrossdown = (i==0) ? 'across' : 'down';
|
||||
|
||||
|
||||
var clue = (hp==5) ? eval(AD+'['+q+']') : GetJCrossClue('Clue_'+AD+'_'+q);
|
||||
if (clue) {
|
||||
// format 'Q' (a padded, two-digit version of 'q')
|
||||
var Q = getQ('JCross', q) + acrossdown + '_'; // e.g. JCross_01_across_
|
||||
|
||||
|
||||
if (JCross[0]) {
|
||||
qDetails += makeSeparator(Q);
|
||||
}
|
||||
@ -1384,7 +1384,7 @@ function GetJQuizAnswerDetails(q, flag) {
|
||||
}
|
||||
x[i] = a.join('+');
|
||||
}
|
||||
} else if (x) { // multiple-choice, short-answer and hybrid
|
||||
} else if (x) { // multiple-choice, short-answer and hybrid
|
||||
if (x.charAt(x.length-1)==',') {
|
||||
// HP 6.0 and 6.1 (always has trailing comma)
|
||||
x = x.substring(0, x.length-1).split(',');
|
||||
@ -1577,7 +1577,7 @@ function hpClickCheck(hp, t, v, args) {
|
||||
if (window.MakeIndividualDropdowns) {
|
||||
var is_wrong = (ii!=0);
|
||||
g = I[i][1][ii][0];
|
||||
} else {
|
||||
} else {
|
||||
var is_wrong = (ii!=i);
|
||||
g = I[ii][1][0][0];
|
||||
}
|
||||
@ -1592,13 +1592,13 @@ function hpClickCheck(hp, t, v, args) {
|
||||
if (!HP[_guesses][i]) HP[_guesses][i] = new Array();
|
||||
var ii = HP[_guesses][i].length;
|
||||
// is this a new guess at this gap?
|
||||
if (ii==0 || g!=HP[_guesses][i][ii-1]) {
|
||||
if (ii==0 || g!=HP[_guesses][i][ii-1]) {
|
||||
HP[_guesses][i][ii] = g;
|
||||
if (r==1) {
|
||||
// Rottmeier DropDown 2.4
|
||||
// do nothing
|
||||
// do nothing
|
||||
} else {
|
||||
var G = g.toUpperCase();
|
||||
var G = g.toUpperCase();
|
||||
var ii_max = I[i][1].length;
|
||||
for (var ii=0; ii<ii_max; ii++) {
|
||||
if (window.CaseSensitive) {
|
||||
@ -1826,7 +1826,7 @@ function hpClickCheck(hp, t, v, args) {
|
||||
} else {
|
||||
if (!HP[_wrong][q]) HP[_wrong][q] = 0;
|
||||
HP[_wrong][q]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//return true;
|
||||
@ -1944,7 +1944,7 @@ function hpHiddenField(name, value, comma, forceHTML) {
|
||||
var values = value;
|
||||
var i_max = values.length;
|
||||
value = '';
|
||||
if (comma==null) comma = ',';
|
||||
if (comma==null) comma = ',';
|
||||
for (var i=0; i<i_max; i++) {
|
||||
values[i] = trim(values[i]);
|
||||
if (values[i]!=null && values[i]!='') {
|
||||
@ -1999,8 +1999,8 @@ function getTime(obj) {
|
||||
// get year, month and day
|
||||
// for an LMS : yyyy-mm-dd
|
||||
// for email : DayName MonthName dd yyyy
|
||||
var s = is_LMS() ?
|
||||
obj.getFullYear() + '-' + pad(obj.getMonth()+1, 2) + '-' + pad(obj.getDate(), 2) :
|
||||
var s = is_LMS() ?
|
||||
obj.getFullYear() + '-' + pad(obj.getMonth()+1, 2) + '-' + pad(obj.getDate(), 2) :
|
||||
MSG[16][obj.getDay()] + ' ' + MSG[17][obj.getMonth()] + ' ' + pad(obj.getDate(), 2) + ' ' + obj.getFullYear()
|
||||
;
|
||||
// get hours, minutes and seconds (hh:mm:ss)
|
||||
@ -2093,7 +2093,7 @@ function getPrompt(fn) {
|
||||
// Note: netscape uses double-quote as delimiter, others use single quote
|
||||
var s = getFuncCode(fn);
|
||||
var i1 = s.indexOf('prompt') + 8;
|
||||
var i2 = s.indexOf(s.charAt(i1-1), i1);
|
||||
var i2 = s.indexOf(s.charAt(i1-1), i1);
|
||||
var p = (i1>=8 && i2>i1) ? s.substring(i1, i2) : '';
|
||||
// make sure browser has decoded the unicode prompt properly
|
||||
// this check is mainly for ns4, but there may be others
|
||||
@ -2109,13 +2109,13 @@ function getPrompt(fn) {
|
||||
}
|
||||
function getStartUpCode(fn) {
|
||||
// the main initialization code comes from the StartUp function
|
||||
// v5 : the code before "UserName", if any,
|
||||
// v5 : the code before "UserName", if any,
|
||||
// and the code after the 2nd subsequent '}'
|
||||
// v6 : the code before and after 'GetUserName();'
|
||||
// v6 : the code before and after 'GetUserName();'
|
||||
// i.e. all the code except the call to 'GetUserName();'
|
||||
var s = getFuncCode(fn);
|
||||
var i1 = s.indexOf('GetUserName();');
|
||||
if (i1>=0) { // v6
|
||||
if (i1>=0) { // v6
|
||||
var i2 = i1 + 14;
|
||||
} else { // v5
|
||||
var i1 = s.indexOf('UserName');
|
||||
@ -2310,14 +2310,14 @@ function hpInterceptHints() {
|
||||
var f = 'Hint';
|
||||
var a = getFuncArgs(f, true);
|
||||
x = 'hpClick(1,0);'; // question number is always zero
|
||||
|
||||
|
||||
} else if (window.CheckAnswer) {
|
||||
var f = 'CheckAnswer';
|
||||
var a = getFuncArgs(f, true);
|
||||
if (a[0]=='ShowHint') {
|
||||
if (a[1]=='QNum') {
|
||||
// JQuiz v3, v5-v6[HP5]
|
||||
x = 'if(ShowHint)hpClick(1,QNum);';
|
||||
x = 'if(ShowHint)hpClick(1,QNum);';
|
||||
} else {
|
||||
// JQuiz v4
|
||||
x = 'if(ShowHint)hpClick(1,QNum-1);'; // QNum is a global variable
|
||||
@ -2397,7 +2397,7 @@ function hpInterceptChecks() {
|
||||
// JCross none
|
||||
// JMatch HP5 v3, v5, v6: CheckAnswer(), HP5 v4: CheckResults(), HP6: CheckAnswers()
|
||||
// JMix CheckAnswer(CheckType)
|
||||
// JQuiz
|
||||
// JQuiz
|
||||
// HP5: CheckAnswer(ShowHint, QNum)
|
||||
// HP6: CheckMCAnswer, CheckMultiSelAnswer, CheckShortAnswer
|
||||
// Rhubarb CheckWord(InputWord)
|
||||
@ -2440,7 +2440,7 @@ function hpInterceptChecks() {
|
||||
if (a[0]=='ShowHint') {
|
||||
if (a[1]=='QNum') {
|
||||
// JQuiz v3, v5-v6[HP5]
|
||||
x = 'if(!ShowHint&&Status[QNum][0]<1)hpClick(3,QNum);';
|
||||
x = 'if(!ShowHint&&Status[QNum][0]<1)hpClick(3,QNum);';
|
||||
} else {
|
||||
// JQuiz v4
|
||||
x = 'if(!ShowHint&&State[QNum-1][0]<1)hpClick(3,QNum-1);'; // QNum is a global variable
|
||||
@ -2452,7 +2452,7 @@ function hpInterceptChecks() {
|
||||
// Sequitur
|
||||
x = 'if (!(CurrentNumber==TotalSegments||AllDone||Btn.innerHTML==IncorrectIndicator))hpClick(3,Chosen);';
|
||||
}
|
||||
} else if (window.CheckWord) {
|
||||
} else if (window.CheckWord) {
|
||||
f = 'CheckWord';
|
||||
var a = getFuncArgs(f, true);
|
||||
if (a[0]=='InputWord') {
|
||||
@ -2492,7 +2492,7 @@ if (Array.prototype && Array.prototype.push==null) {
|
||||
Array.prototype.push = new Function("x", "this[this.length]=x");
|
||||
}
|
||||
// add attachEvent function, if required (allows HP5 v6 quizzes to run on ie5mac)
|
||||
// NOTE: to allow v6 quizzes on ie5mac, the following code
|
||||
// NOTE: to allow v6 quizzes on ie5mac, the following code
|
||||
// needs to be inserted BEFORE the Hot Potatoes javascript
|
||||
if (window.attachEvent==null) {
|
||||
window.attachEvent = new Function('evt', 'fn', 'eval("window."+evt+"="+fn)');
|
||||
@ -2534,7 +2534,7 @@ if (navigator.userAgent.indexOf("Netscape6")>=0 && window.ShowMessage) {
|
||||
// JBC uses "QForm" form, which contains elements called "FB_*_**" (* and ** start at 0)
|
||||
// JCloze uses "Cloze" form
|
||||
// JCross writes out "AnswerForm" from a variable called "GetAnswerOpener"
|
||||
// HP5.3: uses "AnswerForm" in "BottomFrame"
|
||||
// HP5.3: uses "AnswerForm" in "BottomFrame"
|
||||
// HP5.5: uses "AnswerForm" in "TopFrame", but it is only there when an answer is being input
|
||||
// JMatch uses "QForm" form, which contains elements called "sel*" (which disappear by the time the quiz is finished)
|
||||
// JMix uses "ButtonForm"
|
||||
@ -2542,14 +2542,14 @@ if (navigator.userAgent.indexOf("Netscape6")>=0 && window.ShowMessage) {
|
||||
// === v6 ===
|
||||
// JBC uses "QForm" form (elements have no name or id)
|
||||
// JCloze uses "Cloze" form (elements have no name or id)
|
||||
// JCross does not use any forms,
|
||||
// JCross does not use any forms,
|
||||
// HP5: has "GridDiv" in "MainDiv"
|
||||
// HP6: has "Clues" table in "MainDiv"
|
||||
// JMatch has "MatchDiv" in "MainDiv"
|
||||
// HP5: uses "QForm" form, which contains elements called "sel*"
|
||||
// HP6: uses "QForm" form, which contains elements called "s*_**"
|
||||
// JMix does not use any forms, but has "SegmentDiv" in "MainDiv"
|
||||
// JQuiz
|
||||
// JQuiz
|
||||
// HP5: uses "QForm" form, which contains an element called "Guess"
|
||||
// HP6: has "Questions" ordered list in "MainDiv"
|
||||
// === v6+ ===
|
||||
@ -2833,7 +2833,7 @@ function hpTimedOut() {
|
||||
}
|
||||
function hpFinished() {
|
||||
// assume false result
|
||||
var x = false;
|
||||
var x = false;
|
||||
var hp = hpVersion();
|
||||
var t = hpQuizType();
|
||||
var v = hpQuizVersion();
|
||||
@ -2962,7 +2962,7 @@ function Finish(quizstatus) {
|
||||
}
|
||||
}
|
||||
// create form to send results
|
||||
if (DB[7] && DB[8] && !is_LMS()) {
|
||||
if (DB[7] && DB[8] && !is_LMS()) {
|
||||
ResultForm = ''
|
||||
+ '<html><body>'
|
||||
+ '<form name="Results" action="" method="post" enctype="x-www-form-encoded">'
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Media plugin filtering
|
||||
//
|
||||
// This filter will replace any links to a media file with
|
||||
//
|
||||
// This filter will replace any links to a media file with
|
||||
// a media plugin that plays that media inline
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
/// This is the filtering function itself. It accepts the
|
||||
/// This is the filtering function itself. It accepts the
|
||||
/// courseid and the text to be filtered (in HTML form).
|
||||
|
||||
function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
@ -36,7 +36,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object> ';
|
||||
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_flv) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.flv\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
||||
|
||||
$replace = '\\0 <object class="mediaplugin flv" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
|
||||
$replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
|
||||
$replace .= ' width="480" height="360" id="flvplayer">';
|
||||
@ -93,7 +93,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object> ';
|
||||
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= '<param name="autoplay" value="false" />';
|
||||
$replace .= '<embed src="\\2.\\3" width="240" height="180" controller="true" autoplay="false"> </embed>';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
@ -168,10 +168,10 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= '<param name="autoplay" value="false" />';
|
||||
$replace .= '<embed src="\\2.avi" width="240" height="180" controller="true" autoplay="false"> </embed>';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_ram) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.ram\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
||||
@ -196,7 +196,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_rpm) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.rpm\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
||||
@ -221,7 +221,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_rm) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.rm\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?PHP
|
||||
<?PHP
|
||||
|
||||
class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
|
||||
@ -6,13 +6,13 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
function hotpot_xml_quiz_template(&$parent) {
|
||||
|
||||
$this->parent = &$parent;
|
||||
|
||||
|
||||
$get_js = optional_param('js', false);
|
||||
$get_css = optional_param('css', false);
|
||||
|
||||
if (!empty($get_css)) {
|
||||
// set $this->css
|
||||
$this->v6_expand_StyleSheet();
|
||||
$this->v6_expand_StyleSheet();
|
||||
|
||||
} else if (!empty($get_js)) {
|
||||
// set $this->js
|
||||
@ -165,7 +165,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
return empty($value) ? '' : ('<h3 class="ExerciseSubtitle">'.$value.'</h3>');
|
||||
}
|
||||
|
||||
// timer
|
||||
// timer
|
||||
|
||||
function v6_expand_Timer() {
|
||||
return $this->int_value('data,timer,include-timer');
|
||||
@ -177,7 +177,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
return $this->parent->xml_value('data,timer,seconds');
|
||||
}
|
||||
|
||||
// send results
|
||||
// send results
|
||||
|
||||
function v6_expand_SendResults() {
|
||||
return $this->parent->xml_value('hotpot-config-file,'.$this->parent->quiztype.',send-email');
|
||||
@ -299,7 +299,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
}
|
||||
function v6_expand_NavLightColor() {
|
||||
$color = $this->parent->xml_value('hotpot-config-file,global,nav-bar-color');
|
||||
return $this->get_halfway_color($color, '#ffffff');
|
||||
return $this->get_halfway_color($color, '#ffffff');
|
||||
}
|
||||
function v6_expand_NavShadeColor() {
|
||||
$color = $this->parent->xml_value('hotpot-config-file,global,nav-bar-color');
|
||||
@ -534,7 +534,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
$value = strtr($value, $ENTITIES);
|
||||
if (preg_match_all($pattern, $value, $matches)) {
|
||||
$chars = array_merge($chars, $matches[0]);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1260,7 +1260,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
$str .= '<p class="QuestionText">'.$question_text.'</p>';
|
||||
|
||||
if (
|
||||
$question_type==HOTPOT_JQUIZ_SHORTANSWER ||
|
||||
$question_type==HOTPOT_JQUIZ_SHORTANSWER ||
|
||||
$question_type==HOTPOT_JQUIZ_HYBRID
|
||||
) {
|
||||
$str .= '<div class="ShortAnswer" id="Q_'.$q.'_SA"><form method="post" action="" onsubmit="return false;"><div>';
|
||||
@ -1283,13 +1283,13 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
}
|
||||
|
||||
if (
|
||||
$question_type==HOTPOT_JQUIZ_MULTICHOICE ||
|
||||
$question_type==HOTPOT_JQUIZ_MULTICHOICE ||
|
||||
$question_type==HOTPOT_JQUIZ_HYBRID ||
|
||||
$question_type==HOTPOT_JQUIZ_MULTISELECT
|
||||
) {
|
||||
|
||||
switch ($question_type) {
|
||||
case HOTPOT_JQUIZ_MULTICHOICE:
|
||||
case HOTPOT_JQUIZ_MULTICHOICE:
|
||||
$str .= '<ol class="MCAnswers">'."\n";
|
||||
break;
|
||||
case HOTPOT_JQUIZ_HYBRID:
|
||||
@ -1456,6 +1456,6 @@ function hotpot_keypad_sort_value($char) {
|
||||
}
|
||||
|
||||
return $sort_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
@ -61,9 +61,9 @@
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
|
@ -6,20 +6,20 @@ 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.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('');
|
||||
}
|
||||
}
|
||||
@ -54,7 +54,7 @@ var AnswersTried = '';
|
||||
FC = new Array();
|
||||
DC = new Array();
|
||||
|
||||
function onEndDrag(){
|
||||
function onEndDrag(){
|
||||
//Is it dropped on any of the fixed cards?
|
||||
var Docked = false;
|
||||
var DropTarget = DroppedOnFixed(CurrDrag);
|
||||
@ -79,7 +79,7 @@ function onEndDrag(){
|
||||
DC[CurrDrag].tag = 0;
|
||||
D[CurrDrag][2] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DroppedOnFixed(DNum){
|
||||
var Result = -1;
|
||||
@ -121,12 +121,12 @@ function StartUp(){
|
||||
if (C.ie){
|
||||
DragTop += 15;
|
||||
}
|
||||
|
||||
|
||||
//Reduce array if required
|
||||
if (QsToShow < F.length){
|
||||
ReduceItems2();
|
||||
}
|
||||
|
||||
|
||||
//Shuffle the left items if required
|
||||
if (ShuffleQs == true){
|
||||
F = Shuffle(F);
|
||||
@ -143,7 +143,7 @@ function StartUp(){
|
||||
for (var i=0; i<F.length; i++){
|
||||
CardContent = F[i][0];
|
||||
FC[i] = new Card('F' + i, 10);
|
||||
FC[i].elm.innerHTML = CardContent;
|
||||
FC[i].elm.innerHTML = CardContent;
|
||||
if (FC[i].GetW() > Widest){
|
||||
Widest = FC[i].GetW();
|
||||
}
|
||||
@ -162,7 +162,7 @@ function StartUp(){
|
||||
DC[i] = new Card('D' + i, 10);
|
||||
CardContent = D[i][0];
|
||||
// if (CardContent.indexOf('<img ') > -1){CardContent += '<br clear="all" />';} //used to be required for Navigator rendering bug with images
|
||||
DC[i].elm.innerHTML = CardContent;
|
||||
DC[i].elm.innerHTML = CardContent;
|
||||
if (DC[i].GetW() > DragWidth){DC[i].SetW(DragWidth);}
|
||||
DC[i].css.cursor = 'move';
|
||||
DC[i].css.backgroundColor = '[strExBGColor]';
|
||||
@ -276,7 +276,7 @@ function ReduceItems2(){
|
||||
}
|
||||
for (j=ItemToDump; j<(D.length-1); j++){
|
||||
D[j] = D[j+1];
|
||||
}
|
||||
}
|
||||
F.length = F.length-1;
|
||||
D.length = D.length-1;
|
||||
}
|
||||
@ -303,7 +303,7 @@ function CheckAnswers(){
|
||||
TotalCorrect++;
|
||||
}
|
||||
else{
|
||||
//Change made for version 6.0.3.41: don't send wrong items home,
|
||||
//Change made for version 6.0.3.41: don't send wrong items home,
|
||||
//show them in a more conspicuous way.
|
||||
// DC[i].GoHome();
|
||||
DC[i].SetL(DC[i].GetL() + 10);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
@ -61,9 +61,9 @@
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
|
||||
<!-- BeginTopNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
|
@ -5,7 +5,7 @@ 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);
|
||||
@ -16,15 +16,15 @@ function SetScormScore(){
|
||||
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('');
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ function GetGuessSequence(){
|
||||
}
|
||||
|
||||
var CardPos = 0;
|
||||
|
||||
|
||||
for (i=0; i<Cds.length; i++){
|
||||
for (var j=0; j<L.length; j++){
|
||||
//Slight modification for 6.0.4: allow some leeway for 1px inaccuracy in card placing by browser.
|
||||
@ -178,7 +178,7 @@ function CompileString(InArray){
|
||||
if ((Openers.indexOf(OutString.charAt(OutString.length-1)) > -1)||(Punctuation.indexOf(OutArray[i].charAt(0)) > -1)){
|
||||
Spacer = '';
|
||||
}
|
||||
OutString = OutString + Spacer + OutArray[i];
|
||||
OutString = OutString + Spacer + OutArray[i];
|
||||
}
|
||||
|
||||
//Capitalize the first letter if necessary
|
||||
@ -234,7 +234,7 @@ function CheckAnswer(CheckType){
|
||||
}
|
||||
HintToReturn = TempHint;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (WhichCorrect > -1){
|
||||
AllDone = true;
|
||||
@ -244,7 +244,7 @@ function CheckAnswer(CheckType){
|
||||
}
|
||||
}
|
||||
WellDone = '<span class="CorrectAnswer">' + CompiledOutput + '</span><br /><br />' + CorrectResponse + '<br />';
|
||||
|
||||
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
AnswersTried += CompiledOutput;
|
||||
|
||||
@ -280,7 +280,7 @@ function CheckAnswer(CheckType){
|
||||
if (CheckType == 1){
|
||||
TryAgain += '<br />' + NextCorrect + '<br />' + FindSegment(HintToReturn);
|
||||
}
|
||||
|
||||
|
||||
[inclTimer]
|
||||
if (TimeOver == true){
|
||||
Score = Math.floor(((LongestCorrect.length-Penalties) * 100)/Segments.length);
|
||||
@ -291,7 +291,7 @@ function CheckAnswer(CheckType){
|
||||
Penalties++; //Penalty for inaccurate check
|
||||
ShowMessage(TryAgain);
|
||||
}
|
||||
|
||||
|
||||
//If the exercise is over, deal with that
|
||||
if ((AllDone == true)||(TimeOver == true)){
|
||||
[inclSendResults]
|
||||
@ -306,7 +306,7 @@ function CheckAnswer(CheckType){
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
|
||||
}
|
||||
|
||||
|
||||
[inclScorm1.2]
|
||||
if (AllDone == true){
|
||||
SetScormComplete();
|
||||
@ -364,7 +364,7 @@ function endDrag(e) {
|
||||
if (CurrDrag == -1) {return};
|
||||
Cds[CurrDrag].SwapColours();
|
||||
if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
|
||||
onEndDrag();
|
||||
onEndDrag();
|
||||
CurrDrag = -1;
|
||||
return true;
|
||||
}
|
||||
@ -430,10 +430,10 @@ function CheckOver(NoMove){
|
||||
Cds[i].SetL(LeftColPos);
|
||||
Cds[i].SetT(Cds[i].GetT() + DropHeight);
|
||||
}
|
||||
CheckOver(i);
|
||||
CheckOver(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
|
@ -16,7 +16,7 @@ var CurrItem = null;
|
||||
var Stage = 2;
|
||||
var QList = new Array();
|
||||
var ShuffleQs = [boolShuffleQs];
|
||||
|
||||
|
||||
function SetUpItems(){
|
||||
|
||||
var i;
|
||||
@ -32,7 +32,7 @@ function SetUpItems(){
|
||||
Row.getElementsByTagName('td')[1].className = 'Hidden';
|
||||
QList.push(Qs.removeChild(Row));
|
||||
}
|
||||
|
||||
|
||||
//Shuffle the rows
|
||||
if (ShuffleQs == true){
|
||||
QList = Shuffle(QList);
|
||||
@ -47,11 +47,11 @@ function SetUpItems(){
|
||||
function StartUp(){
|
||||
|
||||
SetUpItems();
|
||||
|
||||
|
||||
[inclScorm1.2]
|
||||
initAPI(window);
|
||||
if (API != null){
|
||||
API.LMSInitialize('');
|
||||
API.LMSInitialize('');
|
||||
API.LMSSetValue('cmi.core.lesson_status', 'browsed');
|
||||
API.LMSSetValue('cmi.comments', 'This exercise has no checking or scoring features.');
|
||||
API.LMSCommit('');
|
||||
@ -72,7 +72,7 @@ var Started = false;
|
||||
|
||||
function DeleteItem(){
|
||||
if ((CurrItem == null)||(document.getElementById('Questions').getElementsByTagName('tr').length < 1)){return;}
|
||||
|
||||
|
||||
//Delete the current item
|
||||
var DelItem = CurrItem;
|
||||
Stage = 2;
|
||||
@ -89,7 +89,7 @@ function ShowItem(){
|
||||
if (Len < 1){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//if no current item, get the last item so we roll forward
|
||||
if (CurrItem == null){
|
||||
CurrItem = Qs.getElementsByTagName('tr')[Len-1];
|
||||
@ -97,7 +97,7 @@ function ShowItem(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if CurrItem has been fully shown, move to the next one
|
||||
if (Stage == 2){
|
||||
CurrItem.getElementsByTagName('td')[0].className = 'Hidden';
|
||||
@ -109,7 +109,7 @@ function ShowItem(){
|
||||
CurrItem = Qs.getElementsByTagName('tr')[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Show the appropriate bits
|
||||
if (Stage == 2){
|
||||
//Show the first item and hide the second
|
||||
@ -121,9 +121,9 @@ function ShowItem(){
|
||||
//Show both items
|
||||
CurrItem.getElementsByTagName('td')[0].className = 'Showing';
|
||||
CurrItem.getElementsByTagName('td')[1].className = 'Showing';
|
||||
Stage = 2;
|
||||
Stage = 2;
|
||||
}
|
||||
|
||||
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
|
@ -16,7 +16,7 @@ body{
|
||||
font-family: [strFontFace];
|
||||
[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
|
||||
color: [strTextColor];
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
margin-right: 5%;
|
||||
margin-left: 5%;
|
||||
font-size: [strFontSize];
|
||||
@ -73,14 +73,14 @@ div.StdDiv{
|
||||
text-align: right;
|
||||
font-size: 150%;
|
||||
direction: rtl;
|
||||
font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
|
||||
font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
|
||||
}
|
||||
|
||||
.CentredRTLText{
|
||||
text-align: center;
|
||||
font-size: 150%;
|
||||
direction: rtl;
|
||||
font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
|
||||
font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
|
||||
}
|
||||
|
||||
button p.RTLText{
|
||||
@ -531,7 +531,7 @@ div.NavButtonBar{
|
||||
|
||||
.NavButton {
|
||||
border-style: solid;
|
||||
[inclNavBarColor]
|
||||
[inclNavBarColor]
|
||||
border-left-color: [strNavLightColor];
|
||||
border-top-color: [strNavLightColor];
|
||||
border-right-color: [strNavShadeColor];
|
||||
@ -540,7 +540,7 @@ div.NavButtonBar{
|
||||
color: [strNavTextColor];
|
||||
[/inclNavBarColor]
|
||||
border-width: 2px;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.NavButtonUp {
|
||||
@ -554,7 +554,7 @@ div.NavButtonBar{
|
||||
background-color: [strNavTextColor];
|
||||
[/inclNavBarColor]
|
||||
border-width: 2px;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.NavButtonDown {
|
||||
@ -568,7 +568,7 @@ div.NavButtonBar{
|
||||
background-color: [strNavTextColor];
|
||||
[/inclNavBarColor]
|
||||
border-width: 2px;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*EndNavBarStyle*/
|
||||
|
@ -5,7 +5,7 @@ function Client(){
|
||||
|
||||
this.ua = navigator.userAgent;
|
||||
this.name = navigator.appName;
|
||||
this.ver = navigator.appVersion;
|
||||
this.ver = navigator.appVersion;
|
||||
|
||||
//Get data about the browser
|
||||
this.mac = (this.ver.indexOf('Mac') != -1);
|
||||
@ -17,23 +17,23 @@ function Client(){
|
||||
this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
|
||||
if (this.geckoVer < 20020000){this.min = false;}
|
||||
}
|
||||
|
||||
|
||||
//Look for Firebird
|
||||
this.firebird = (this.ua.indexOf('Firebird') > 1);
|
||||
|
||||
|
||||
//Look for Safari
|
||||
this.safari = (this.ua.indexOf('Safari') > 1);
|
||||
if (this.safari){
|
||||
this.gecko = false;
|
||||
}
|
||||
|
||||
|
||||
//Look for IE
|
||||
this.ie = (this.ua.indexOf('MSIE') > 0);
|
||||
if (this.ie){
|
||||
this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
|
||||
if (this.ieVer < 5.5){this.min = false;}
|
||||
}
|
||||
|
||||
|
||||
//Look for Opera
|
||||
this.opera = (this.ua.indexOf('Opera') > 0);
|
||||
if (this.opera){
|
||||
@ -43,7 +43,7 @@ function Client(){
|
||||
if (this.min == false){
|
||||
alert('Your browser may not be able to handle this page.');
|
||||
}
|
||||
|
||||
|
||||
//Special case for the horrible ie5mac
|
||||
this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ function CardOverlap(OtherCard){
|
||||
var lgT=(this.GetT()>OtherCard.GetT())? this.GetT(): OtherCard.GetT();
|
||||
var VDim=smB-lgT;
|
||||
if (VDim<1){return 0;}
|
||||
return (HDim*VDim);
|
||||
return (HDim*VDim);
|
||||
}
|
||||
Card.prototype.Overlap=CardOverlap;
|
||||
|
||||
@ -105,18 +105,18 @@ Card.prototype.GoHome=CardGoHome;
|
||||
function doDrag(e) {
|
||||
if (CurrDrag == -1) {return};
|
||||
if (C.ie){var Ev = window.event}else{var Ev = e}
|
||||
var difX = Ev.clientX-window.lastX;
|
||||
var difY = Ev.clientY-window.lastY;
|
||||
var newX = DC[CurrDrag].GetL()+difX;
|
||||
var newY = DC[CurrDrag].GetT()+difY;
|
||||
DC[CurrDrag].SetL(newX);
|
||||
var difX = Ev.clientX-window.lastX;
|
||||
var difY = Ev.clientY-window.lastY;
|
||||
var newX = DC[CurrDrag].GetL()+difX;
|
||||
var newY = DC[CurrDrag].GetT()+difY;
|
||||
DC[CurrDrag].SetL(newX);
|
||||
DC[CurrDrag].SetT(newY);
|
||||
window.lastX = Ev.clientX;
|
||||
window.lastY = Ev.clientY;
|
||||
window.lastX = Ev.clientX;
|
||||
window.lastY = Ev.clientY;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function beginDrag(e, DragNum) {
|
||||
function beginDrag(e, DragNum) {
|
||||
CurrDrag = DragNum;
|
||||
if (C.ie){
|
||||
var Ev = window.event;
|
||||
@ -125,27 +125,27 @@ function beginDrag(e, DragNum) {
|
||||
}
|
||||
else{
|
||||
var Ev = e;
|
||||
window.onmousemove=doDrag;
|
||||
window.onmousemove=doDrag;
|
||||
window.onmouseup=endDrag;
|
||||
}
|
||||
}
|
||||
DC[CurrDrag].Highlight();
|
||||
topZ++;
|
||||
DC[CurrDrag].css.zIndex = topZ;
|
||||
window.lastX=Ev.clientX;
|
||||
window.lastX=Ev.clientX;
|
||||
window.lastY=Ev.clientY;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function endDrag(e) {
|
||||
function endDrag(e) {
|
||||
if (CurrDrag == -1) {return};
|
||||
DC[CurrDrag].Unhighlight();
|
||||
if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
|
||||
onEndDrag();
|
||||
onEndDrag();
|
||||
CurrDrag = -1;
|
||||
//Need a bugfix for Opera focus problem here
|
||||
if (C.opera){FocusAButton();}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
var CurrDrag = -1;
|
||||
var topZ = 100;
|
||||
|
@ -39,7 +39,7 @@ function CheckGuess(Guess, Answer, CaseSensitive, PercentCorrect, Feedback){
|
||||
}
|
||||
else{
|
||||
this.WorkingGuess = Guess;
|
||||
this.WorkingAnswer = Answer;
|
||||
this.WorkingAnswer = Answer;
|
||||
}
|
||||
this.Hint = '';
|
||||
this.HintPenalty = 1/Answer.length;
|
||||
@ -66,12 +66,12 @@ function CheckGuess_DoCheck(){
|
||||
}
|
||||
//Stash the hint
|
||||
this.Hint = this.Answer.charAt(i);
|
||||
|
||||
|
||||
this.CorrectStart = this.Guess.substring(0, i);
|
||||
|
||||
|
||||
//If there's more to the answer, look at the rest of it
|
||||
if (i<this.Guess.length){
|
||||
|
||||
|
||||
//Figure out how much of the end is correct
|
||||
var j = this.WorkingGuess.length-1;
|
||||
var k = this.WorkingAnswer.length-1;
|
||||
@ -90,7 +90,7 @@ function CheckGuess_DoCheck(){
|
||||
}
|
||||
else{
|
||||
this.PercentMatch = Math.floor((100 * CorrectChars)/this.Guess.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CheckGuess.prototype.DoCheck = CheckGuess_DoCheck;
|
||||
@ -160,13 +160,13 @@ CheckAnswerArray.prototype.GetBestMatch = CheckAnswerArray_GetBestMatch;
|
||||
function CheckShortAnswer(QNum){
|
||||
//bail if question doesn't exist or exercise finished
|
||||
if ((State[QNum].length < 1)||(Finished == true)){return;}
|
||||
|
||||
|
||||
//bail if question already complete
|
||||
if (State[QNum][0] > -1){return;}
|
||||
|
||||
//Get the guess (TrimString added to fix bug for 6.0.4.3)
|
||||
var G = TrimString(document.getElementById('Q_' + QNum + '_Guess').value);
|
||||
|
||||
|
||||
//If no guess, bail with message; no penalty
|
||||
if (G.length < 1){
|
||||
ShowMessage(PleaseEnter);
|
||||
@ -175,7 +175,7 @@ function CheckShortAnswer(QNum){
|
||||
|
||||
//Increment tries
|
||||
State[QNum][2]++;
|
||||
|
||||
|
||||
//Create a check object
|
||||
var CA = new CheckAnswerArray(CaseSensitive);
|
||||
|
||||
@ -184,7 +184,7 @@ function CheckShortAnswer(QNum){
|
||||
CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], I[QNum][3][ANum][1]);
|
||||
}
|
||||
CA.GetBestMatch();
|
||||
|
||||
|
||||
//Store any match in the state tracking field
|
||||
if (State[QNum][5].length > 0){State[QNum][5] += ' | ';}
|
||||
if (CA.MatchNum > -1){
|
||||
@ -198,11 +198,11 @@ function CheckShortAnswer(QNum){
|
||||
//Add the percent correct value for this answer to the Q State (works for all
|
||||
//situations, wrong or right)
|
||||
State[QNum][3] += CA.Score;
|
||||
|
||||
|
||||
//Now branch, based on the nature of the match
|
||||
//Is it a complete match?
|
||||
if (CA.CompleteMatch == true){
|
||||
|
||||
|
||||
//Is it with a wrong answer, or a right answer?
|
||||
if (CA.Score == 100){
|
||||
//It's right
|
||||
@ -213,8 +213,8 @@ function CheckShortAnswer(QNum){
|
||||
if (AlsoCorrectList.length > 0){
|
||||
CA.Feedback += '<br />' + CorrectList + '<br />' + AlsoCorrectList;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Get the overall score and add it to the feedback
|
||||
if (ContinuousScoring == true){
|
||||
CalculateOverallScore();
|
||||
@ -228,14 +228,14 @@ function CheckShortAnswer(QNum){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Otherwise, it's a match to a predicted wrong/partially correct, or a partial
|
||||
//match to a right answer
|
||||
if (CA.Feedback.length < 1){CA.Feedback = DefaultWrong;}
|
||||
//Remove any previous score unless exercise is finished (6.0.3.8+)
|
||||
if (Finished == false){
|
||||
WriteToInstructions(strInstructions);
|
||||
}
|
||||
}
|
||||
ShowMessage(CA.Feedback);
|
||||
|
||||
//If necessary, switch a hybrid question to m/c
|
||||
@ -278,7 +278,7 @@ function GetCorrectArray(QNum){
|
||||
if (I[QNum][3][ANum][2] == 1){ //This is an acceptable correct answer
|
||||
Result.push(I[QNum][3][ANum][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -322,14 +322,14 @@ function ReplaceGuessBox(QNum, Ans){
|
||||
function ShowAnswers(QNum){
|
||||
//bail if question doesn't exist or exercise finished
|
||||
if ((State[QNum].length < 1)||(Finished == true)){return;}
|
||||
|
||||
|
||||
//Get the answer list to display
|
||||
var Ans = GetCorrectList(QNum, '', false);
|
||||
Ans = CorrectList + '<br />' + Ans;
|
||||
|
||||
|
||||
//Display feedback
|
||||
ShowMessage(Ans);
|
||||
|
||||
|
||||
//Set the score for this question to 0 if no
|
||||
if (State[QNum][0] < 1){
|
||||
State[QNum][0] = 0;
|
||||
@ -337,13 +337,13 @@ function ShowAnswers(QNum){
|
||||
|
||||
//Get the first correct answer
|
||||
var FirstAns = GetFirstCorrectAnswer(QNum);
|
||||
|
||||
|
||||
//Replace the textbox
|
||||
ReplaceGuessBox(QNum, FirstAns);
|
||||
|
||||
|
||||
//Remove any current score
|
||||
WriteToInstructions(strInstructions);
|
||||
|
||||
|
||||
//This may be the last, so check finished status
|
||||
CheckFinished();
|
||||
}
|
||||
@ -355,13 +355,13 @@ function ShowAnswers(QNum){
|
||||
function ShowHint(QNum){
|
||||
//bail if question doesn't exist or exercise finished
|
||||
if ((State[QNum].length < 1)||(Finished == true)){return;}
|
||||
|
||||
|
||||
//bail if question already complete
|
||||
if (State[QNum][0] > -1){return;}
|
||||
|
||||
//Get the guess
|
||||
var G = document.getElementById('Q_' + QNum + '_Guess').value;
|
||||
|
||||
|
||||
//If no guess, give the first correct bit
|
||||
if (G.length < 1){
|
||||
var Ans = GetFirstCorrectAnswer(QNum);
|
||||
@ -374,7 +374,7 @@ function ShowHint(QNum){
|
||||
|
||||
//Increment tries
|
||||
State[QNum][2]++;
|
||||
|
||||
|
||||
//Create a check object
|
||||
var CA = new CheckAnswerArray(CaseSensitive);
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<param name="type" value="audio/x-pn-realaudio-plugin" />
|
||||
<param name="src" value="[strFilePath]" />
|
||||
<param name="autostart" value="false" />
|
||||
<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
|
||||
<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
|
||||
[strContent]</object>[/Real 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]
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xml:lang="en"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
Page Title
|
||||
@ -31,7 +31,7 @@ Page Title
|
||||
</div>
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
|
||||
<p>Page content...</p>
|
||||
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@ function ShowMessage(Feedback){
|
||||
|
||||
//Focus the OK button
|
||||
setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
|
||||
|
||||
|
||||
//[inclPreloadImages]
|
||||
// RefreshImages();
|
||||
//[/inclPreloadImages]
|
||||
@ -54,7 +54,7 @@ function ShowElements(Show, TagName, ContainerToReverse){
|
||||
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
|
||||
|
@ -57,13 +57,13 @@ function GetViewportHeight(){
|
||||
|
||||
function TopSettingWithScrollOffset(TopPercent){
|
||||
var T = Math.floor(GetViewportHeight() * (TopPercent/100));
|
||||
return GetScrollTop() + T;
|
||||
return GetScrollTop() + T;
|
||||
}
|
||||
|
||||
//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
|
||||
var InTextBox = false;
|
||||
|
||||
function SuppressBackspace(e){
|
||||
function SuppressBackspace(e){
|
||||
if (InTextBox == true){return;}
|
||||
if (C.ie) {
|
||||
thisKey = window.event.keyCode;
|
||||
@ -80,7 +80,7 @@ function SuppressBackspace(e){
|
||||
|
||||
if (Suppress == true){
|
||||
if (C.ie){
|
||||
window.event.returnValue = false;
|
||||
window.event.returnValue = false;
|
||||
window.event.cancelBubble = true;
|
||||
}
|
||||
else{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
@ -120,7 +120,7 @@
|
||||
[/inclHint]
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<div id="ClozeDiv">
|
||||
<form id="Cloze" method="post" action="" onsubmit="return false;">
|
||||
<div class="ClozeBody">
|
||||
|
@ -9,7 +9,7 @@ function SetScormScore(){
|
||||
//Now send detailed reports about each item
|
||||
for (var i=0; i<State.length; i++){
|
||||
var ThisItemGuesses = '';
|
||||
var GapLabel = 'Gap_' + (i+1).toString();
|
||||
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);
|
||||
@ -24,11 +24,11 @@ function SetScormScore(){
|
||||
}
|
||||
for (var j=0; j<State[i].Guesses.length; j++){
|
||||
if (j>0){ThisItemGuesses += ' | ';}
|
||||
ThisItemGuesses += State[i].Guesses[j];
|
||||
}
|
||||
ThisItemGuesses += State[i].Guesses[j];
|
||||
}
|
||||
API.LMSSetValue('cmi.interactions.' + i + '.type', 'fill-in');
|
||||
API.LMSSetValue('cmi.interactions.' + i + '.student_response', ThisItemGuesses);
|
||||
}
|
||||
}
|
||||
API.LMSCommit('');
|
||||
}
|
||||
}
|
||||
@ -48,7 +48,7 @@ function ItemState(){
|
||||
|
||||
var Feedback = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var CaseSensitive = [boolCaseSensitive];
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
@ -70,7 +70,7 @@ function StartUp(){
|
||||
if (document.getElementById('CharacterKeypad') != null){
|
||||
document.getElementById('CharacterKeypad').style.display = 'block';
|
||||
}
|
||||
|
||||
|
||||
[inclScorm1.2]
|
||||
ScormStartUp();
|
||||
[/inclScorm1.2]
|
||||
@ -89,9 +89,9 @@ function StartUp(){
|
||||
for (i=0; i<I.length; i++){
|
||||
State[i] = new ItemState();
|
||||
}
|
||||
|
||||
|
||||
ClearTextBoxes();
|
||||
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
@ -126,8 +126,8 @@ function CompileGuesses(){
|
||||
Temp += '<fieldlabelid>JClozeStudentResponses</fieldlabelid><fielddata>';
|
||||
for (var j=0; j<State[i].Guesses.length; j++){
|
||||
if (j>0){Temp += '| ';}
|
||||
Temp += State[i].Guesses[j] + ' ';
|
||||
}
|
||||
Temp += State[i].Guesses[j] + ' ';
|
||||
}
|
||||
Temp += '</fielddata></field>';
|
||||
}
|
||||
Temp += '</fields></hpnetresult>';
|
||||
@ -184,12 +184,12 @@ function CheckAnswers(){
|
||||
}
|
||||
ShowMessage(Output);
|
||||
setTimeout('WriteToInstructions(Output)', 50);
|
||||
|
||||
|
||||
Score = TotalScore;
|
||||
CompileGuesses();
|
||||
|
||||
|
||||
if ((AllCorrect == true)||(Finished == true)){
|
||||
|
||||
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + TotalScore + ')', 50);
|
||||
[/inclSendResults]
|
||||
@ -282,7 +282,7 @@ function FindCurrent() {
|
||||
return CurrentWord;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
x=CurrentWord + 1;
|
||||
while (x<I.length){
|
||||
if (State[x].AnsweredCorrectly == false){
|
||||
@ -290,7 +290,7 @@ function FindCurrent() {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
x++;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
@ -300,7 +300,7 @@ function FindCurrent() {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
x++;
|
||||
}
|
||||
return FoundCurrent;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
@ -120,7 +120,7 @@
|
||||
<button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<table class="CrosswordGrid">
|
||||
<tbody>
|
||||
|
||||
|
@ -5,7 +5,7 @@ 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);
|
||||
@ -15,13 +15,13 @@ function SetScormScore(){
|
||||
}
|
||||
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('');
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,7 @@ var Feedback = '';
|
||||
var AcrossCaption = '';
|
||||
var DownCaption = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var BuiltGrid = '';
|
||||
@ -45,7 +45,7 @@ var Score = 0;
|
||||
var InTextBox = false;
|
||||
var Locked = false;
|
||||
var TimeOver = false;
|
||||
var CaseSensitive = [boolCaseSensitive];
|
||||
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>';
|
||||
@ -65,7 +65,7 @@ function StartUp(){
|
||||
[inclScorm1.2]
|
||||
ScormStartUp();
|
||||
[/inclScorm1.2]
|
||||
|
||||
|
||||
AcrossCaption = document.getElementById('CluesAcrossLabel').innerHTML;
|
||||
DownCaption = document.getElementById('CluesDownLabel').innerHTML;
|
||||
[inclSendResults]
|
||||
@ -88,14 +88,14 @@ function GetAnswerLength(Across,x,y){
|
||||
while ((x<L.length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
x++;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
else{
|
||||
while ((y<L[x].length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
@ -165,7 +165,7 @@ function SplitStringToPerceivedChars(InString, PC){
|
||||
function EnterAnswer(Guess,Across,AnsLength,x,y){
|
||||
var PC = new Array();
|
||||
SplitStringToPerceivedChars(Guess, PC);
|
||||
|
||||
|
||||
var i=x;
|
||||
var j=y;
|
||||
var Letter = 0;
|
||||
@ -269,9 +269,9 @@ function CheckAnswers(){
|
||||
var AllCorrect = true;
|
||||
var TotLetters = 0;
|
||||
var CorrectLetters = 0;
|
||||
var LetterFromKey = '';
|
||||
var LetterFromKey = '';
|
||||
var LetterFromGuess = '';
|
||||
|
||||
|
||||
//Check each letter
|
||||
for (var i=0; i<L.length; i++){
|
||||
for (var j=0; j<L[i].length; j++){
|
||||
@ -285,7 +285,7 @@ function CheckAnswers(){
|
||||
LetterFromKey = L[i][j].toUpperCase();
|
||||
LetterFromGuess = G[i][j].toUpperCase();
|
||||
}
|
||||
if (LetterFromGuess != LetterFromKey){
|
||||
if (LetterFromGuess != LetterFromKey){
|
||||
G[i][j] = '';
|
||||
//Blank that square in the grid
|
||||
SetGridSquareValue(i,j,'');
|
||||
@ -316,7 +316,7 @@ function CheckAnswers(){
|
||||
|
||||
ShowMessage(Output);
|
||||
WriteToInstructions(Output);
|
||||
|
||||
|
||||
if ((AllCorrect == true)||(TimeOver == true)){
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + Score + ')', 50);
|
||||
|
@ -3,7 +3,7 @@
|
||||
xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
|
||||
<title></title>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
|
@ -6,18 +6,18 @@ 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.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 += ' | ';}
|
||||
@ -57,7 +57,7 @@ function StartUp(){
|
||||
[inclScorm1.2]
|
||||
ScormStartUp();
|
||||
[/inclScorm1.2]
|
||||
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
@ -134,7 +134,7 @@ function SetUpItems(ShuffleQs, ReduceTo){
|
||||
|
||||
//Remove all the table rows and put them in an array for processing
|
||||
var Qs = document.getElementById('Questions');
|
||||
|
||||
|
||||
//First, get a list of keys
|
||||
GetUniqueKeys(Qs, OriginalKeys);
|
||||
|
||||
@ -144,12 +144,12 @@ function SetUpItems(ShuffleQs, ReduceTo){
|
||||
}
|
||||
|
||||
var Reducing = (QList.length > ReduceTo);
|
||||
|
||||
|
||||
//If required, select random rows to delete
|
||||
if (Reducing == true){
|
||||
var DumpItem = 0;
|
||||
while (ReduceTo < QList.length){
|
||||
|
||||
|
||||
//Get a number to delete from the array
|
||||
DumpItem = Math.floor(QList.length*Math.random());
|
||||
for (i=DumpItem; i<(QList.length-1); i++){
|
||||
@ -164,16 +164,16 @@ function SetUpItems(ShuffleQs, ReduceTo){
|
||||
}
|
||||
|
||||
TotalUnfixedLeftItems = QList.length;
|
||||
|
||||
|
||||
//Write the rows back to the table body
|
||||
for (i=0; i<QList.length; i++){
|
||||
Qs.appendChild(QList[i]);
|
||||
}
|
||||
|
||||
|
||||
//Now we need to remove any drop-down options that no longer have associated select items
|
||||
if (Reducing == true){
|
||||
GetUniqueKeys(Qs, ReducedKeys);
|
||||
|
||||
|
||||
Selects = Qs.getElementsByTagName('select');
|
||||
for (i=0; i<Selects.length; i++){
|
||||
Options = Selects[i].getElementsByTagName('option');
|
||||
@ -209,22 +209,22 @@ function CheckAnswers(){
|
||||
var AnsText = '';
|
||||
var AllDone = true;
|
||||
TotCorrectChoices = 0;
|
||||
|
||||
|
||||
//for each item not fixed or a distractor
|
||||
for (var i=0; i<Status.length; i++){
|
||||
|
||||
|
||||
//if it hasn't been answered correctly yet
|
||||
if (Status[i][0] < 1){
|
||||
|
||||
|
||||
//Add one to the number of tries for this item
|
||||
Status[i][1]++;
|
||||
|
||||
|
||||
//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){
|
||||
Status[i][0] = 1;
|
||||
@ -233,7 +233,7 @@ function CheckAnswers(){
|
||||
Parent.removeChild(Select);
|
||||
Parent.innerHTML = AnsText;
|
||||
Parent.nextSibling.innerHTML = CorrectIndicator;
|
||||
}
|
||||
}
|
||||
else{
|
||||
AllDone = false;
|
||||
Parent = Select.parentNode;
|
||||
@ -281,7 +281,7 @@ function CheckAnswers(){
|
||||
|
||||
//Show the feedback
|
||||
ShowMessage(Feedback);
|
||||
|
||||
|
||||
[inclScorm1.2]
|
||||
if (AllDone == true){
|
||||
SetScormComplete();
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
|
@ -5,7 +5,7 @@ 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);
|
||||
@ -16,14 +16,14 @@ function SetScormScore(){
|
||||
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('');
|
||||
}
|
||||
}
|
||||
@ -135,7 +135,7 @@ function BuildCurrGuess(){
|
||||
RemainingList += Segments[i][0] + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//now concatenate the segments, adding spaces where appropriate;
|
||||
Output = CompileString(GuessSequence);
|
||||
}
|
||||
@ -162,7 +162,7 @@ function CompileString(InArray){
|
||||
if ((Openers.indexOf(OutString.charAt(OutString.length-1)) > -1)||(Punctuation.indexOf(OutArray[i].charAt(0)) > -1)){
|
||||
Spacer = '';
|
||||
}
|
||||
OutString = OutString + Spacer + OutArray[i];
|
||||
OutString = OutString + Spacer + OutArray[i];
|
||||
}
|
||||
|
||||
//Capitalize the first letter if necessary
|
||||
@ -228,7 +228,7 @@ function CheckAnswer(CheckType){
|
||||
}
|
||||
HintToReturn = TempHint;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (WhichCorrect > -1){
|
||||
AllDone = true;
|
||||
@ -242,7 +242,7 @@ function CheckAnswer(CheckType){
|
||||
|
||||
if (AnswersTried.length > 0){AnswersTried += ' | ';}
|
||||
AnswersTried += Output;
|
||||
|
||||
|
||||
//Do score calculation here
|
||||
Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length);
|
||||
WellDone += YourScoreIs + ' ' + Score + '%.<br />';
|
||||
@ -289,7 +289,7 @@ function CheckAnswer(CheckType){
|
||||
DisplayExercise(Exercise);
|
||||
ShowMessage(TryAgain);
|
||||
Penalties++; //Penalty for inaccurate check
|
||||
|
||||
|
||||
[inclTimer]
|
||||
if (TimeOver == true){
|
||||
Score = Math.floor(((LongestCorrect.length-Penalties) * 100)/Segments.length);
|
||||
@ -339,7 +339,7 @@ function StartUp(){
|
||||
|
||||
//Stash the instructions so they can be redisplayed
|
||||
strInstructions = document.getElementById('InstructionsDiv').innerHTML;
|
||||
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
@ -356,8 +356,8 @@ function StartUp(){
|
||||
|
||||
//Build and show the exercise
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
|
||||
DisplayExercise(Exercise);
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
[strDublinCoreMetadata]
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainTitle]
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
|
||||
<div id="QNav" class="QuestionNavigation">
|
||||
|
||||
<p style="text-align: right;">
|
||||
@ -126,7 +126,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
[strQuestionOutput]
|
||||
|
||||
[inclKeypad]
|
||||
|
@ -32,7 +32,7 @@ function SetScormScore(){
|
||||
API.LMSSetValue('cmi.interactions.' + i + '.student_response', State[i][5]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
API.LMSCommit('');
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ function CompleteEmptyFeedback(){
|
||||
}
|
||||
|
||||
function SetUpQuestions(){
|
||||
var AList = new Array();
|
||||
var AList = new Array();
|
||||
var QList = new Array();
|
||||
var i, j;
|
||||
Qs = document.getElementById('Questions');
|
||||
@ -126,7 +126,7 @@ function SetUpQuestions(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<QList.length; i++){
|
||||
Qs.appendChild(QList[i]);
|
||||
QArray[QArray.length] = QList[i];
|
||||
@ -134,13 +134,13 @@ function SetUpQuestions(){
|
||||
|
||||
//Show the first item
|
||||
QArray[0].style.display = '';
|
||||
|
||||
|
||||
//Now hide all except the first item
|
||||
for (i=1; i<QArray.length; i++){
|
||||
QArray[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
SetQNumReadout();
|
||||
|
||||
|
||||
SetFocusToTextbox();
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ function SetFocusToTextbox(){
|
||||
}
|
||||
else{
|
||||
if (QArray[CurrQNum].getElementsByTagName('textarea')[0] != null){
|
||||
QArray[CurrQNum].getElementsByTagName('textarea')[0].focus();
|
||||
QArray[CurrQNum].getElementsByTagName('textarea')[0].focus();
|
||||
//and show a keypad if there is one
|
||||
if (document.getElementById('CharacterKeypad') != null){
|
||||
document.getElementById('CharacterKeypad').style.display = 'block';
|
||||
@ -172,7 +172,7 @@ function SetFocusToTextbox(){
|
||||
|
||||
function ChangeQ(ChangeBy){
|
||||
//The following line prevents moving to another question until the current
|
||||
//question is answered correctly. Uncomment it to enable this behaviour.
|
||||
//question is answered correctly. Uncomment it to enable this behaviour.
|
||||
// if (State[CurrQNum][0] == -1){return;}
|
||||
if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
|
||||
QArray[CurrQNum].style.display = 'none';
|
||||
@ -204,7 +204,7 @@ function ShowSpecialReadingForQuestion(){
|
||||
document.getElementById('ShowMethodButton').style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -242,32 +242,32 @@ function StartUp(){
|
||||
if (QsToShow < 2){
|
||||
document.getElementById('QNav').style.display = 'none';
|
||||
}
|
||||
|
||||
|
||||
//Stash the instructions so they can be redisplayed
|
||||
strInstructions = document.getElementById('InstructionsDiv').innerHTML;
|
||||
|
||||
|
||||
[inclScorm1.2]
|
||||
ScormStartUp();
|
||||
[/inclScorm1.2]
|
||||
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
|
||||
CompleteEmptyFeedback();
|
||||
|
||||
SetUpQuestions();
|
||||
ClearTextBoxes();
|
||||
CreateStatusArray();
|
||||
|
||||
|
||||
[inclTimer]
|
||||
setTimeout('StartTimer()', 50);
|
||||
[/inclTimer]
|
||||
|
||||
|
||||
//Check search string for q parameter
|
||||
if (document.location.search.length > 0){
|
||||
if (ShuffleQs == false){
|
||||
@ -302,7 +302,7 @@ function ShowHideQuestions(){
|
||||
document.getElementById('Questions').style.listStyleType = 'none';
|
||||
document.getElementById('OneByOneReadout').style.display = '';
|
||||
document.getElementById('ShowMethodButton').innerHTML = ShowAllQuestionsCaption;
|
||||
ShowingAllQuestions = false;
|
||||
ShowingAllQuestions = false;
|
||||
}
|
||||
document.getElementById('ShowMethodButton').style.display = 'inline';
|
||||
}
|
||||
@ -335,10 +335,10 @@ function CreateStatusArray(){
|
||||
function CheckMCAnswer(QNum, ANum, Btn){
|
||||
//if question doesn't exist, bail
|
||||
if (State[QNum].length < 1){return;}
|
||||
|
||||
|
||||
//Get the feedback
|
||||
Feedback = I[QNum][3][ANum][1];
|
||||
|
||||
|
||||
//Now show feedback and bail if question already complete
|
||||
if (State[QNum][0] > -1){
|
||||
//Add an extra message explaining that the question
|
||||
@ -348,40 +348,40 @@ function CheckMCAnswer(QNum, ANum, Btn){
|
||||
ShowMessage(Feedback);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Hide the button while processing
|
||||
Btn.style.display = 'none';
|
||||
|
||||
//Increment the number of tries
|
||||
State[QNum][2]++;
|
||||
|
||||
|
||||
//Add the percent-correct value of this answer
|
||||
State[QNum][3] += I[QNum][3][ANum][3];
|
||||
|
||||
|
||||
//Store the try number in the answer part of the State array, for tracking purposes
|
||||
State[QNum][1][ANum] = State[QNum][2];
|
||||
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){
|
||||
//It's wrong
|
||||
|
||||
//Mark the answer
|
||||
Btn.innerHTML = IncorrectIndicator;
|
||||
|
||||
|
||||
//Remove any previous score unless exercise is finished (6.0.3.8+)
|
||||
if (Finished == false){
|
||||
WriteToInstructions(strInstructions);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Check whether this leaves just one MC answer unselected, in which case the Q is terminated
|
||||
var RemainingAnswer = FinalAnswer(QNum);
|
||||
if (RemainingAnswer > -1){
|
||||
//Behave as if the last answer had been selected, but give no credit for it
|
||||
//Increment the number of tries
|
||||
State[QNum][2]++;
|
||||
|
||||
State[QNum][2]++;
|
||||
|
||||
//Calculate the score for this question
|
||||
CalculateMCQuestionScore(QNum);
|
||||
|
||||
@ -397,7 +397,7 @@ function CheckMCAnswer(QNum, ANum, Btn){
|
||||
//It's right
|
||||
//Mark the answer
|
||||
Btn.innerHTML = CorrectIndicator;
|
||||
|
||||
|
||||
//Calculate the score for this question
|
||||
CalculateMCQuestionScore(QNum);
|
||||
|
||||
@ -410,13 +410,13 @@ function CheckMCAnswer(QNum, ANum, Btn){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Show the button again
|
||||
Btn.style.display = 'inline';
|
||||
|
||||
//Finally, show the feedback
|
||||
|
||||
//Finally, show the feedback
|
||||
ShowMessage(Feedback);
|
||||
|
||||
|
||||
//Check whether all questions are now done
|
||||
CheckFinished();
|
||||
}
|
||||
@ -426,7 +426,7 @@ function CalculateMCQuestionScore(QNum){
|
||||
var PercentCorrect = State[QNum][3];
|
||||
var TotAns = GetTotalMCAnswers(QNum);
|
||||
var HintPenalties = State[QNum][4];
|
||||
|
||||
|
||||
//Make sure it's not already complete
|
||||
|
||||
if (State[QNum][0] < 0){
|
||||
@ -489,11 +489,11 @@ function CheckMultiSelAnswer(QNum){
|
||||
|
||||
//Increment the tries for this question
|
||||
State[QNum][2]++;
|
||||
|
||||
|
||||
var ShouldBeChecked;
|
||||
var Matches = 0;
|
||||
if (State[QNum][5].length > 0){State[QNum][5] += ' | ';}
|
||||
|
||||
|
||||
//Check if there are any mismatches
|
||||
Feedback = '';
|
||||
var CheckBox = null;
|
||||
@ -530,12 +530,12 @@ function CheckMultiSelAnswer(QNum){
|
||||
//It's wrong -- Remove any previous score unless exercise is finished (6.0.3.8+)
|
||||
if (Finished == false){
|
||||
WriteToInstructions(strInstructions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Show the feedback
|
||||
ShowMessage(Feedback);
|
||||
|
||||
|
||||
//Check whether all questions are now done
|
||||
CheckFinished();
|
||||
}
|
||||
@ -543,7 +543,7 @@ function CheckMultiSelAnswer(QNum){
|
||||
function CalculateMultiSelQuestionScore(QNum){
|
||||
var Tries = State[QNum][2];
|
||||
var TotAns = State[QNum][1].length;
|
||||
|
||||
|
||||
//Make sure it's not already complete
|
||||
if (State[QNum][0] < 0){
|
||||
State[QNum][0] = (TotAns - (Tries-1)) / TotAns;
|
||||
@ -558,7 +558,7 @@ function CalculateMultiSelQuestionScore(QNum){
|
||||
function CalculateOverallScore(){
|
||||
var TotalWeighting = 0;
|
||||
var TotalScore = 0;
|
||||
|
||||
|
||||
for (var QNum=0; QNum<State.length; QNum++){
|
||||
if (State[QNum] != null){
|
||||
if (State[QNum][0] > -1){
|
||||
@ -571,9 +571,9 @@ function CalculateOverallScore(){
|
||||
Score = Math.floor((TotalScore/TotalWeighting)*100);
|
||||
}
|
||||
else{
|
||||
//if TotalWeighting is 0, no questions so far have any value, so
|
||||
//if TotalWeighting is 0, no questions so far have any value, so
|
||||
//no penalty should be shown.
|
||||
Score = 100;
|
||||
Score = 100;
|
||||
}
|
||||
}
|
||||
|
||||
@ -588,7 +588,7 @@ function CheckFinished(){
|
||||
}
|
||||
}
|
||||
if (AllDone == true){
|
||||
|
||||
|
||||
//Report final score and submit if necessary
|
||||
CalculateOverallScore();
|
||||
FB = YourScoreIs + ' ' + Score + '%.';
|
||||
@ -604,7 +604,7 @@ function CheckFinished(){
|
||||
FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + QsToShow;
|
||||
}
|
||||
WriteToInstructions(FB);
|
||||
|
||||
|
||||
Finished == true;
|
||||
[inclTimer]
|
||||
window.clearInterval(Interval);
|
||||
@ -621,7 +621,7 @@ function CheckFinished(){
|
||||
|
||||
TimeOver = true;
|
||||
Locked = true;
|
||||
|
||||
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + Score + ')', 50);
|
||||
[/inclSendResults]
|
||||
@ -654,7 +654,7 @@ function TimesUp(){
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
ShowMessage('[strTimesUp]');
|
||||
|
||||
|
||||
//Set all remaining scores to 0
|
||||
for (var QNum=0; QNum<State.length; QNum++){
|
||||
if (State[QNum] != null){
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xml:lang="en"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
|
||||
<title>
|
||||
[strPlainIndexTitle]
|
||||
@ -21,7 +21,7 @@ body{
|
||||
font-family: [strFontFace];
|
||||
[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
|
||||
color: [strTextColor];
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: [strFontSize];
|
||||
|
Loading…
x
Reference in New Issue
Block a user