merge changes from HotPot moodle 1.9
This commit is contained in:
@@ -16,7 +16,7 @@ This is v2.4.2 of the HotPot module for Moodle 1.9
|
||||
This software is provided "AS IS" without a warranty of any kind.
|
||||
|
||||
Sponsors who have generously contributed to the development of this software:
|
||||
- Agencia de Gestio d'Ajuts Universitaris i de Recerca (AGAUR),
|
||||
- Agencia de Gestio d'Ajuts Universitaris i de Recerca (AGAUR),
|
||||
Autonomous Government of Catalonia, Spain
|
||||
(via Josep M. Fontana, Universitat Pompeu Fabra)
|
||||
- Rikkyo Univeristy, Japan (via Paul Allum)
|
||||
@@ -33,9 +33,9 @@ IMPORTANT NOTICE
|
||||
TO INSTALL OR UPDATE THE HOTPOT MODULE
|
||||
======================================
|
||||
|
||||
You should install only this module by installing a complete Moodle 1.9 package.
|
||||
You should install only this module by installing a complete Moodle 1.9 package.
|
||||
|
||||
Similarly, the recommended way to upgrade this module is to upgrade to a complete Moodle 1.8 package.
|
||||
Similarly, the recommended way to upgrade this module is to upgrade to a complete Moodle 1.8 package.
|
||||
|
||||
However, it is possible to download and unzip a complete Moodle 1.9 package and extract the "mod/hotpot" folder for use on your live Moodle 1.8 site.
|
||||
|
||||
@@ -53,7 +53,7 @@ TO USE THE HOTPOT MODULE
|
||||
|
||||
5. On the main page for the Moodle course, confirm editing is turned on (click the "Turn editing on" button), then, in the section where you want to add the HotPot activity, select "Hot Potatoes Quiz" on the "Add an activity" drop-down menu .
|
||||
|
||||
If "Hot Potatoes Quiz" does not appear on the "Add an activity" menu, you may need to enable the HotPot module as follows:
|
||||
If "Hot Potatoes Quiz" does not appear on the "Add an activity" menu, you may need to enable the HotPot module as follows:
|
||||
|
||||
a) from the site's front page select "Admin" then "Modules"
|
||||
b) click the "closed eye" icon for the "Hot Potatoes Quiz" module
|
||||
@@ -75,9 +75,9 @@ HOT POTATOES CONDITIONS OF USE
|
||||
** Reproduced from the Hot Potatoes site **
|
||||
|
||||
Hot Potatoes is offered free to the educational community by the University of Victoria Humanities Computing and Media Centre (formerly the Language Centre), under certain conditions. Hot Potatoes is free for use by state educational institutions which are non-profit making, on the condition that the material produced using the program is freely available to anyone via the WWW. However, you need to purchase a licence under any of the following conditions:
|
||||
* You do not work for a public sector educational establishment.
|
||||
* You charge money for access to the material you make with Hot Potatoes.
|
||||
* You restrict access to the material in some way. (The only exception here is if you have an account on www.hotpot.net, where you ARE allowed to use password restrictions.)
|
||||
* You do not work for a public sector educational establishment.
|
||||
* You charge money for access to the material you make with Hot Potatoes.
|
||||
* You restrict access to the material in some way. (The only exception here is if you have an account on www.hotpot.net, where you ARE allowed to use password restrictions.)
|
||||
* You want to use the Masher program included with the Hot Potatoes suite.
|
||||
|
||||
For more information on licences, and details on how to purchase one, check out our Website at:
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
// This file replaces:
|
||||
// * STATEMENTS section in db/install.xml
|
||||
// * lib.php/modulename_install() post installation hook
|
||||
// * partially defaults.php
|
||||
|
||||
function xmldb_hotpot_install() {
|
||||
global $DB;
|
||||
|
||||
/// Disable it by default
|
||||
$DB->set_field('modules', 'visible', 0, array('name'=>'hotpot'));
|
||||
|
||||
/// Install logging support here
|
||||
|
||||
|
||||
}
|
||||
@@ -29,5 +29,3 @@ function xmldb_hotpot_upgrade($oldversion) {
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+78
-87
@@ -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. [email protected]
|
||||
}
|
||||
// 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,7 +1076,7 @@ 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) {
|
||||
@@ -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,11 +1592,11 @@ 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 ii_max = I[i][1].length;
|
||||
@@ -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');
|
||||
@@ -2317,7 +2317,7 @@ function hpInterceptHints() {
|
||||
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();
|
||||
@@ -2922,23 +2922,14 @@ hpInterceptClues();
|
||||
hpInterceptChecks();
|
||||
function hpFindForm(formname, w) {
|
||||
if (w==null) w = self;
|
||||
var f = w.document.getElementById(formname);
|
||||
if (f) {
|
||||
return f;
|
||||
}
|
||||
var f = w.document.forms[formname];
|
||||
if (f) {
|
||||
return f;
|
||||
}
|
||||
if (w.frames) {
|
||||
var f = w.document.forms[formname];
|
||||
if (f==null && w.frames) {
|
||||
for (var i=0; i<w.frames.length; i++) {
|
||||
var f = hpFindForm(formname, w.frames[i]);
|
||||
if (f) {
|
||||
return f;
|
||||
}
|
||||
f = hpFindForm(formname, w.frames[i]);
|
||||
if (f) break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return f;
|
||||
}
|
||||
function Finish(quizstatus) {
|
||||
var mark = hpScore();
|
||||
@@ -2971,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">'
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
print '</ul>';
|
||||
}
|
||||
print ''
|
||||
<<<<<<< index.php
|
||||
. '<div class="mdl-align"><table border="0"><tr><td>'
|
||||
. '<form target="_parent" method="post" action="index.php">'
|
||||
. '<input type="hidden" name="id" value="'.$course->id.'" />'
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -181,7 +181,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= '<param name="controls" value="imagewindow" />';
|
||||
$replace .= '<param name="console" value="video" />';
|
||||
$replace .= '<param name="loop" value="true" />';
|
||||
$replace .= '<embed src="\\2.ram" width="240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '<embed src="\\2.ram" width=240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -206,7 +206,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= '<param name="controls" value="imagewindow" />';
|
||||
$replace .= '<param name="console" value="video" />';
|
||||
$replace .= '<param name="loop" value="true" />';
|
||||
$replace .= '<embed src="\\2.rpm" width="240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '<embed src="\\2.rpm" width=240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -231,7 +231,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
|
||||
$replace .= '<param name="controls" value="imagewindow" />';
|
||||
$replace .= '<param name="console" value="video" />';
|
||||
$replace .= '<param name="loop" value="true" />';
|
||||
$replace .= '<embed src="\\2.rm" width="240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '<embed src="\\2.rm" width=240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
|
||||
|
||||
+57
-111
@@ -1,21 +1,18 @@
|
||||
<?PHP
|
||||
<?PHP
|
||||
|
||||
class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
// left and right items for JMatch
|
||||
var $l_items = array();
|
||||
var $r_items = array();
|
||||
|
||||
// constructor function for this class
|
||||
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
|
||||
@@ -48,12 +45,6 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
if (!empty($pattern)) {
|
||||
$this->expand_strings('html', $pattern);
|
||||
}
|
||||
// fix doctype (convert short dtd to long dtd)
|
||||
$this->html = preg_replace(
|
||||
'/<!DOCTYPE[^>]*>/',
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
|
||||
$this->html, 1
|
||||
);
|
||||
}
|
||||
|
||||
// captions and messages
|
||||
@@ -74,7 +65,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
return $this->int_value('hotpot-config-file,global,include-back');
|
||||
}
|
||||
function v6_expand_BackCaption() {
|
||||
return str_replace('<=', '<=', $this->parent->xml_value('hotpot-config-file,global,back-caption'));
|
||||
return $this->parent->xml_value('hotpot-config-file,global,back-caption');
|
||||
}
|
||||
function v6_expand_ClickToAdd() {
|
||||
return $this->parent->xml_value('hotpot-config-file,'.$this->parent->quiztype.',click-to-add');
|
||||
@@ -121,7 +112,8 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
return $this->int_value('hotpot-config-file,global,include-next-ex');
|
||||
}
|
||||
function v6_expand_NextExCaption() {
|
||||
return str_replace('=>', '=>', $this->parent->xml_value('hotpot-config-file,global,next-ex-caption'));
|
||||
$caption = $this->parent->xml_value('hotpot-config-file,global,next-ex-caption');
|
||||
return ($caption=='=>' ? '=>' : $caption);
|
||||
}
|
||||
function v6_expand_NextQCaption() {
|
||||
return $this->parent->xml_value('hotpot-config-file,global,next-q-caption');
|
||||
@@ -173,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');
|
||||
@@ -185,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');
|
||||
@@ -227,7 +219,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
}
|
||||
|
||||
// convert to comma delimited string
|
||||
$this->PreloadImageList = empty($list) ? '' : "'".implode("','", $list)."'";
|
||||
$this->PreloadImageList = empty($list) ? '' : "'".implode(',', $list)."'";
|
||||
}
|
||||
return $this->PreloadImageList;
|
||||
}
|
||||
@@ -307,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');
|
||||
@@ -428,26 +420,28 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
return $i;
|
||||
}
|
||||
function v6_expand_MatchDivItems() {
|
||||
$this->set_jmatch_items();
|
||||
$l_items = array();
|
||||
$r_items = array();
|
||||
$this->get_jmatch_items($l_items, $r_items);
|
||||
|
||||
$l_keys = $this->shuffle_jmatch_items($this->l_items);
|
||||
$r_keys = $this->shuffle_jmatch_items($this->r_items);
|
||||
$l_keys = $this->shuffle_jmatch_items($l_items);
|
||||
$r_keys = $this->shuffle_jmatch_items($r_items);
|
||||
|
||||
$options = '<option value="x">'.$this->parent->xml_value('data,matching-exercise,default-right-item').'</option>';
|
||||
foreach ($r_keys as $key) {
|
||||
if (! $this->r_items[$key]['fixed']) {
|
||||
$options .= '<option value="'.$key.'">'.$this->r_items[$key]['text'].'</option>'."\n";
|
||||
if (empty($r_items[$key]['fixed'][0]['#'])) {
|
||||
$options .= '<option value="'.$key.'">'.$r_items[$key]['text'][0]['#'].'</option>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$str = '';
|
||||
foreach ($l_keys as $key) {
|
||||
$str .= '<tr><td class="LeftItem">'.$this->l_items[$key]['text'].'</td>';
|
||||
$str .= '<tr><td class="LeftItem">'.$l_items[$key]['text'][0]['#'].'</td>';
|
||||
$str .= '<td class="RightItem">';
|
||||
if ($this->r_items[$key]['fixed']) {
|
||||
$str .= $this->r_items[$key]['text'];
|
||||
} else {
|
||||
if (empty($r_items[$key]['fixed'][0]['#'])) {
|
||||
$str .= '<select id="s'.$key.'_'.$key.'">'.$options.'</select>';
|
||||
} else {
|
||||
$str .= $r_items[$key]['text'][0]['#'];
|
||||
}
|
||||
$str .= '</td><td></td></tr>';
|
||||
}
|
||||
@@ -540,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++;
|
||||
}
|
||||
|
||||
@@ -717,67 +711,46 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
// specials (JMatch)
|
||||
|
||||
function v6_expand_FixedArray() {
|
||||
$this->set_jmatch_items();
|
||||
$l_items = array();
|
||||
$r_items = array();
|
||||
$this->get_jmatch_items($l_items, $r_items);
|
||||
|
||||
$str = '';
|
||||
foreach ($this->l_items as $i=>$item) {
|
||||
for ($ii=0; $ii<$i; $ii++) {
|
||||
if ($this->r_items[$ii]['text']==$this->r_items[$i]['text']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach ($l_items as $i=>$item) {
|
||||
$str .= "F[$i] = new Array();\n";
|
||||
$str .= "F[$i][0] = '".$this->js_safe($item['text'], true)."';\n";
|
||||
$str .= "F[$i][1] = ".($ii+1).";\n";
|
||||
$str .= "F[$i][0] = '".$this->js_safe($item['text'][0]['#'], true)."';\n";
|
||||
$str .= "F[$i][1] = ".($i+1).";\n";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
function v6_expand_DragArray() {
|
||||
$this->set_jmatch_items();
|
||||
$l_items = array();
|
||||
$r_items = array();
|
||||
$this->get_jmatch_items($l_items, $r_items);
|
||||
|
||||
$str = '';
|
||||
foreach ($this->r_items as $i=>$item) {
|
||||
for ($ii=0; $ii<$i; $ii++) {
|
||||
if ($this->r_items[$ii]['text']==$this->r_items[$i]['text']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach ($r_items as $i=>$item) {
|
||||
$str .= "D[$i] = new Array();\n";
|
||||
$str .= "D[$i][0] = '".$this->js_safe($item['text'], true)."';\n";
|
||||
$str .= "D[$i][1] = ".($ii+1).";\n";
|
||||
$str .= "D[$i][2] = ".$item['fixed'].";\n";
|
||||
$str .= "D[$i][0] = '".$this->js_safe($item['text'][0]['#'], true)."';\n";
|
||||
$str .= "D[$i][1] = ".($i+1).";\n";
|
||||
$str .= "D[$i][2] = '".(empty($item['fixed'][0]['#']) ? 0 : 1)."';\n";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
function set_jmatch_items() {
|
||||
if (count($this->l_items)) {
|
||||
return;
|
||||
}
|
||||
function get_jmatch_items(&$l_items, &$r_items) {
|
||||
$tags = 'data,matching-exercise,pair';
|
||||
$i = 0;
|
||||
while (($item = "[$i]['#']") && $this->parent->xml_value($tags, $item)) {
|
||||
$leftitem = $item."['left-item'][0]['#']";
|
||||
$lefttext = $this->parent->xml_value($tags, $leftitem."['text'][0]['#']");
|
||||
|
||||
$rightitem = $item."['right-item'][0]['#']";
|
||||
$righttext = $this->parent->xml_value($tags, $rightitem."['text'][0]['#']");
|
||||
|
||||
if (strlen($righttext)) {
|
||||
$addright = true;
|
||||
} else {
|
||||
$addright = false;
|
||||
while($item = $this->parent->xml_value($tags,"[$i]['#']['left-item'][0]['#']")) {
|
||||
if (!empty($item['text'][0]['#'])) {
|
||||
$l_items[] = $item;
|
||||
}
|
||||
if (strlen($lefttext)) {
|
||||
$this->l_items[] = array(
|
||||
'text' => $lefttext,
|
||||
'fixed' => $this->int_value($tags, $leftitem."['fixed'][0]['#']")
|
||||
);
|
||||
$addright = true; // force right item to be added
|
||||
}
|
||||
if ($addright) {
|
||||
$this->r_items[] = array(
|
||||
'text' => $righttext,
|
||||
'fixed' => $this->int_value($tags, $rightitem."['fixed'][0]['#']")
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
$i = 0;
|
||||
while($item = $this->parent->xml_value($tags,"[$i]['#']['right-item'][0]['#']")) {
|
||||
if (!empty($item['text'][0]['#'])) {
|
||||
$r_items[] = $item;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -786,7 +759,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
// get moveable items
|
||||
$moveable_keys = array();
|
||||
for($i=0; $i<count($items); $i++) {
|
||||
if(empty($items[$i]['fixed'])) {
|
||||
if(empty($items[$i]['fixed'][0]['#'])) {
|
||||
$moveable_keys[] = $i;
|
||||
}
|
||||
}
|
||||
@@ -796,7 +769,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
|
||||
$keys = array();
|
||||
for($i=0, $ii=0; $i<count($items); $i++) {
|
||||
if(empty($items[$i]['fixed'])) {
|
||||
if(empty($items[$i]['fixed'][0]['#'])) {
|
||||
// moveable items are inserted in a shuffled order
|
||||
$keys[] = $moveable_keys[$ii++];
|
||||
} else {
|
||||
@@ -929,9 +902,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
$gap .= '<select id="Gap'.$q.'"><option value=""></option>'.$dropdownlist.'</select>';
|
||||
} else {
|
||||
// minimum gap size
|
||||
if (! $gapsize = $this->int_value('hotpot-config-file,'.$this->parent->quiztype.',minimum-gap-size')) {
|
||||
$gapsize = 6;
|
||||
}
|
||||
$gapsize = 6;
|
||||
|
||||
// increase gap size to length of longest answer for this gap
|
||||
$a = 0;
|
||||
@@ -1064,20 +1035,10 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||
}
|
||||
}
|
||||
function v6_expand_Correct() {
|
||||
if ($this->parent->quiztype=='jcloze') {
|
||||
$tag = 'guesses-correct';
|
||||
} else {
|
||||
$tag = 'guess-correct';
|
||||
}
|
||||
return $this->js_value('hotpot-config-file,'.$this->parent->quiztype.','.$tag);
|
||||
return $this->js_value('hotpot-config-file,'.$this->parent->quiztype.',guesses-correct');
|
||||
}
|
||||
function v6_expand_Incorrect() {
|
||||
if ($this->parent->quiztype=='jcloze') {
|
||||
$tag = 'guesses-incorrect';
|
||||
} else {
|
||||
$tag = 'guess-incorrect';
|
||||
}
|
||||
return $this->js_value('hotpot-config-file,'.$this->parent->quiztype.','.$tag);
|
||||
return $this->js_value('hotpot-config-file,'.$this->parent->quiztype.',guesses-incorrect');
|
||||
}
|
||||
function v6_expand_GiveHint() {
|
||||
return $this->js_value('hotpot-config-file,'.$this->parent->quiztype.',next-correct-letter');
|
||||
@@ -1299,26 +1260,11 @@ 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
|
||||
) {
|
||||
$size = 9; // default size
|
||||
$a = 0;
|
||||
$answers = $question."['answers'][0]['#']";
|
||||
while (($answer = $answers."['answer'][$a]['#']") && $this->parent->xml_value($tags, $answer)) {
|
||||
$text = $this->parent->xml_value($tags, $answer."['text'][0]['#']");
|
||||
$text = preg_replace('/&[#a-zA-Z0-9]+;/', 'x', $text);
|
||||
$size = max($size, strlen($text));
|
||||
$a++;
|
||||
}
|
||||
|
||||
$str .= '<div class="ShortAnswer" id="Q_'.$q.'_SA"><form method="post" action="" onsubmit="return false;"><div>';
|
||||
if ($size<=25) { // text box
|
||||
$str .= '<input type="text" id="Q_'.$q.'_Guess" onfocus="TrackFocus('."'".'Q_'.$q.'_Guess'."'".')" onblur="LeaveGap()" class="ShortAnswerBox" size="'.$size.'"></input>';
|
||||
} else { // textarea (29 cols wide)
|
||||
$str .= '<textarea id="Q_'.$q.'_Guess" onfocus="TrackFocus('."'".'Q_'.$q.'_Guess'."'".')" onblur="LeaveGap()" class="ShortAnswerBox" cols="29" rows="'.ceil($size/25).'"></textarea>';
|
||||
}
|
||||
$str .= '<br /><br />';
|
||||
$str .= '<input type="text" id="Q_'.$q.'_Guess" onfocus="TrackFocus('."'".'Q_'.$q.'_Guess'."'".')" onblur="LeaveGap()" class="ShortAnswerBox" size="9"></input><br /><br />';
|
||||
|
||||
$caption = $this->v6_expand_CheckCaption();
|
||||
$str .= $this->v6_expand_jquiz_button($caption, "CheckShortAnswer($q)");
|
||||
@@ -1337,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:
|
||||
@@ -1510,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]
|
||||
|
||||
@@ -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;
|
||||
@@ -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]';
|
||||
@@ -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 @@
|
||||
|
||||
[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]
|
||||
|
||||
@@ -51,7 +51,7 @@ function StartUp(){
|
||||
[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('');
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,18 +125,18 @@ 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;}
|
||||
@@ -145,7 +145,7 @@ function endDrag(e) {
|
||||
//Need a bugfix for Opera focus problem here
|
||||
if (C.opera){FocusAButton();}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
var CurrDrag = -1;
|
||||
var topZ = 100;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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]';
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>';
|
||||
@@ -88,7 +88,7 @@ function GetAnswerLength(Across,x,y){
|
||||
while ((x<L.length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
x++;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
else{
|
||||
@@ -269,7 +269,7 @@ function CheckAnswers(){
|
||||
var AllCorrect = true;
|
||||
var TotLetters = 0;
|
||||
var CorrectLetters = 0;
|
||||
var LetterFromKey = '';
|
||||
var LetterFromKey = '';
|
||||
var LetterFromGuess = '';
|
||||
|
||||
//Check each letter
|
||||
@@ -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,'');
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -233,7 +233,7 @@ function CheckAnswers(){
|
||||
Parent.removeChild(Select);
|
||||
Parent.innerHTML = AnsText;
|
||||
Parent.nextSibling.innerHTML = CorrectIndicator;
|
||||
}
|
||||
}
|
||||
else{
|
||||
AllDone = false;
|
||||
Parent = Select.parentNode;
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
[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]
|
||||
|
||||
@@ -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');
|
||||
@@ -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';
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
+22
-8
@@ -47,6 +47,7 @@
|
||||
$title = format_string($course->shortname.': '.$hotpot->name, true);
|
||||
$heading = $course->fullname;
|
||||
|
||||
$button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
|
||||
$button = '<div style="font-size:0.75em;">'.$button.'</div>';
|
||||
|
||||
$PAGE->set_title($title);
|
||||
@@ -374,7 +375,6 @@
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_button($button);
|
||||
$PAGE->set_headingmenu($loggedinas);
|
||||
echo $OUTPUT->header();
|
||||
if (!empty($available_msg)) {
|
||||
echo $OUTPUT->notification($available_msg);
|
||||
@@ -424,17 +424,32 @@
|
||||
print $hp->html;
|
||||
break;
|
||||
default:
|
||||
$iframe_id = 'hotpot_iframe';
|
||||
// set iframe attributes
|
||||
$iframe_id = 'hotpot_embed_object';
|
||||
$iframe_src = 'view.php?id='.$cm->id.'&framename=main';
|
||||
|
||||
$PAGE->requires->js('/mod/hotpot/iframe.js');
|
||||
$PAGE->requires->js_function_call('set_iframe_height', array($iframe_id), true);
|
||||
$PAGE->requires->js_function_call('set_embed_object_height', array($iframe_id), true);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if (!empty($available_msg)) {
|
||||
echo $OUTPUT->notification($available_msg);
|
||||
}
|
||||
print "<iframe id=\"$iframe_id\" src=\"view.php?id=$cm->id&framename=main\" height=\"100%\" width=\"100%\">";
|
||||
print "<ilayer name=\"$iframe_id\" src=\"view.php?id=$cm->id&framename=main\" height=\"100%\" width=\"100%\">";
|
||||
print "</ilayer>\n";
|
||||
print "</iframe>\n";
|
||||
|
||||
// for XHTML 1.0 Strict compatability, the embedded page should be implemented
|
||||
// using an <object> not an <iframe>. However, IE <object>'s are problematic
|
||||
// (links and forms cannot escape), so we use conditional comments to display
|
||||
// an <iframe> in IE and an <object> in other browsers
|
||||
|
||||
// print the html element to hold the embedded html page
|
||||
// Note: the iframe in IE needs a "name" attribute for the resizing to work
|
||||
print '<!--[if IE]>'."\n";
|
||||
print '<iframe id="'.$iframe_id.'" name="'.$iframe_id.'_name" src="'.$iframe_src.'" width="100%" height="100%"></iframe>'."\n";
|
||||
print '<![endif]-->'."\n";
|
||||
print '<!--[if !IE]> <-->'."\n";
|
||||
print '<object id="'.$iframe_id.'" type="text/html" data="'.$iframe_src.'" width="100%" height="100%"></object>'."\n";
|
||||
print '<!--> <![endif]-->'."\n";
|
||||
|
||||
print $footer;
|
||||
break;
|
||||
} // end switch $framename
|
||||
@@ -477,4 +492,3 @@ function hotpot_feedback_teachers(&$course, &$hotpot) {
|
||||
}
|
||||
return $teacherdetails;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user