Browse Source

CONTRIB-5605: Quotation marks breaks the js-code in game Cryptex.

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
006174a9a3
  1. 5
      CHANGES.md
  2. 3
      cryptex/play.php
  3. 2
      db/upgrade.php
  4. 2
      view.php

5
CHANGES.md

@ -1,7 +1,8 @@
Changes in version 3.36.31.1 (2015123101)
------------------------------------------------------------------
- New: Disable summarize of attempts
- New: Disable summarize of attempts.
- CONTRIB-5605: Quotation marks breaks the js-code in game Cryptex.
Changes in version 3.36.29.1 (2015122901)
------------------------------------------------------------------
- Fix: Coding style
- Fixing coding style.

3
cryptex/play.php

@ -325,10 +325,11 @@ width: 240pt;
$question = game_show_query( $game, $q, "$i. ".$q->questiontext, $context);
$question2 = strip_tags($question); // ADDED BY DP (AUG 2009) - fixes " breaking the Answer button for this question.
echo '<script>var msg='.json_encode( $question2).';</script>';
if (($onlyshow == false) and ($showsolution == false)) {
if (($game->param8 == 0) || ($game->param8 > $q->tries)) {
$question .= ' &nbsp;<input type="submit" value="'.
get_string( 'answer').'" onclick="OnCheck( '.$q->id.',\''.$question2.'\');" />';
get_string( 'answer').'" onclick="OnCheck( '.$q->id.',msg);" />';
}
}
echo $question;

2
db/upgrade.php

@ -1525,7 +1525,7 @@ function xmldb_game_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2015122105, 'game');
}
if ($oldversion < ($ver = 2015123101)) {
if ($oldversion < ($ver = 2015123101)) {
$table = new xmldb_table('game');
$field = new xmldb_field('disablesummarize', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, null, null, '0');
if (!$dbman->field_exists($table, $field)) {

2
view.php

@ -72,7 +72,7 @@ if (game_use_events()) {
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
// Here have to check if not need summarize
// Here have to check if not need summarize.
if ($game->disablesummarize) {
if (game_can_start_new_attempt( $game)) {
require_once( 'attempt.php');

Loading…
Cancel
Save