Permalink
Browse files

addslashes to "name" and "summary" when they are set from the HP quiz…

… file;

increment version to v2.1.10
  • Loading branch information...
1 parent 09f9727 commit 05b88e80dfbd2b8ae041df738a215e0364d582fc gbateson committed Jan 20, 2006
Showing with 8 additions and 9 deletions.
  1. +1 −1 mod/hotpot/README.TXT
  2. +5 −6 mod/hotpot/lib.php
  3. +2 −2 mod/hotpot/version.php
View
@@ -1,4 +1,4 @@
-This is v2.1.9 of the HotPot module
+This is v2.1.10 of the HotPot module
This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle.
It has been tested on:
- Hot Potatoes 6
View
@@ -261,7 +261,7 @@ function hotpot_set_form_values(&$hp) {
$ok = hotpot_update_chain($hp);
break;
}
- } else {
+ } else { // $hp->quizchain==HOTPOT_NO
hotpot_set_name_summary_reference($hp);
}
@@ -301,7 +301,6 @@ function hotpot_set_form_values(&$hp) {
set_user_preference('hotpot_summarysource', $hp->summarysource);
}
}
-
return $ok;
}
function hotpot_get_chain(&$cm) {
@@ -554,9 +553,9 @@ function hotpot_set_name_summary_reference(&$hp, $chain_index=NULL) {
switch ($hp->$textsource) {
case HOTPOT_TEXTSOURCE_QUIZ:
if ($textfield=='name') {
- $hp->exercisetitle = addslashes($hp->names[$chain_index]);
+ $hp->exercisetitle = $hp->names[$chain_index];
} else if ($textfield=='summary') {
- $hp->exercisesubtitle = addslashes($hp->summaries[$chain_index]);
+ $hp->exercisesubtitle = $hp->summaries[$chain_index];
}
break;
case HOTPOT_TEXTSOURCE_SPECIFIC:
@@ -577,9 +576,9 @@ function hotpot_set_name_summary_reference(&$hp, $chain_index=NULL) {
hotpot_get_titles_and_next_ex($hp, $xml_quiz->filepath);
}
if ($textfield=='name') {
- $hp->$textfield = $hp->exercisetitle;
+ $hp->$textfield = addslashes($hp->exercisetitle);
} else if ($textfield=='summary') {
- $hp->$textfield = $hp->exercisesubtitle;
+ $hp->$textfield = addslashes($hp->exercisesubtitle);
}
}
switch ($hp->$textsource) {
View
@@ -3,8 +3,8 @@
/// Code fragment to define the version of hotpot
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2005090709; // release date of this version (see note below)
-$module->release = 'v2.1.9'; // human-friendly version name (used in mod/hotpot/lib.php)
+$module->version = 2005090710; // release date of this version (see note below)
+$module->release = 'v2.1.10'; // human-friendly version name (used in mod/hotpot/lib.php)
$module->cron = 0; // period for cron to check this module (secs)
// interpretation of YYYYMMDDXY version numbers
// YYYY : year

0 comments on commit 05b88e8

Please sign in to comment.