Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 07743ad7 authored by Francois Gannaz's avatar Francois Gannaz
Browse files

view: fix confusion coursemodule/moduleinstance

parent af9206d3
......@@ -23,13 +23,13 @@ $id = optional_param('id', 0, PARAM_INT);
$l = optional_param('l', 0, PARAM_INT);
if ($id) {
$cm = get_coursemodule_from_id(LABNBOOK_TABLE, $id, 0, false, MUST_EXIST);
$cm = get_coursemodule_from_id("labnbook", $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$moduleinstance = $DB->get_record(LABNBOOK_TABLE, array('id' => $cm->instance), '*', MUST_EXIST);
} else if ($l) {
$moduleinstance = $DB->get_record(LABNBOOK_TABLE, array('id' => $n), '*', MUST_EXIST);
$moduleinstance = $DB->get_record(LABNBOOK_TABLE, array('id' => $l), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $moduleinstance->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance(LABNBOOK_TABLE, $moduleinstance->id, $course->id, false, MUST_EXIST);
$cm = get_coursemodule_from_instance("labnbook", $moduleinstance->id, $course->id, false, MUST_EXIST);
} else {
print_error(get_string('missingidandcmid', mod_labnbook));
}
......@@ -66,7 +66,7 @@ if (has_capability('moodle/course:manageactivities', context_course::instance($c
$groupids = groups_get_user_groups($cm->course)[0];
$teamconfig = teamconfig::findForGroups($cm->id, $groupids);
if ($teamconfig->method === teamconfig::METHOD_STUDENTCHOICE) {
redirect('/mod/labnbook/teamchoice.php?l=' . (int) $moduleinstance->instance);
redirect('/mod/labnbook/teamchoice.php?l=' . (int) $cm->instance);
return;
} else if ($teamconfig->method === teamconfig::METHOD_TEACHERCHOICE) {
// TODO: warn the teacher that this student lacks a team
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment