Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove trailing whitespace on everyline and standardize line endings

  • Loading branch information...
commit eb84b02febf5398f6f42321e433256bf4e306e01 1 parent f01e8f7
gbateson authored
Showing with 483 additions and 483 deletions.
  1. +7 −7 mod/hotpot/README.TXT
  2. +2 −2 mod/hotpot/attempt.php
  3. +1 −1  mod/hotpot/db/mysql.php
  4. +1 −1  mod/hotpot/db/postgres7.php
  5. +31 −31 mod/hotpot/db/update_to_v2.php
  6. +3 −3 mod/hotpot/db/upgrade.php
  7. +78 −78 mod/hotpot/hotpot-full.js
  8. +16 −16 mod/hotpot/index.php
  9. +13 −13 mod/hotpot/lib.php
  10. +11 −11 mod/hotpot/mediaplayers/moodle/filter.php
  11. +1 −1  mod/hotpot/mod_form.php
  12. +8 −8 mod/hotpot/report.php
  13. +2 −2 mod/hotpot/report/click/report.php
  14. +17 −17 mod/hotpot/report/default.php
  15. +5 −5 mod/hotpot/report/fullstat/report.php
  16. +7 −7 mod/hotpot/report/overview/report.php
  17. +4 −4 mod/hotpot/report/simplestat/report.php
  18. +12 −12 mod/hotpot/restorelib.php
  19. +3 −3 mod/hotpot/review.php
  20. +1 −1  mod/hotpot/settings.php
  21. +1 −1  mod/hotpot/template/default.php
  22. +11 −11 mod/hotpot/template/v6.php
  23. +3 −3 mod/hotpot/template/v6/djmatch6.ht_
  24. +13 −13 mod/hotpot/template/v6/djmatch6.js_
  25. +3 −3 mod/hotpot/template/v6/djmix6.ht_
  26. +33 −33 mod/hotpot/template/v6/djmix6.js_
  27. +1 −1  mod/hotpot/template/v6/fjmatch6.ht_
  28. +10 −10 mod/hotpot/template/v6/fjmatch6.js_
  29. +7 −7 mod/hotpot/template/v6/hp6.cs_
  30. +6 −6 mod/hotpot/template/v6/hp6browsercheck.js_
  31. +18 −18 mod/hotpot/template/v6/hp6card.js_
  32. +26 −26 mod/hotpot/template/v6/hp6checkshortanswer.js_
  33. +1 −1  mod/hotpot/template/v6/hp6objecttags.ht_
  34. +2 −2 mod/hotpot/template/v6/hp6plainpage.ht_
  35. +2 −2 mod/hotpot/template/v6/hp6showmessage.js_
  36. +3 −3 mod/hotpot/template/v6/hp6utilities.js_
  37. +2 −2 mod/hotpot/template/v6/jcloze6.ht_
  38. +16 −16 mod/hotpot/template/v6/jcloze6.js_
  39. +2 −2 mod/hotpot/template/v6/jcross6.ht_
  40. +13 −13 mod/hotpot/template/v6/jcross6.js_
  41. +1 −1  mod/hotpot/template/v6/jcross6print.ht_
  42. +1 −1  mod/hotpot/template/v6/jmatch6.ht_
  43. +18 −18 mod/hotpot/template/v6/jmatch6.js_
  44. +1 −1  mod/hotpot/template/v6/jmix6.ht_
  45. +13 −13 mod/hotpot/template/v6/jmix6.js_
  46. +3 −3 mod/hotpot/template/v6/jquiz6.ht_
  47. +47 −47 mod/hotpot/template/v6/jquiz6.js_
  48. +2 −2 mod/hotpot/template/v6/masher.ht_
  49. +1 −1  mod/hotpot/view.php
