Browse Source

Moodle 3.1 compatibility.

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
2b344cae64
  1. 1
      CHANGES.md
  2. 2
      bookquiz/play.php
  3. 2
      bookquiz/view.php
  4. 28
      lib.php
  5. 2
      version.php

1
CHANGES.md

@ -2,6 +2,7 @@ Changes in version 3.36.31.1 (2015123101)
------------------------------------------------------------------ ------------------------------------------------------------------
- Fix at backup. - Fix at backup.
- Fix not to show how many correct letters are when printing the crossword. - 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) Changes in version 3.36.30.1 (2015123001)
------------------------------------------------------------------ ------------------------------------------------------------------

2
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); $modcontext = game_get_context_module_instance( $cmbook->id);
$content .= game_filterbook( $chapter->content, $chapter->id, $modcontext->id, $game->course); $content .= game_filterbook( $chapter->content, $chapter->id, $modcontext->id, $game->course);
$nocleanoption = new object(); $nocleanoption = new stdClass;
$nocleanoption->noclean = true; $nocleanoption->noclean = true;
echo '<div>'; echo '<div>';
if ($nextbutton != '') { if ($nextbutton != '') {

2
bookquiz/view.php

@ -211,7 +211,7 @@ if (!$book->customtitles) {
$content .= $chapter->content; $content .= $chapter->content;
$nocleanoption = new object(); $nocleanoption = new stdClass;
$nocleanoption->noclean = true; $nocleanoption->noclean = true;
echo '<div class="book_content">'; echo '<div class="book_content">';
echo format_text($content, FORMAT_HTML, $nocleanoption, $course->id); echo format_text($content, FORMAT_HTML, $nocleanoption, $course->id);

28
lib.php

@ -423,7 +423,7 @@ function game_update_grades($game=null, $userid=0, $nullifnone=true) {
game_grade_item_update($game, $grades); game_grade_item_update($game, $grades);
} else if ($userid and $nullifnone) { } else if ($userid and $nullifnone) {
$grade = new object(); $grade = new stdClass;
$grade->userid = $userid; $grade->userid = $userid;
$grade->rawgrade = null; $grade->rawgrade = null;
game_grade_item_update( $game, $grade); 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->type = 'game';
$tmpactivity->gameid = $attempt->gameid; $tmpactivity->gameid = $attempt->gameid;
@ -592,13 +592,13 @@ function game_get_recent_mod_activity(&$activities, &$index, $timestart, $course
$tmpactivity->sectionnum = $cm->sectionnum; $tmpactivity->sectionnum = $cm->sectionnum;
$tmpactivity->timestamp = $attempt->timefinish; $tmpactivity->timestamp = $attempt->timefinish;
$tmpactivity->content = new object(); $tmpactivity->content = new stdClass;
$tmpactivity->content->attemptid = $attempt->id; $tmpactivity->content->attemptid = $attempt->id;
$tmpactivity->content->sumgrades = $attempt->score * $attempt->grade; $tmpactivity->content->sumgrades = $attempt->score * $attempt->grade;
$tmpactivity->content->maxgrade = $attempt->grade; $tmpactivity->content->maxgrade = $attempt->grade;
$tmpactivity->content->attempt = $attempt->attempt; $tmpactivity->content->attempt = $attempt->attempt;
$tmpactivity->user = new object(); $tmpactivity->user = new stdClass;
$tmpactivity->user->userid = $tmpactivity->user->id = $attempt->userid; $tmpactivity->user->userid = $tmpactivity->user->id = $attempt->userid;
$tmpactivity->user->fullname = fullname($attempt, $viewfullnames); $tmpactivity->user->fullname = fullname($attempt, $viewfullnames);
$tmpactivity->user->firstname = $attempt->firstname; $tmpactivity->user->firstname = $attempt->firstname;
@ -875,7 +875,7 @@ function game_get_types() {
$types = array(); $types = array();
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game_group_start"; $type->type = "game_group_start";
$type->typestr = '--'.get_string( 'modulenameplural', 'game'); $type->typestr = '--'.get_string( 'modulenameplural', 'game');
@ -884,7 +884,7 @@ function game_get_types() {
$hide = ( isset( $config->hidehangman) ? ($config->hidehangman != 0) : false); $hide = ( isset( $config->hidehangman) ? ($config->hidehangman != 0) : false);
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=hangman"; $type->type = "game&amp;type=hangman";
$type->typestr = get_string('game_hangman', 'game'); $type->typestr = get_string('game_hangman', 'game');
@ -898,7 +898,7 @@ function game_get_types() {
} }
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=cross"; $type->type = "game&amp;type=cross";
$type->typestr = get_string('game_cross', 'game'); $type->typestr = get_string('game_cross', 'game');
@ -912,7 +912,7 @@ function game_get_types() {
} }
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=cryptex"; $type->type = "game&amp;type=cryptex";
$type->typestr = get_string('game_cryptex', 'game'); $type->typestr = get_string('game_cryptex', 'game');
@ -921,7 +921,7 @@ function game_get_types() {
$hide = (isset( $config->hidemillionaire) ? ($config->hidemillionaire != 0) : false); $hide = (isset( $config->hidemillionaire) ? ($config->hidemillionaire != 0) : false);
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=millionaire"; $type->type = "game&amp;type=millionaire";
$type->typestr = get_string('game_millionaire', 'game'); $type->typestr = get_string('game_millionaire', 'game');
@ -930,7 +930,7 @@ function game_get_types() {
$hide = (isset( $config->hidesudoku) ? ($config->hidesudoku != 0) : false); $hide = (isset( $config->hidesudoku) ? ($config->hidesudoku != 0) : false);
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=sudoku"; $type->type = "game&amp;type=sudoku";
$type->typestr = get_string('game_sudoku', 'game'); $type->typestr = get_string('game_sudoku', 'game');
@ -939,7 +939,7 @@ function game_get_types() {
$hide = (isset( $config->hidesnakes) ? ($config->hidesnakes != 0) : false); $hide = (isset( $config->hidesnakes) ? ($config->hidesnakes != 0) : false);
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=snakes"; $type->type = "game&amp;type=snakes";
$type->typestr = get_string('game_snakes', 'game'); $type->typestr = get_string('game_snakes', 'game');
@ -948,7 +948,7 @@ function game_get_types() {
$hide = (isset( $config->hidehiddenpicture) ? ($config->hidehiddenpicture != 0) : false); $hide = (isset( $config->hidehiddenpicture) ? ($config->hidehiddenpicture != 0) : false);
if ($hide == false) { if ($hide == false) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=hiddenpicture"; $type->type = "game&amp;type=hiddenpicture";
$type->typestr = get_string('game_hiddenpicture', 'game'); $type->typestr = get_string('game_hiddenpicture', 'game');
@ -958,7 +958,7 @@ function game_get_types() {
$hide = (isset( $config->hidebookquiz) ? ($config->hidebookquiz != 0) : false); $hide = (isset( $config->hidebookquiz) ? ($config->hidebookquiz != 0) : false);
if ($hide == false) { if ($hide == false) {
if ($DB->get_record( 'modules', array( 'name' => 'book'), 'id,id')) { if ($DB->get_record( 'modules', array( 'name' => 'book'), 'id,id')) {
$type = new object(); $type = new stdClass;
$type->modclass = MOD_CLASS_ACTIVITY; $type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game&amp;type=bookquiz"; $type->type = "game&amp;type=bookquiz";
$type->typestr = get_string('game_bookquiz', 'game'); $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->modclass = MOD_CLASS_ACTIVITY;
$type->type = "game_group_end"; $type->type = "game_group_end";
$type->typestr = '--'; $type->typestr = '--';

2
version.php

@ -36,7 +36,7 @@ if (!isset( $plugin)) {
} }
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). $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->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs). $plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2015-12-30'; $plugin->release = '2015-12-30';

Loading…
Cancel
Save