Browse Source

Fix Moodle 31 compatibility

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
6036c8c372
  1. 3
      db/install.xml
  2. 2
      db/upgrade.php
  3. 7
      exportjavame.php
  4. 2
      locallib.php
  5. 4
      version.php

3
db/install.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/game/db" VERSION="20151229" COMMENT="XMLDB file for Moodle mod/game"
<XMLDB PATH="mod/game/db" VERSION="20160614" COMMENT="XMLDB file for Moodle mod/game"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
@ -46,6 +46,7 @@
<FIELD NAME="maxattempts" TYPE="int" LENGTH="3" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="userlanguage" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="disablesummarize" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="glossaryonlyapproved" TYPE="int" LENGTH="1" NOTNULL="false" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>

2
db/upgrade.php

@ -1535,7 +1535,7 @@ function xmldb_game_upgrade($oldversion) {
upgrade_mod_savepoint(true, $ver, 'game');
}
if ($oldversion < ($ver = 2016031202)) {
if ($oldversion < ($ver = 2016061402)) {
$table = new xmldb_table('game');
$field = new xmldb_field('glossaryonlyapproved', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, null, null, '0');
if (!$dbman->field_exists($table, $field)) {

7
exportjavame.php

@ -106,7 +106,10 @@ function game_exportjavame_exportdata( $src, $destmobiledir, $destdir, $game, $m
if ($lang == '') {
$lang = current_language();
}
copy( $src. '/lang/'.$lang.'/language.txt', $destdir."/$destmobiledir/language.txt");
$sourcefile = $src. '/lang/'.$lang.'/language.txt';
if( !file_exists( $sourcefile))
$sourcefile = $src. '/lang/'.$lang.'_utf8/language.txt';
copy( $sourcefile, $destdir."/$destmobiledir/language.txt");
$exportattachment = ( $destmobiledir == 'hangmanp');
@ -342,7 +345,7 @@ function game_create_jar( $srcdir, $course, $javame) {
$cmd = "cd $srcdir;jar cvfm $filejar META-INF/MANIFEST.MF *";
exec( $cmd);
return (file_exists( $filejar) ? "{$javame->filename}.jar" : '');
return (file_exists( $filejar) ? $filejar : '');
}
function game_showanswers_appendselect( $form) {

2
locallib.php

@ -1780,7 +1780,7 @@ function game_export_createtempdir() {
srand( (double)microtime() * 1000000);
while (true) {
$rbasedir = "game/".date("Y-m-d H.i.s-").rand(0, 10000);
$rbasedir = "game/".date("Y-m-d-H.i.s-").rand(0, 10000);
$newdir = $CFG->dataroot.'/temp/'.$rbasedir;
if (!file_exists( $newdir)) {
mkdir( $newdir);

4
version.php

@ -36,10 +36,10 @@ if (!isset( $plugin)) {
}
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2016043101; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2016061402; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2016-04-31';
$plugin->release = '2016-06-14';
if ($useplugin != 2) {
$module = $plugin;

Loading…
Cancel
Save