View
14 mod/hotpot/README.TXT
@@ -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:
View
4 mod/hotpot/attempt.php
@@ -165,7 +165,7 @@
}
}
- // redirect to the next quiz or the course page
+ // redirect to the next quiz or the course page
redirect($next_url, get_string('resultssaved', 'hotpot'));
}
@@ -470,7 +470,7 @@ function hotpot_set_attempt_details(&$attempt) {
}
// remove "correct" and "wrong" values from "ignored" values
- $response->ignored = array_diff($response->ignored,
+ $response->ignored = array_diff($response->ignored,
$response->correct, $response->wrong, $oldresponse->correct, $oldresponse->wrong
);
View
2  mod/hotpot/db/mysql.php
@@ -2,7 +2,7 @@
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
+// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
function hotpot_upgrade($oldversion) {
View
2  mod/hotpot/db/postgres7.php
@@ -2,7 +2,7 @@
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
+// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
function hotpot_upgrade($oldversion) {
View
62 mod/hotpot/db/update_to_v2.php
@@ -17,7 +17,7 @@ function hotpot_update_to_v2_2() {
$index = "{$table}_{$field}_idx";
}
hotpot_db_delete_index("{$CFG->prefix}$table", $index);
-
+
// add new hotpot_questions.md5key field (and index)
$table = 'hotpot_questions';
$field = 'md5key';
@@ -31,7 +31,7 @@ function hotpot_update_to_v2_2() {
$ok = $ok && set_field($table, 'md5key', md5($record->name), 'id', $record->id);
}
}
-
+
// remove the index on hotpot_strings.string
$table = 'hotpot_strings';
$field = 'string';
@@ -55,7 +55,7 @@ function hotpot_update_to_v2_2() {
$ok = $ok && set_field($table, 'md5key', md5($record->string), 'id', $record->id);
}
}
-
+
return $ok;
}
function hotpot_update_to_v2_1_21() {
@@ -124,12 +124,12 @@ function hotpot_remove_orphans($secondarytable, $secondarykeyfield, $primarytabl
$db->debug = false;
$records = get_records_sql("
- SELECT
+ SELECT
t2.$secondarykeyfield, t2.$secondarykeyfield
- FROM
- {$CFG->prefix}$secondarytable t2 LEFT JOIN {$CFG->prefix}$primarytable t1
+ FROM
+ {$CFG->prefix}$secondarytable t2 LEFT JOIN {$CFG->prefix}$primarytable t1
ON (t2.$secondarykeyfield = t1.id)
- WHERE
+ WHERE
t1.$primarykeyfield IS NULL
");
@@ -270,7 +270,7 @@ function hotpot_update_to_v2_1_2() {
$debug = $db->debug;
$db->debug = false;
- // extract info about attempts by each user on each hotpot (cases where
+ // extract info about attempts by each user on each hotpot (cases where
// the user has only one attempt, or no "in progess" attempt are ignored)
$rs = $db->Execute("
SELECT userid, hotpot, COUNT(*), MIN(status)
@@ -289,8 +289,8 @@ function hotpot_update_to_v2_1_2() {
// get all attempts by this user at this hotpot
$attempts = get_records_sql("
- SELECT id, userid, hotpot, score, timestart, timefinish, status
- FROM {$CFG->prefix}hotpot_attempts
+ SELECT id, userid, hotpot, score, timestart, timefinish, status
+ FROM {$CFG->prefix}hotpot_attempts
WHERE userid = ".$record['userid']." AND hotpot=".$record['hotpot']."
ORDER BY timestart DESC, id DESC
");
@@ -298,7 +298,7 @@ function hotpot_update_to_v2_1_2() {
unset($previous_timestart);
foreach ($attempts as $attempt) {
- // if this attempt has a status of "in progress" and is not
+ // if this attempt has a status of "in progress" and is not
// the most recent one in the group, set the status to "abandoned"
if ($attempt->status==1 && isset($previous_timestart)) {
$values = 'status=3';
@@ -335,7 +335,7 @@ function hotpot_update_to_v2_1() {
$ok = $ok && hotpot_db_update_field_type('hotpot_questions', 'name', 'name', 'TEXT', '', '', 'NOT NULL', '');
// hotpot_questions: nullify empty and non-numeric (shouldn't be any) values in "text" field
switch (strtolower($CFG->dbfamily)) {
- case 'mysql' :
+ case 'mysql' :
$NOT_REGEXP = 'NOT REGEXP';
break;
case 'postgres' :
@@ -358,13 +358,13 @@ function hotpot_update_to_v2_1() {
} else {
$ok = $ok && hotpot_create_table($table);
switch (strtolower($CFG->dbfamily)) {
- case 'mysql' :
+ case 'mysql' :
case 'postgres' :
$sql = "
- INSERT INTO {$CFG->prefix}$table (attempt, details)
+ INSERT INTO {$CFG->prefix}$table (attempt, details)
SELECT a.id AS attempt, a.details AS details
FROM {$CFG->prefix}hotpot_attempts a
- WHERE
+ WHERE
a.details IS NOT NULL AND a.details <> ''
AND a.details LIKE '<?xml%' AND a.details LIKE '%</hpjsresult>'
";
@@ -400,9 +400,9 @@ function hotpot_update_to_v2_1() {
$ok = $ok && hotpot_db_add_index('hotpot_responses', 'question');
// hotpot_string: correct double-encoded HTML entities
$ok = $ok && execute_sql("
- UPDATE {$CFG->prefix}hotpot_strings
- SET string = REPLACE(string, '&amp;','&')
- WHERE string LIKE '%&amp;#%'
+ UPDATE {$CFG->prefix}hotpot_strings
+ SET string = REPLACE(string, '&amp;','&')
+ WHERE string LIKE '%&amp;#%'
AND (string LIKE '<' OR string LIKE '>')
");
// hotpot_question: remove questions which refer to deleted hotpots
@@ -468,7 +468,7 @@ function hotpot_update_to_v2_from_hotpotatoes() {
global $CFG;
$ok = true; // hope for the best!
// check we have the minimum required hotpot module
- $minimum = 2005031400;
+ $minimum = 2005031400;
$module = get_record("modules", "name", "hotpot");
if (empty($module) || $module->version<$minimum) {
if ($module) {
@@ -558,7 +558,7 @@ function hotpot_create_table($table) {
}
}
return $ok;
- }
+ }
// Moodle 1.7 (and earlier)
@@ -731,9 +731,9 @@ function hotpot_update_logs($oldmodulename, $modulename, $moduleid, &$new) {
break;
case "attempt":
case "submit":
- case "review":
+ case "review":
$id = substr(strrchr($record->url,"="),1);
- if (isset($new->attempt[$id])) {
+ if (isset($new->attempt[$id])) {
$id = $new->attempt[$id];
}
$record->url = "review.php?id=".$record->cmid."&attempt=$id";
@@ -961,7 +961,7 @@ function hotpot_db_index_exists($table, $index, $feedback=false) {
$debug = $db->debug;
$db->debug = $feedback;
switch (strtolower($CFG->dbfamily)) {
- case 'mysql' :
+ case 'mysql' :
$rs = $db->Execute("SHOW INDEX FROM `$table`");
if ($rs && $rs->RecordCount()>0) {
$records = $rs->GetArray();
@@ -990,7 +990,7 @@ function hotpot_db_delete_index($table, $index, $feedback=false) {
// check index exists
if (hotpot_db_index_exists($table, $index)) {
switch (strtolower($CFG->dbfamily)) {
- case 'mysql' :
+ case 'mysql' :
$sql = "ALTER TABLE `$table` DROP INDEX `$index`";
break;
case 'postgres' :
@@ -1044,7 +1044,7 @@ function hotpot_db_table_exists($table, $feedback=false) {
return hotpot_db_object_exists($table, '', $feedback);
}
function hotpot_db_field_exists($table, $field, $feedback=false) {
- return
+ return
hotpot_db_object_exists($table, '', $feedback) &&
hotpot_db_object_exists($table, $field, $feedback)
;
@@ -1055,7 +1055,7 @@ function hotpot_db_object_exists($table, $field='', $feedback=false) {
$table = "{$CFG->prefix}$table";
// set $sql
switch (strtolower($CFG->dbfamily)) {
- case 'mysql' :
+ case 'mysql' :
if (empty($field)) {
$sql = "SHOW TABLES LIKE '$table'";
} else {
@@ -1067,7 +1067,7 @@ function hotpot_db_object_exists($table, $field='', $feedback=false) {
$sql = "SELECT relname FROM pg_class WHERE relname = '$table' AND relkind='r'";
} else {
$sql = "
- SELECT attname FROM pg_attribute WHERE attname = '$field'
+ SELECT attname FROM pg_attribute WHERE attname = '$field'
AND attrelid = (SELECT oid FROM pg_class WHERE relname = '$table')
";
}
@@ -1177,7 +1177,7 @@ function hotpot_db_update_field_type($table, $oldfield, $field, $type, $size, $u
}
if (empty($oldfield) && hotpot_db_field_exists($table, $field)) {
$oldfield = $field;
- }
+ }
if (is_string($unsigned)) {
$unsigned = (strtoupper($unsigned)=='UNSIGNED');
}
@@ -1245,8 +1245,8 @@ function hotpot_db_update_field_type($table, $oldfield, $field, $type, $size, $u
$ok = $ok && execute_sql("ALTER TABLE `$table` $action `$field` $fieldtype");
break;
case 'postgres':
- // get db version
- // N.B. $db->ServerInfo() usually returns blank
+ // get db version
+ // N.B. $db->ServerInfo() usually returns blank
// (except lib/adodb/drivers/adodb-postgre64-inc.php)
$dbversion = '';
$rs = $db->Execute("SELECT version()");
@@ -1292,7 +1292,7 @@ function hotpot_db_update_field_type($table, $oldfield, $field, $type, $size, $u
execute_sql('ALTER TABLE '.$table.' ALTER COLUMN "'.$tmpfield.'" '.$notnull);
} else {
execute_sql("
- UPDATE pg_attribute SET attnotnull=".($notnull ? 'TRUE' : 'FALSE')."
+ UPDATE pg_attribute SET attnotnull=".($notnull ? 'TRUE' : 'FALSE')."
WHERE attname = '$tmpfield'
AND attrelid = (SELECT oid FROM pg_class WHERE relname = '$table')
");
View
6 mod/hotpot/db/upgrade.php
@@ -1,6 +1,6 @@
<?php //$Id$
-// This file keeps track of upgrades to
+// This file keeps track of upgrades to
// the hotpot module
//
// Sometimes, changes between versions involve
@@ -23,8 +23,8 @@ function xmldb_hotpot_upgrade($oldversion=0) {
$result = true;
-/// And upgrade begins here. For each one, you'll need one
-/// block of code similar to the next one. Please, delete
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
View
156 mod/hotpot/hotpot-full.js
@@ -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">'
View
32 mod/hotpot/index.php
@@ -6,7 +6,7 @@
require_once("../../course/lib.php");
require_once("lib.php");
- $id = required_param('id', PARAM_INT); // course
+ $id = required_param('id', PARAM_INT); // course
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");
}
@@ -36,11 +36,11 @@
$title = format_string($course->shortname) . ": $strmodulenameplural";
$heading = $course->fullname;
-
+
$navlinks = array();
$navlinks[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity');
$navigation = build_navigation($navlinks);
-
+
print_header($title, $heading, $navigation, "", "", true, "", navmenu($course));
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
@@ -70,7 +70,7 @@
// do nothing (user is not diplaying this section)
} else {
$hotpots[$hotpot_instance->id] = $hotpot_instance;
- }
+ }
}
}
if (empty($hotpots)) {
@@ -199,9 +199,9 @@
if ($concat_field) {
$records = get_records_sql("
SELECT $concat_field, COUNT(*), hotpot, name
- FROM {$CFG->prefix}hotpot_questions
+ FROM {$CFG->prefix}hotpot_questions
WHERE hotpot IN ($hotpotids)
- GROUP BY hotpot, name
+ GROUP BY hotpot, name
HAVING COUNT(*) >1
");
if ($records) {
@@ -270,31 +270,31 @@
}
switch ($course->format) {
- case 'weeks' :
+ case 'weeks' :
$title = get_string("week");
break;
- case 'topics' :
+ case 'topics' :
$title = get_string("topic");
break;
- default :
+ default :
$title = '';
break;
}
if ($title) {
- array_push($table->head, $title);
+ array_push($table->head, $title);
array_push($table->align, "center");
}
if (has_capability('moodle/course:manageactivities', $coursecontext)) {
array_push($table->head, $strupdate);
array_push($table->align, "center");
}
- array_push($table->head,
- get_string("name"),
- get_string("quizcloses", "quiz"),
- get_string("bestgrade", "quiz"),
+ array_push($table->head,
+ get_string("name"),
+ get_string("quizcloses", "quiz"),
+ get_string("bestgrade", "quiz"),
get_string("attempts", "quiz")
);
- array_push($table->align,
+ array_push($table->align,
"left", "left", "center", "left"
);
if (has_capability('mod/hotpot:grade', $coursecontext)) {
@@ -336,7 +336,7 @@
$bestscore = "&nbsp;";
} else {
-
+
$cm = get_coursemodule_from_instance('hotpot', $hotpot->id);
// report number of attempts and users
$report = get_string("viewallreports","quiz", $totals[$hotpot->id]->attemptcount);
View
26 mod/hotpot/lib.php
@@ -244,11 +244,11 @@ function hotpot_update_events($hotpot) {
$event->timeduration = ($hotpot->timeclose - $hotpot->timeopen);
if ($event->timeduration > HOTPOT_MAX_EVENT_LENGTH) { /// Long durations create two events
-
+
$event->name = addslashes($hotpot->name).' ('.get_string('hotpotopens', 'hotpot').')';
$event->timeduration = 0;
add_event($event);
-
+
$event->timestart = $hotpot->timeclose;
$event->eventtype = 'close';
$event->name = addslashes($hotpot->name).' ('.get_string('hotpotcloses', 'hotpot').')';
@@ -790,7 +790,7 @@ function hotpot_get_all_instances_in_course($modulename, $course) {
if ($rawmods = get_records_sql($query)) {
// cache $isteacher setting
-
+
$isteacher = has_capability('mod/hotpot:viewreport', get_context_instance(CONTEXT_COURSE, $course->id));
$explodesection = array();
@@ -1006,7 +1006,7 @@ function hotpot_print_recent_activity($course, $isteacher, $timestart) {
foreach ($records as $id => $record){
if ($cm = get_coursemodule_from_instance('hotpot', $record->id, $course->id)) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
-
+
if (has_capability('mod/hotpot:viewreport', $context)) {
$href = "$CFG->wwwroot/mod/hotpot/view.php?hp=$id";
$name = '&nbsp;<a href="'.$href.'">'.$record->name.'</a>';
@@ -1265,7 +1265,7 @@ function hotpot_update_grades($hotpot=null, $userid=0, $nullifnone=true) {
hotpot_grade_item_update($hotpot, $grade);
} else {
- hotpot_grade_item_update($hotpot);
+ hotpot_grade_item_update($hotpot);
}
} else {
$sql = "SELECT h.*, cm.idnumber as cmidnumber
@@ -1392,7 +1392,7 @@ function hotpot_add_attempt($hotpotid) {
$attempt->status = HOTPOT_STATUS_ABANDONED;
update_record('hotpot_attempts', $attempt);
}
- }
+ }
// create and add new attempt record
$attempt = new stdClass();
@@ -1896,7 +1896,7 @@ function adjust_media_urls() {
$i_max = count($objects[0]);
for ($i=0; $i<$i_max; $i++) {
- // extract URL from <PARAM> or <A>
+ // extract URL from <PARAM> or <A>
$url = '';
if (preg_match($param_url, $objects[3][$i], $matches) || preg_match($link_url, $objects[3][$i], $matches)) {
$url = $matches[3];
@@ -2437,13 +2437,13 @@ function set_user_preference($name, $value, $otheruser=NULL) {
function get_coursemodule_from_id($modulename, $cmid, $courseid=0) {
global $CFG;
return get_record_sql("
- SELECT
+ SELECT
cm.*, m.name, md.name as modname
- FROM
+ FROM
{$CFG->prefix}course_modules cm,
{$CFG->prefix}modules md,
{$CFG->prefix}$modulename m
- WHERE
+ WHERE
".($courseid ? "cm.course = '$courseid' AND " : '')."
cm.id = '$cmid' AND
cm.instance = m.id AND
@@ -2457,13 +2457,13 @@ function get_coursemodule_from_id($modulename, $cmid, $courseid=0) {
function get_coursemodule_from_instance($modulename, $instance, $courseid=0) {
global $CFG;
return get_record_sql("
- SELECT
+ SELECT
cm.*, m.name, md.name as modname
- FROM
+ FROM
{$CFG->prefix}course_modules cm,
{$CFG->prefix}modules md,
{$CFG->prefix}$modulename m
- WHERE
+ WHERE
".($courseid ? "cm.course = '$courseid' AND" : '')."
cm.instance = m.id AND
md.name = '$modulename' AND
View
22 mod/hotpot/mediaplayers/moodle/filter.php
@@ -1,13 +1,13 @@
<?php // $id$
//////////////////////////////////////////////////////////////
// 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) {
@@ -40,7 +40,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
$replace .= '</embed>';
$replace .= '</object>&nbsp;';
-
+
$text = preg_replace($search, $replace, $text);
}
@@ -84,7 +84,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
if ($CFG->filter_mediaplugin_enable_flv) {
$search = '/<a(.*?)href=\"([^<]+)\.flv\"([^>]*)>(.*?)<\/a>/is';
-
+
$replace = '\\0&nbsp;<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">';
@@ -97,7 +97,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
$replace .= '</embed>';
$replace .= '</object>&nbsp;';
-
+
$text = preg_replace($search, $replace, $text);
}
@@ -159,7 +159,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);
}
@@ -172,10 +172,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';
@@ -200,7 +200,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';
@@ -225,7 +225,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';
View
2  mod/hotpot/mod_form.php
@@ -3,7 +3,7 @@
require_once ($CFG->dirroot.'/mod/hotpot/lib.php');
$HOTPOT_TEXTSOURCE = array(
- HOTPOT_TEXTSOURCE_QUIZ => get_string('textsourcequiz', 'hotpot'),
+ HOTPOT_TEXTSOURCE_QUIZ => get_string('textsourcequiz', 'hotpot'),
HOTPOT_TEXTSOURCE_FILENAME => get_string('textsourcefilename', 'hotpot'),
HOTPOT_TEXTSOURCE_FILEPATH => get_string('textsourcefilepath', 'hotpot'),
HOTPOT_TEXTSOURCE_SPECIFIC => get_string('textsourcespecific', 'hotpot')
View
16 mod/hotpot/report.php
@@ -14,7 +14,7 @@
}
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
- }
+ }
if (! $hotpot = get_record("hotpot", "id", $cm->instance)) {
error("Course module is incorrect");
}
@@ -220,8 +220,8 @@
$fields = 'a.*, u.firstname, u.lastname, u.picture';
if ($mode=='click') {
$fields .= ', u.idnumber';
- } else {
- // overview, simple and detailed reports
+ } else {
+ // overview, simple and detailed reports
// get last attempt record in clickreport series
$ids = array();
foreach ($cr_attempts as $cr_attempt) {
@@ -409,7 +409,7 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
}
//////////////////////////////////////////////
-/// functions to print the report headings and
+/// functions to print the report headings and
/// report selector menus
function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
@@ -419,7 +419,7 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
-
+
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
if ($mode=='overview' || $mode=='simplestat' || $mode=='fullstat') {
@@ -437,7 +437,7 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
- echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
+ echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
. get_string('seeallcoursegrades', 'grades') . '</a></div>';
}
print_heading($hotpot->name);
@@ -481,9 +481,9 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
// get users who have ever atetmpted this HotPot
$users = get_records_sql("
- SELECT
+ SELECT
u.id, u.firstname, u.lastname
- FROM
+ FROM
{$CFG->prefix}user u,
{$CFG->prefix}hotpot_attempts ha
WHERE
View
4 mod/hotpot/report/click/report.php
@@ -338,7 +338,7 @@ function set_head(&$options, &$table, $zone, $exercisetype='', $details=array(),
if (!function_exists('clean_getstring_data')) { // Moodle 1.4 (and less)
$reportpercentscore = str_replace('%', '%%', $reportpercentscore);
}
- array_push($table->head,
+ array_push($table->head,
get_string('reportthisclick', 'hotpot', get_string('reportquestionstried', 'hotpot')),
get_string('reportsofar', 'hotpot', get_string('reportquestionstried', 'hotpot')),
get_string('reportthisclick', 'hotpot', get_string('reportright', 'hotpot')),
@@ -424,7 +424,7 @@ function set_data_attempt(&$attempt, &$strftimedate, &$strftimetime, &$blank) {
$records = get_records_sql_menu("
SELECT userid, MIN(time) AS logouttime
FROM {$CFG->prefix}log
- WHERE userid=$attempt->userid AND action='logout' AND time>$attempt->cr_timefinish
+ WHERE userid=$attempt->userid AND action='logout' AND time>$attempt->cr_timefinish
GROUP BY userid
");
if (empty($records)) {
View
34 mod/hotpot/report/default.php
@@ -1,15 +1,15 @@
-<?PHP // $Id$
+<?PHP // $Id$
////////////////////////////////////////////////////////////////////
/// Default class for report plugins
-///
-/// Doesn't do anything on it's own -- it needs to be extended.
-/// This class displays quiz reports. Because it is called from
+///
+/// Doesn't do anything on it's own -- it needs to be extended.
+/// This class displays quiz reports. Because it is called from
/// within /mod/quiz/report.php you can assume that the page header
/// and footer are taken care of.
-///
-/// This file can refer to itself as report.php to pass variables
-/// to itself - all these will also be globally available. You must
+///
+/// This file can refer to itself as report.php to pass variables
+/// to itself - all these will also be globally available. You must
/// pass "id=$cm->id" or q=$quiz->id", and "mode=reportname".
////////////////////////////////////////////////////////////////////
@@ -17,7 +17,7 @@
class hotpot_default_report {
- function display($hotpot, $cm, $course, $users, $attempts, $questions, $options) {
+ function display($hotpot, $cm, $course, $users, $attempts, $questions, $options) {
/// This function just displays the report
// it is replaced by the "display" functions in the scripts in the "report" folder
return true;
@@ -68,7 +68,7 @@ function set_legend(&$table, &$q, &$value, &$question) {
// add $value to answers array, if it was not there
if ($i==$i_max) {
- $table->legend[$q]['answers'][$i] = $value;
+ $table->legend[$q]['answers'][$i] = $value;
}
// convert $value to alphabetic index (A, B ... AA, AB ...)
@@ -98,12 +98,12 @@ function create_legend_table(&$tables, &$table) {
foreach($table->legend as $q=>$question) {
$legend->stat[] = array(
- get_string('questionshort', 'hotpot', $q+1),
+ get_string('questionshort', 'hotpot', $q+1),
$question['name']
);
foreach($question['answers'] as $a=>$answer) {
$legend->stat[] = array(
- $this->dec_to_ALPHA($a),
+ $this->dec_to_ALPHA($a),
$answer
);
}
@@ -324,7 +324,7 @@ function print_report_cells(&$table, &$options, $zone) {
function print_report_finish(&$course, &$hotpot, &$options) {
switch ($options['reportformat']) {
- case 'txt' :
+ case 'txt' :
// do nothing
break;
case 'xls':
@@ -450,7 +450,7 @@ function print_html_data(&$table) {
$col = 0; // column index
while ($col<$table->colspan && isset($cells[$i])) {
if (empty($skipcol[$col])) {
- $cell = &$cells[$i++];
+ $cell = &$cells[$i++];
$td = $table->td[$col];
if (is_object($cell)) {
$text = $cell->text;
@@ -546,7 +546,7 @@ function print_text_report(&$course, &$hotpot, &$tables, &$options) {
}
function print_text_start(&$course, &$hotpot, &$options) {
$downloadfilename = clean_filename("$course->shortname $hotpot->name.txt");
- header("Content-Type: application/download\n");
+ header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=$downloadfilename");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
@@ -658,7 +658,7 @@ function print_excel_report(&$course, &$hotpot, &$tables, &$options) {
$this->print_excel_stat($wb, $ws, $table, $row, $options);
$this->print_excel_foot($wb, $ws, $table, $row, $options);
}
-
+
// close the workbook (and send it to the browser)
$wb->close();
}
@@ -679,8 +679,8 @@ function print_excel_headers(&$wb, &$course, &$hotpot) {
function print_excel_head(&$wb, &$ws, &$table, &$row, &$options) {
// define format properties
$properties = array(
- 'bold'=>1,
- 'align'=>'center',
+ 'bold'=>1,
+ 'align'=>'center',
'v_align'=>'bottom',
'text_wrap'=>1
);
View
10 mod/hotpot/report/fullstat/report.php
@@ -39,9 +39,9 @@ function create_responses_table(&$hotpot, &$course, &$users, &$attempts, &$quest
}
// headings for name, attempt number, score/grade and penalties
$table->head = array(
- get_string("name"),
+ get_string("name"),
hotpot_grade_heading($hotpot, $options),
- get_string('attempt', 'quiz'),
+ get_string('attempt', 'quiz'),
);
$table->align = array('left', 'center', 'center');
$table->size = array(150, 80, 10);
@@ -50,8 +50,8 @@ function create_responses_table(&$hotpot, &$course, &$users, &$attempts, &$quest
// question headings
$this->add_question_headings($questions, $table, 'left', 0, false, 2);
// penalties (not always needed) and raw score
- array_push($table->head,
- get_string('penalties', 'hotpot'),
+ array_push($table->head,
+ get_string('penalties', 'hotpot'),
get_string('score', 'quiz')
);
array_push($table->align, 'center', 'center');
@@ -82,7 +82,7 @@ function create_responses_table(&$hotpot, &$course, &$users, &$attempts, &$quest
}
$cells = array ($name, $grade, $attemptnumber);
// $name and $grade are only printed on first line per user
- $name = $blank;
+ $name = $blank;
$grade = $blank;
$start_col = count($cells);
foreach ($questionids as $col => $id) {
View
14 mod/hotpot/report/overview/report.php
@@ -29,13 +29,13 @@ function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$
$table->size[] = 10;
$table->wrap[] = "nowrap";
}
- array_push($table->head,
- get_string("name"),
+ array_push($table->head,
+ get_string("name"),
hotpot_grade_heading($hotpot, $options),
- get_string("attempt", "quiz"),
- get_string("time", "quiz"),
- get_string("reportstatus", "hotpot"),
- get_string("timetaken", "quiz"),
+ get_string("attempt", "quiz"),
+ get_string("time", "quiz"),
+ get_string("reportstatus", "hotpot"),
+ get_string("timetaken", "quiz"),
get_string("score", "quiz")
);
array_push($table->align, "left", "center", "center", "left", "center", "center", "center");
@@ -96,7 +96,7 @@ function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$
if ($is_html && is_numeric($score) && $score==$user->grade) { // best grade
$score = '<span class="highlight">'.$score.'</span>';
}
- array_push($data,
+ array_push($data,
$attemptnumber,
$checkbox.$starttime,
hotpot_format_status($attempt),
View
8 mod/hotpot/report/simplestat/report.php
@@ -29,9 +29,9 @@ function create_scores_table(&$hotpot, &$course, &$users, &$attempts, &$question
$table->size[] = 10;
}
// name, grade and attempt number
- array_push($table->head,
+ array_push($table->head,
get_string("name"),
- hotpot_grade_heading($hotpot, $options),
+ hotpot_grade_heading($hotpot, $options),
get_string("attempt", "quiz")
);
array_push($table->align, "left", "center", "center");
@@ -39,8 +39,8 @@ function create_scores_table(&$hotpot, &$course, &$users, &$attempts, &$question
// question headings
$this->add_question_headings($questions, $table);
// penalties and raw score
- array_push($table->head,
- get_string('penalties', 'hotpot'),
+ array_push($table->head,
+ get_string('penalties', 'hotpot'),
get_string('score', 'quiz')
);
array_push($table->align, "center", "center");
View
24 mod/hotpot/restorelib.php
@@ -5,13 +5,13 @@
//-----------------------------------------------------------
//
// hotpot
- // (CL, pk->id,
+ // (CL, pk->id,
// fk->course, files)
// |
// +--------------+---------------+
// | |
// hotpot_attempts hotpot_questions
- // (UL, pk->id, (UL, pk->id,
+ // (UL, pk->id, (UL, pk->id,
// fk->hotpot) fk->hotpot, text)
// | | |
// +-------------------+----------+ |
@@ -40,7 +40,7 @@
function hotpot_restore_mods($mod, $restore) {
//This function restores a single hotpot activity
- // This function is called by "restore_create_modules" (in "backup/restorelib.php")
+ // This function is called by "restore_create_modules" (in "backup/restorelib.php")
// which is called by "backup/restore_execute.html" (included by "backup/restore.php")
// $mod is an object
// id : id field in 'modtype' table
@@ -129,7 +129,7 @@ function hotpot_restore_questions(&$restore, $status, &$xml, &$record) {
// $xml is an XML tree for a hotpot record
// $record is the newly added hotpot record
$foreignkeys = array(
- 'hotpot'=>$record->id,
+ 'hotpot'=>$record->id,
'text'=>'hotpot_strings'
);
return hotpot_restore_records(
@@ -240,7 +240,7 @@ function hotpot_restore_records(&$restore, $status, &$xml, $table, $foreign_keys
// $record_TAG : (optional) the name of an XML tag which starts a single record
// If no $record_TAG is specified, the block of records is assumed to be a single record
// other parameters are explained in "hotpot_restore_record" below
-
+
$i = 0; // index for $records_TAG
do {
unset($xml_records);
@@ -287,10 +287,10 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
// $foreign_keys : array of foreign keys, if any, specifed as $key=>$value
// $key : the name of a field in the current $record
// $value : if $value is numeric, then $record->$key is set to $value.
- // Otherwise $value is assumed to be a table name and $record->$key
+ // Otherwise $value is assumed to be a table name and $record->$key
// is treated as a comma separated list of ids in that table
// $more_restore : optional PHP code to be eval(uated) for each record
- // $secondary_key :
+ // $secondary_key :
// the name of the secondary key field, if any, in the current $record.
// If this field is specified, then the current record will only be added
// if the $record->$secondarykey value does not already exist in $table
@@ -298,7 +298,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
// maintain a cache of info on table columns
static $table_columns = array();
if (empty($table_columns[$table])) {
- global $CFG, $db;
+ global $CFG, $db;
$table_columns[$table] = $db->MetaColumns("$CFG->prefix$table");
}
@@ -341,7 +341,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
}
print "was not restored</li></ul>";
}
- $ok = false;
+ $ok = false;
}
}
}
@@ -403,7 +403,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
if (isset($record->old_id)) {
backup_putid($restore->backup_unique_code, $table, $record->old_id, $record->id);
}
- } else {
+ } else {
// failed to add (or find) $record
if (!defined('RESTORE_SILENTLY')) {
print "<ul><li>Record could not be added: table=$table</li></ul>";
@@ -453,7 +453,7 @@ function hotpot_restore_logs($restore, $log) {
break;
case "attempt":
case "submit":
- case "review":
+ case "review":
if ($log->cmid) {
//Get the new_id of the module (to recode the info field)
$mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
@@ -462,7 +462,7 @@ function hotpot_restore_logs($restore, $log) {
$attemptid = substr(strrchr($log->url,"="),1);
//Get the new_id of the attempt (to recode the url field)
$attempt = backup_getid($restore->backup_unique_code,"hotpot_attempts",$attemptid);
- if ($attempt) {
+ if ($attempt) {
$log->url = "review.php?id=".$log->cmid."&attempt=".$attempt->new_id;
$log->info = $mod->new_id;
$status = true;
View
6 mod/hotpot/review.php
@@ -58,7 +58,7 @@
// print header
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
-
+
$navigation = build_navigation('', $cm);
$button = update_module_button($cm->id, $course->id, $strmodulename);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
@@ -107,10 +107,10 @@ function hotpot_print_attempt_summary(&$hotpot, &$attempt) {
$value = hotpot_format_status($attempt);
break;
case 'timerecorded':
- $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish);
+ $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish);
break;
case 'timetaken':
- $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart);
+ $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart);
break;
default:
$value = isset($attempt->$field) ? $attempt->$field : NULL;
View
2  mod/hotpot/settings.php
@@ -1,6 +1,6 @@
<?php //$Id$
-$settings->add(new admin_setting_configcheckbox('hotpot_showtimes', get_string('showtimes', 'hotpot'),
+$settings->add(new admin_setting_configcheckbox('hotpot_showtimes', get_string('showtimes', 'hotpot'),
get_string('configshowtimes', 'hotpot'), 0) );
$settings->add(new admin_setting_configtext('hotpot_excelencodings', get_string('excelencodings', 'hotpot'),
View
2  mod/hotpot/template/default.php
@@ -92,7 +92,7 @@ function get_halfway_color($x, $y) {
$rrggbb = '/^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i';
if ((
preg_match($rgb, $x, $x_matches) ||
- preg_match($rrggbb, $x, $x_matches)
+ preg_match($rrggbb, $x, $x_matches)
) && (
preg_match($rgb, $y, $y_matches) ||
preg_match($rrggbb, $y, $y_matches)
View
22 mod/hotpot/template/v6.php
@@ -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 @@ function v6_expand_ReadingTitle() {
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 @@ function v6_expand_Seconds() {
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 @@ function v6_expand_NavBarColor() {
}
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 @@ function jmix_OpenPunctuation($tags) {
$value = strtr($value, $ENTITIES);
if (preg_match_all($pattern, $value, $matches)) {
$chars = array_merge($chars, $matches[0]);
- }
+ }
$i++;
}
@@ -1260,7 +1260,7 @@ function v6_expand_QuestionOutput() {
$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 @@ function v6_expand_QuestionOutput() {
}
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;
-}
+}
?>
View
6 mod/hotpot/template/v6/djmatch6.ht_
@@ -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]
View
26 mod/hotpot/template/v6/djmatch6.js_
@@ -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;
}