From faa9d5d13eda2ea599c70d41a9fe17cde1cf2d4d Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Mon, 2 Dec 2013 01:49:49 +0200 Subject: [PATCH] my message --- cryptex/play.php | 6 +++--- hiddenpicture/play.php | 12 ++++++++---- lib.php | 5 +++-- millionaire/play.php | 2 +- sudoku/play.php | 2 +- version.php | 4 ++-- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/cryptex/play.php b/cryptex/play.php index ff904f5..a6c0543 100755 --- a/cryptex/play.php +++ b/cryptex/play.php @@ -266,15 +266,15 @@ width: 240pt; } } - $question = "$i. ".$q->questiontext; - $question = game_filterquestion(str_replace( array( "\'", '\"'), array( "'", '"'), $question), $q->questionid, $context->id, $game->course); + $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 + if( ($onlyshow == false) and ($showsolution == false)){ if( ($game->param8 == 0) || ($game->param8 > $q->tries)) $question .= '  '; } + echo $question; - echo $question; if( $showsolution){ echo "    $q->answertext"; } diff --git a/hiddenpicture/play.php b/hiddenpicture/play.php index aa728b5..acc3411 100755 --- a/hiddenpicture/play.php +++ b/hiddenpicture/play.php @@ -260,14 +260,14 @@ function game_hiddenpicture_showhiddenpicture( $id, $game, $attempt, $hiddenpict //Grade echo "
".get_string( 'grade', 'game').' : '.round( $attempt->score * 100).' %'; - game_hiddenpicture_showquestion_glossary( $id, $query); + game_hiddenpicture_showquestion_glossary( $game, $id, $query); $cells = substr( $cells, 1); $foundcells = substr( $foundcells, 1); game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, true); } -function game_hiddenpicture_showquestion_glossary( $id, $query) +function game_hiddenpicture_showquestion_glossary( $game, $id, $query) { global $CFG, $DB; @@ -286,7 +286,10 @@ function game_hiddenpicture_showquestion_glossary( $id, $query) // Add a hidden field with glossaryentryid echo '\n"; - echo game_filtertext( $entry->definition, 0).'
'; + $temp = $game->glossaryid; + $game->glossaryid = $game->glossaryid2; + echo game_show_query( $game, $query, $entry->definition); + $game->glossaryid = $temp; echo get_string( 'answer').': '; echo "
"; @@ -363,7 +366,7 @@ function game_hiddenpicture_check_questions( $id, $game, &$attempt, &$hiddenpict return true; } -function game_hiddenpicture_check_mainquestion( $id, $game, &$attempt, &$hiddenpicture, $finishattempt) +function game_hiddenpicture_check_mainquestion( $id, $game, &$attempt, &$hiddenpicture, $finishattempt, $context) { global $QTYPES, $CFG, $DB; @@ -480,3 +483,4 @@ function game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, $u echo ""; } } + diff --git a/lib.php b/lib.php index 383705e..96d8d97 100755 --- a/lib.php +++ b/lib.php @@ -1010,8 +1010,9 @@ function mod_game_pluginfile($course, $cm, $context, $filearea, $args, $forcedow { $questionid = $args[ 0]; $file = $args[ 1]; - - if (!$contextcourse = get_context_instance(CONTEXT_COURSE, $course->id)) { + $a = explode( '/', $context->path); + $courseid = $a[ 2]; + if (!$contextcourse = get_context_instance(CONTEXT_COURSE, $courseid)) { print_error('nocontext'); } $a = array( 'component' => 'question', 'filearea' => 'questiontext', diff --git a/millionaire/play.php b/millionaire/play.php index fb4b1b2..d0029d1 100755 --- a/millionaire/play.php +++ b/millionaire/play.php @@ -177,7 +177,7 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aAnswer, break; case 12: //$question = game_filterquestion($question, $query->questionid, $context->id, $game->course); - $question = game_show_query( $game, $query, $question, $context); + $question = game_show_query( $game, $query, $question); echo ""; echo "$question\r\n"; $bTR = true; diff --git a/sudoku/play.php b/sudoku/play.php index 3fbb084..1ed1cc5 100755 --- a/sudoku/play.php +++ b/sudoku/play.php @@ -573,7 +573,7 @@ function game_sudoku_check_glossaryentries( $id, $game, $attempt, $sudoku, $fini } //correct answer $select = "attemptid=$attempt->id"; - $select .= " AND glossaryentryid=$entry->id"; + $select .= " AND glossaryentryid=$entry->id AND col>0"; $query = new stdClass(); if( ($query->id = $DB->get_field_select( 'game_queries', 'id', $select)) == 0){ diff --git a/version.php b/version.php index 739a9c2..d79b963 100755 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die(); $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$module->version = 2013120101; // The current module version (Date: YYYYMMDDXX) +$module->version = 2013120201; // The current module version (Date: YYYYMMDDXX) $module->requires = 2010112400; // Requires Moodle 2.0 $module->cron = 0; // Period for cron to check this module (secs) -$module->release = '3.12.1.1'; +$module->release = '3.12.2.1';