Browse Source

CONTRIB-4773 fixed various errors from Tim Lock

MOODLE_20_STABLE
ubuntu 11 years ago
parent
commit
02a46f653a
  1. 2
      print.php
  2. 7
      showanswers.php
  3. 1
      sudoku/play.php
  4. 8
      translate.php
  5. 4
      version.php

2
print.php

@ -33,7 +33,7 @@
{ {
require( "cross/play.php"); require( "cross/play.php");
$attempt = game_getattempt( $game, &$crossrec); $attempt = game_getattempt( $game, $crossrec);
$g = ''; $g = '';
$onlyshow = true; $onlyshow = true;

7
showanswers.php

@ -109,7 +109,7 @@ function game_showusers($game)
function game_showanswers( $game, $existsbook, $context) function game_showanswers( $game, $existsbook, $context)
{ {
if( $game->gamekind == 'bookquiz' and $existsbook){ if( $game->gamekind == 'bookquiz' and $existsbook){
game_showanswers_bookquiz( $game); game_showanswers_bookquiz( $game, $context);
return; return;
} }
@ -398,7 +398,7 @@ function game_showanswers_glossary( $game)
echo "</table><br>\r\n\r\n"; echo "</table><br>\r\n\r\n";
} }
function game_showanswers_bookquiz( $game) function game_showanswers_bookquiz( $game, $context)
{ {
global $CFG; global $CFG;
@ -407,5 +407,6 @@ function game_showanswers_bookquiz( $game)
" AND bc.id = gbq.chapterid"; " AND bc.id = gbq.chapterid";
$table = "{question} q,{game_bookquiz_questions} gbq,{book_chapters} bc"; $table = "{question} q,{game_bookquiz_questions} gbq,{book_chapters} bc";
game_showanswers_question_select( $game, $table, $select, "DISTINCT q.*", "bc.pagenum,questiontext"); $showcategories = ($game->gamekind == 'bookquiz');
game_showanswers_question_select( $game, $table, $select, "DISTINCT q.*", "bc.pagenum,questiontext", $showcategories, $game->course, $context);
} }

1
sudoku/play.php

@ -574,6 +574,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 AND col>0"; $select .= " AND glossaryentryid=$entry->id AND col>0";
$select .= " AND questiontext is null"; // check the student guesses not source glossary entry.
$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){

8
translate.php

@ -166,6 +166,9 @@ sort( $strings);
foreach( $langname as $lang => $name) foreach( $langname as $lang => $name)
{ {
$strings_lang = readlangfile( $lang, $header); $strings_lang = readlangfile( $lang, $header);
if (empty($string_lang)) {
continue;
}
$ret = ''; $ret = '';
foreach( $strings_lang as $key => $value) foreach( $strings_lang as $key => $value)
@ -230,6 +233,9 @@ function readlangfile( $lang, &$header)
global $CFG; global $CFG;
$file = $CFG->dirroot.'/mod/game/lang/'.$lang.'/game.php'; $file = $CFG->dirroot.'/mod/game/lang/'.$lang.'/game.php';
if (!is_file($file)) {
return null;
}
$a = array(); $a = array();
@ -289,7 +295,7 @@ function readsourcecode( $file, &$strings)
$lines = file( $file); $lines = file( $file);
foreach( $lines as $line) foreach( $lines as $line)
{ {
parseline( &$strings, $line, $file); parseline( $strings, $line, $file);
} }
return $strings; return $strings;

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 = 2013122502; // The current module version (Date: YYYYMMDDXX) $module->version = 2013122503; // 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.25.2'; $module->release = '3.12.25.3';

Loading…
Cancel
Save