Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Disable the exercise module as it's not maintained or upgraded for roles

  • Loading branch information...
commit e27a943788d3a49060eea9e553752c3836f4bdc0 1 parent 1b19e81
moodler authored

Showing 2 changed files with 18 additions and 1 deletion. Show diff stats Hide diff stats

  1. +17 0 lib/db/upgrade.php
  2. +1 1  version.php
17 lib/db/upgrade.php
@@ -33,6 +33,23 @@ function xmldb_main_upgrade($oldversion=0) {
33 33 }
34 34 }
35 35
  36 + if ($oldversion < 2006100601) { /// Disable the exercise module because it's unmaintained
  37 + if ($module = get_record('modules', 'name', 'exercise')) {
  38 + if ($module->visible) {
  39 + // Hide/disable the module entry
  40 + set_field('modules', 'visible', '0', 'id', $module->id);
  41 + // Save existing visible state for all activities
  42 + set_field('course_modules', 'visibleold', '1', 'visible' ,'1', 'module', $module->id);
  43 + set_field('course_modules', 'visibleold', '0', 'visible' ,'0', 'module', $module->id);
  44 + // Hide all activities
  45 + set_field('course_modules', 'visible', '0', 'module', $module->id);
  46 +
  47 + require_once($CFG->dirroot.'/course/lib.php');
  48 + rebuild_course_cache(); // Rebuld cache for all modules because they might have changed
  49 + }
  50 + }
  51 + }
  52 +
36 53 return $result;
37 54 }
38 55
2  version.php
@@ -6,7 +6,7 @@
6 6 // This is compared against the values stored in the database to determine
7 7 // whether upgrades should be performed (see lib/db/*.php)
8 8
9   - $version = 2006100401; // YYYYMMDD = date
  9 + $version = 2006100601; // YYYYMMDD = date
10 10 // XY = increments within a single day
11 11
12 12 $release = '1.7 dev'; // Human-friendly version name

0 comments on commit e27a943

Please sign in to comment.
Something went wrong with that request. Please try again.