Grouptool
Maintained by
AMC Academic Moodle Cooperation
With the Grouptool activity, teachers can create groups and give students the opportunity to register and deregister for these groups independently or, if necessary, to register for waiting lists.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
"immediate enrolment (checkbox)" - are you talking about enrolling into a group, becoming a member to group? I'm confused by your use of 'enrollment' here. Thanks
And if you need the changes right now and are familiar with PHP or have at least access to the Moodle's source code, you can replace line 254 of "YOURMOODLEDIR"/mod/grouptool/locallib.php with
$data[$key] .= substr($member->$tag, 0, 5);
(Attention: The line number is only valid for the Version v3.3.1 and may differ in other versions!)
But please be aware that the master branch is subject to possible rebases/resets in the current state of our development process.
LINE 2: ... SELECT grp.id id, agrp.id agrpid, MAX(grp.name) name, MAX(...
^
SELECT grp.id id, agrp.id agrpid, MAX(grp.name) name, MAX(agrp.sort_order) sort_order
FROM mdl_groups grp LEFT JOIN mdl_grouptool_agrps agrp ON agrp.groupid = grp.id
LEFT JOIN mdl_groupings_groups ON mdl_groupings_groups.groupid = grp.id
LEFT JOIN mdl_groupings grpgs ON mdl_groupings_groups.groupingid = grpgs.id
WHERE agrp.grouptoolid = $1 AND agrp.active = 1
GROUP BY grp.id, agrp.id
ORDER BY sort_order ASC, name ASC
[array (
0 => '1',
)]
Error code: dmlreadexception
Stack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 785 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 3097 of /mod/grouptool/locallib.php: call to pgsql_native_moodle_database->get_records_sql()
line 4019 of /mod/grouptool/locallib.php: call to mod_grouptool->get_active_groups()
line 752 of /mod/grouptool/lib.php: call to mod_grouptool->get_registration_stats()
line 47 of /blocks/course_overview/locallib.php: call to grouptool_print_overview()
line 75 of /blocks/course_overview/block_course_overview.php: call to block_course_overview_get_overviews()
line 288 of /blocks/moodleblock.class.php: call to block_course_overview->get_content()
line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 973 of /lib/blocklib.php: call to block_base->get_content_for_output()
line 1025 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 476 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
line 39 of /theme/bootstrapbase/renderers/core_renderer.php: call to core_renderer->standard_head_html()
line 47 of /theme/pioneer/layout/frontpage.php: call to theme_bootstrapbase_core_renderer->standard_head_html()
line 1018 of /lib/outputrenderers.php: call to include()
line 948 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 164 of /my/index.php: call to core_renderer->header()
#############
mod_grouptool (an add-on) is not quite coded directly.
The SQL should be:
SELECT grp.id id, agrp.id agrpid, MAX(grp.name) AS name, MAX(agrp.sort_order) AS sort_order
FROM mdl_groups grp LEFT JOIN mdl_grouptool_agrps agrp ON agrp.groupid = grp.id
LEFT JOIN mdl_groupings_groups ON mdl_groupings_groups.groupid = grp.id
LEFT JOIN mdl_groupings grpgs ON mdl_groupings_groups.groupingid = grpgs.id
WHERE agrp.grouptoolid = ? AND agrp.active = 1
GROUP BY grp.id, agrp.id
ORDER BY sort_order ASC, name ASC
See point 12 here: https://docs.moodle.org/dev/Database
---------------------------------------------
https://github.com/academic-moodle-cooperation/moodle-mod_grouptool/issues/7