From f9cb8ea72f5e0a29481c0fc9caf87df78e3ce2f4 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 17:57:54 +0000 Subject: [PATCH] MDL-20192 Allocation and grading methods are proper subplugins now. Still, some areas to be finished - strings and settings --- mod/workshop/allocation/manual/version.php | 32 ++++++++ mod/workshop/db/install.xml | 76 +------------------ mod/workshop/db/uninstall.php | 41 ++++++++++ .../grading/accumulative/db/install.xml | 20 +++++ mod/workshop/grading/accumulative/version.php | 32 ++++++++ mod/workshop/grading/noerrors/db/install.xml | 35 +++++++++ mod/workshop/grading/noerrors/version.php | 32 ++++++++ mod/workshop/grading/nograding/db/install.xml | 18 +++++ mod/workshop/grading/rubric/db/install.xml | 31 ++++++++ mod/workshop/lib.php | 6 +- 10 files changed, 248 insertions(+), 75 deletions(-) create mode 100644 mod/workshop/allocation/manual/version.php create mode 100644 mod/workshop/db/uninstall.php create mode 100644 mod/workshop/grading/accumulative/db/install.xml create mode 100644 mod/workshop/grading/accumulative/version.php create mode 100644 mod/workshop/grading/noerrors/db/install.xml create mode 100644 mod/workshop/grading/noerrors/version.php create mode 100644 mod/workshop/grading/nograding/db/install.xml create mode 100644 mod/workshop/grading/rubric/db/install.xml diff --git a/mod/workshop/allocation/manual/version.php b/mod/workshop/allocation/manual/version.php new file mode 100644 index 0000000000..8eac2d681a --- /dev/null +++ b/mod/workshop/allocation/manual/version.php @@ -0,0 +1,32 @@ +. + +/** + * Defines the version of manual allocation subplugin + * + * This code fragment is called by moodle_needs_upgrading() and + * /admin/index.php + * + * @package mod-workshop + * @copyright 2009 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2009081300; +$plugin->requires = 2009080700; // Requires this Moodle version diff --git a/mod/workshop/db/install.xml b/mod/workshop/db/install.xml index 6fa1de73ed..18f4f0f4dc 100644 --- a/mod/workshop/db/install.xml +++ b/mod/workshop/db/install.xml @@ -1,5 +1,5 @@ - @@ -105,7 +105,7 @@ - +
@@ -118,77 +118,5 @@
- - - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - -
\ No newline at end of file diff --git a/mod/workshop/db/uninstall.php b/mod/workshop/db/uninstall.php new file mode 100644 index 0000000000..1858cf57bc --- /dev/null +++ b/mod/workshop/db/uninstall.php @@ -0,0 +1,41 @@ +. + +/** + * This file replaces the legacy STATEMENTS section in db/install.xml, + * lib.php/modulename_install() post installation hook and partially defaults.php + * + * @package mod-workshop + * @copyright 2009 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * This is called at the beginning of the uninstallation process to give the module + * a chance to clean-up its hacks, bits etc. where possible. + * + * @return bool true if success + */ +function mod_workshop_uninstall() { + // global $DB; + + // $dbman = $DB->get_manager(); + + return true; +} diff --git a/mod/workshop/grading/accumulative/db/install.xml b/mod/workshop/grading/accumulative/db/install.xml new file mode 100644 index 0000000000..5bfb1e7fce --- /dev/null +++ b/mod/workshop/grading/accumulative/db/install.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/mod/workshop/grading/accumulative/version.php b/mod/workshop/grading/accumulative/version.php new file mode 100644 index 0000000000..3966260003 --- /dev/null +++ b/mod/workshop/grading/accumulative/version.php @@ -0,0 +1,32 @@ +. + +/** + * Defines the version of workshop accumulative grading strategy subplugin + * + * This code fragment is called by moodle_needs_upgrading() and + * /admin/index.php + * + * @package mod-workshop + * @copyright 2009 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2009081300; +$plugin->requires = 2009080700; // Requires this Moodle version diff --git a/mod/workshop/grading/noerrors/db/install.xml b/mod/workshop/grading/noerrors/db/install.xml new file mode 100644 index 0000000000..57c2b7213d --- /dev/null +++ b/mod/workshop/grading/noerrors/db/install.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/mod/workshop/grading/noerrors/version.php b/mod/workshop/grading/noerrors/version.php new file mode 100644 index 0000000000..4487789df0 --- /dev/null +++ b/mod/workshop/grading/noerrors/version.php @@ -0,0 +1,32 @@ +. + +/** + * Defines the version of workshop Number of errors grading strategy subplugin + * + * This code fragment is called by moodle_needs_upgrading() and + * /admin/index.php + * + * @package mod-workshop + * @copyright 2009 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2009081300; +$plugin->requires = 2009080700; // Requires this Moodle version diff --git a/mod/workshop/grading/nograding/db/install.xml b/mod/workshop/grading/nograding/db/install.xml new file mode 100644 index 0000000000..c0989a8c57 --- /dev/null +++ b/mod/workshop/grading/nograding/db/install.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + +
+
+
diff --git a/mod/workshop/grading/rubric/db/install.xml b/mod/workshop/grading/rubric/db/install.xml new file mode 100644 index 0000000000..3ddfa85a79 --- /dev/null +++ b/mod/workshop/grading/rubric/db/install.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 50a69a5bc3..4e73c7137a 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -243,11 +243,15 @@ function workshop_uninstall() { */ function workshop_supports($feature) { switch($feature) { + case FEATURE_GRADE_HAS_GRADE: return true; case FEATURE_GROUPS: return true; case FEATURE_GROUPINGS: return true; case FEATURE_GROUPMEMBERSONLY: return true; case FEATURE_MOD_INTRO: return true; - case FEATURE_GRADE_HAS_GRADE: return true; + case FEATURE_MOD_SUBPLUGINS: return array( + 'workshopgrading' => 'mod/workshop/grading', + 'workshopallocation' => 'mod/workshop/allocation' + ); default: return null; } } -- 2.39.5