Browse Source

my message

MOODLE_20_STABLE
bdaloukas 11 years ago
parent
commit
faa9d5d13e
  1. 6
      cryptex/play.php
  2. 12
      hiddenpicture/play.php
  3. 5
      lib.php
  4. 2
      millionaire/play.php
  5. 2
      sudoku/play.php
  6. 4
      version.php

6
cryptex/play.php

@ -266,15 +266,15 @@ width: 240pt;
} }
} }
$question = "$i. ".$q->questiontext; $question = game_show_query( $game, $q, "$i. ".$q->questiontext, $context);
$question = game_filterquestion(str_replace( array( "\'", '\"'), array( "'", '"'), $question), $q->questionid, $context->id, $game->course);
$question2 = strip_tags($question); //ADDED BY DP (AUG 2009) - fixes " breaking the Answer button for this question $question2 = strip_tags($question); //ADDED BY DP (AUG 2009) - fixes " breaking the Answer button for this question
if( ($onlyshow == false) and ($showsolution == false)){ if( ($onlyshow == false) and ($showsolution == false)){
if( ($game->param8 == 0) || ($game->param8 > $q->tries)) if( ($game->param8 == 0) || ($game->param8 > $q->tries))
$question .= ' &nbsp;<input type="submit" value="'.get_string( 'answer').'" onclick="OnCheck( '.$q->id.',\''.$question2.'\');" />'; $question .= ' &nbsp;<input type="submit" value="'.get_string( 'answer').'" onclick="OnCheck( '.$q->id.',\''.$question2.'\');" />';
} }
echo $question;
echo $question;
if( $showsolution){ if( $showsolution){
echo " &nbsp;&nbsp;&nbsp;$q->answertext<B></b>"; echo " &nbsp;&nbsp;&nbsp;$q->answertext<B></b>";
} }

12
hiddenpicture/play.php

@ -260,14 +260,14 @@ function game_hiddenpicture_showhiddenpicture( $id, $game, $attempt, $hiddenpict
//Grade //Grade
echo "<br/>".get_string( 'grade', 'game').' : '.round( $attempt->score * 100).' %'; echo "<br/>".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); $cells = substr( $cells, 1);
$foundcells = substr( $foundcells, 1); $foundcells = substr( $foundcells, 1);
game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, true); 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; global $CFG, $DB;
@ -286,7 +286,10 @@ function game_hiddenpicture_showquestion_glossary( $id, $query)
// Add a hidden field with glossaryentryid // Add a hidden field with glossaryentryid
echo '<input type="hidden" name="glossaryentryid" value="'.$query->glossaryentryid."\" />\n"; echo '<input type="hidden" name="glossaryentryid" value="'.$query->glossaryentryid."\" />\n";
echo game_filtertext( $entry->definition, 0).'<br>'; $temp = $game->glossaryid;
$game->glossaryid = $game->glossaryid2;
echo game_show_query( $game, $query, $entry->definition);
$game->glossaryid = $temp;
echo get_string( 'answer').': '; echo get_string( 'answer').': ';
echo "<input type=\"text\" name=\"answer\" size=30 /><br>"; echo "<input type=\"text\" name=\"answer\" size=30 /><br>";
@ -363,7 +366,7 @@ function game_hiddenpicture_check_questions( $id, $game, &$attempt, &$hiddenpict
return true; 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; global $QTYPES, $CFG, $DB;
@ -480,3 +483,4 @@ function game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, $u
echo "</MAP>"; echo "</MAP>";
} }
} }

5
lib.php

@ -1010,8 +1010,9 @@ function mod_game_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
{ {
$questionid = $args[ 0]; $questionid = $args[ 0];
$file = $args[ 1]; $file = $args[ 1];
$a = explode( '/', $context->path);
if (!$contextcourse = get_context_instance(CONTEXT_COURSE, $course->id)) { $courseid = $a[ 2];
if (!$contextcourse = get_context_instance(CONTEXT_COURSE, $courseid)) {
print_error('nocontext'); print_error('nocontext');
} }
$a = array( 'component' => 'question', 'filearea' => 'questiontext', $a = array( 'component' => 'question', 'filearea' => 'questiontext',

2
millionaire/play.php

@ -177,7 +177,7 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aAnswer,
break; break;
case 12: case 12:
//$question = game_filterquestion($question, $query->questionid, $context->id, $game->course); //$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 "<tr>"; echo "<tr>";
echo "<td rowspan=12 colspan=2 valign=top style=\"$styletext\">$question</td>\r\n"; echo "<td rowspan=12 colspan=2 valign=top style=\"$styletext\">$question</td>\r\n";
$bTR = true; $bTR = true;

2
sudoku/play.php

@ -573,7 +573,7 @@ function game_sudoku_check_glossaryentries( $id, $game, $attempt, $sudoku, $fini
} }
//correct answer //correct answer
$select = "attemptid=$attempt->id"; $select = "attemptid=$attempt->id";
$select .= " AND glossaryentryid=$entry->id"; $select .= " AND glossaryentryid=$entry->id AND col>0";
$query = new stdClass(); $query = new stdClass();
if( ($query->id = $DB->get_field_select( 'game_queries', 'id', $select)) == 0){ if( ($query->id = $DB->get_field_select( 'game_queries', 'id', $select)) == 0){

4
version.php

@ -11,7 +11,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) $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->requires = 2010112400; // Requires Moodle 2.0
$module->cron = 0; // Period for cron to check this module (secs) $module->cron = 0; // Period for cron to check this module (secs)
$module->release = '3.12.1.1'; $module->release = '3.12.2.1';

Loading…
Cancel
Save