Browse Source

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

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
dac0a0e456
  1. 4
      cryptex/play.php

4
cryptex/play.php

@ -325,11 +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>';
echo "<script>var msg{$q->id}=".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.',msg);" />';
get_string( 'answer').'" onclick="OnCheck( '.$q->id.",msg{$q->id});\" />";
}
}
echo $question;

Loading…
Cancel
Save