diff --git a/CHANGES.md b/CHANGES.md
index 8f0d544..fabd914 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,6 +2,7 @@ Changes in version 3.36.31.1 (2015123101)
------------------------------------------------------------------
- Fix at backup.
- Fix not to show how many correct letters are when printing the crossword.
+- Moodle 3.1 compatibility.
Changes in version 3.36.30.1 (2015123001)
------------------------------------------------------------------
diff --git a/bookquiz/play.php b/bookquiz/play.php
index d80c265..66587d0 100755
--- a/bookquiz/play.php
+++ b/bookquiz/play.php
@@ -210,7 +210,7 @@ function game_bookquiz_play( $id, $game, $attempt, $bookquiz, $chapterid, $conte
$modcontext = game_get_context_module_instance( $cmbook->id);
$content .= game_filterbook( $chapter->content, $chapter->id, $modcontext->id, $game->course);
- $nocleanoption = new object();
+ $nocleanoption = new stdClass;
$nocleanoption->noclean = true;
echo '
';
if ($nextbutton != '') {
diff --git a/bookquiz/view.php b/bookquiz/view.php
index 78289a9..9d7cee6 100755
--- a/bookquiz/view.php
+++ b/bookquiz/view.php
@@ -211,7 +211,7 @@ if (!$book->customtitles) {
$content .= $chapter->content;
-$nocleanoption = new object();
+$nocleanoption = new stdClass;
$nocleanoption->noclean = true;
echo '
';
echo format_text($content, FORMAT_HTML, $nocleanoption, $course->id);
diff --git a/lib.php b/lib.php
index 22eefcd..077594e 100755
--- a/lib.php
+++ b/lib.php
@@ -423,7 +423,7 @@ function game_update_grades($game=null, $userid=0, $nullifnone=true) {
game_grade_item_update($game, $grades);
} else if ($userid and $nullifnone) {
- $grade = new object();
+ $grade = new stdClass;
$grade->userid = $userid;
$grade->rawgrade = null;
game_grade_item_update( $game, $grade);
@@ -583,7 +583,7 @@ function game_get_recent_mod_activity(&$activities, &$index, $timestart, $course
}
}
- $tmpactivity = new object();
+ $tmpactivity = new stdClass;
$tmpactivity->type = 'game';
$tmpactivity->gameid = $attempt->gameid;
@@ -592,13 +592,13 @@ function game_get_recent_mod_activity(&$activities, &$index, $timestart, $course
$tmpactivity->sectionnum = $cm->sectionnum;
$tmpactivity->timestamp = $attempt->timefinish;
- $tmpactivity->content = new object();
+ $tmpactivity->content = new stdClass;
$tmpactivity->content->attemptid = $attempt->id;
$tmpactivity->content->sumgrades = $attempt->score * $attempt->grade;
$tmpactivity->content->maxgrade = $attempt->grade;
$tmpactivity->content->attempt = $attempt->attempt;
- $tmpactivity->user = new object();
+ $tmpactivity->user = new stdClass;
$tmpactivity->user->userid = $tmpactivity->user->id = $attempt->userid;
$tmpactivity->user->fullname = fullname($attempt, $viewfullnames);
$tmpactivity->user->firstname = $attempt->firstname;
@@ -875,7 +875,7 @@ function game_get_types() {
$types = array();
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game_group_start";
$type->typestr = '--'.get_string( 'modulenameplural', 'game');
@@ -884,7 +884,7 @@ function game_get_types() {
$hide = ( isset( $config->hidehangman) ? ($config->hidehangman != 0) : false);
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=hangman";
$type->typestr = get_string('game_hangman', 'game');
@@ -898,7 +898,7 @@ function game_get_types() {
}
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=cross";
$type->typestr = get_string('game_cross', 'game');
@@ -912,7 +912,7 @@ function game_get_types() {
}
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=cryptex";
$type->typestr = get_string('game_cryptex', 'game');
@@ -921,7 +921,7 @@ function game_get_types() {
$hide = (isset( $config->hidemillionaire) ? ($config->hidemillionaire != 0) : false);
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=millionaire";
$type->typestr = get_string('game_millionaire', 'game');
@@ -930,7 +930,7 @@ function game_get_types() {
$hide = (isset( $config->hidesudoku) ? ($config->hidesudoku != 0) : false);
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=sudoku";
$type->typestr = get_string('game_sudoku', 'game');
@@ -939,7 +939,7 @@ function game_get_types() {
$hide = (isset( $config->hidesnakes) ? ($config->hidesnakes != 0) : false);
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=snakes";
$type->typestr = get_string('game_snakes', 'game');
@@ -948,7 +948,7 @@ function game_get_types() {
$hide = (isset( $config->hidehiddenpicture) ? ($config->hidehiddenpicture != 0) : false);
if ($hide == false) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=hiddenpicture";
$type->typestr = get_string('game_hiddenpicture', 'game');
@@ -958,7 +958,7 @@ function game_get_types() {
$hide = (isset( $config->hidebookquiz) ? ($config->hidebookquiz != 0) : false);
if ($hide == false) {
if ($DB->get_record( 'modules', array( 'name' => 'book'), 'id,id')) {
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&type=bookquiz";
$type->typestr = get_string('game_bookquiz', 'game');
@@ -966,7 +966,7 @@ function game_get_types() {
}
}
- $type = new object();
+ $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game_group_end";
$type->typestr = '--';
diff --git a/version.php b/version.php
index 5532a4e..08eb2ff 100755
--- a/version.php
+++ b/version.php
@@ -36,7 +36,7 @@ if (!isset( $plugin)) {
}
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
-$plugin->version = 2015123001; // The current module version (Date: YYYYMMDDXX).
+$plugin->version = 2015123002; // 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 = '2015-12-30';