Skip to content

Commit

Permalink
Fix:Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
bdaloukas committed Dec 28, 2015
1 parent ecf33ae commit 938c92f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
9 changes: 8 additions & 1 deletion classes/event/course_module_instance_list_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
// No code required here as the parent class handles it all.
public static function create_from_course(\stdClass $course) {
$params = array(
'context' => \context_course::instance($course->id)
);
$event = self::create( $params);
$event->add_record_snapshot('course', $course);
return $event;
}
}
8 changes: 8 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,3 +1219,11 @@ function game_get_context_module_instance( $moduleid) {

return get_context_instance( CONTEXT_MODULE, $moduleid);
}

function game_get_context_course_instance( $courseid) {
if (class_exists( 'context_course')) {
return context_course::instance( $courseid);
}

return get_context_instance( CONTEXT_COURSE, $courseid);
}
8 changes: 0 additions & 8 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2117,14 +2117,6 @@ function game_strpos( $haystack, $needle, $offset = 0) {
return textlib_get_instance()->strpos( $haystack, $needle, $offset);
}

function game_get_context_course_instance( $courseid) {
if (class_exists( 'context_course')) {
return context_course::instance( $courseid);
}

return get_context_instance( 50, $courseid);
}

function game_show_query( $game, $query, $text) {
if ($game->glossaryid) {
$cmglossary = get_coursemodule_from_instance('glossary', $game->glossaryid, $game->course);
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
}

$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2015122501; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2015122901; // 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 = '3.36.25.1';
$plugin->release = '3.36.29.1';

if ($useplugin != 2) {
$module = $plugin;
Expand Down

0 comments on commit 938c92f

Please sign in to comment.