Skip to content

Commit

Permalink
CONTRIB-5605: Quotation marks breaks the js-code in game Cryptex.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdaloukas committed Dec 29, 2015
1 parent 0203d1e commit 006174a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 1 deletion cryptex/play.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ function OnEndGame()
$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;
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$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');
Expand Down

0 comments on commit 006174a

Please sign in to comment.