-
DELARUELLE Myriam authoredDELARUELLE Myriam authored
suivi_unit.php 17.40 KiB
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
*
* @package format_iena
* @copyright 2018 Softia/Université lorraine
* @author vrignaud camille / Thomas Fradet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
require_once('../../../config.php');
//require_once('view/view_param_indicateur.php');
require_once('entity/course_format_iena_section_ressources.php');
require_once('entity/course_format_iena_sections.php');
require_once('entity/course_format_iena_groups.php');
require_once($CFG->dirroot.'/course/modlib.php');
use core_completion\cm_completion_details;
$PAGE->requires->css('/course/format/iena/styles.css');
global $COURSE, $DB, $USER, $PAGE;
function init_page($course) {
global $PAGE;
// Defines the id of the course with a get parameter.
// Getting DB information (*) of the course.
$PAGE->set_title($course->fullname);
$PAGE->set_heading($course->fullname . " – " .get_string('table_progress', 'format_iena'));
$PAGE->set_pagelayout('incourse');
// Cache le menu dans le header.
$coursenode = $PAGE->navbar->add(get_string('table_progress', 'format_iena'),
null, navigation_node::TYPE_CONTAINER, null, 'suiviena');
$coursenode->make_active();
$coursenode->force_open();
}
function get_groups($context, $activegroupids, $groups) {
global $USER, $COURSE;
// Groupe du GET provenant du sélecteur de la page du cours
// ou premier groupe de l'utilisateur, ou groupe 0 (tous les groupes).
$groupsall = new StdClass();
// TODO à supprimer si pas utilisé dans le JS (mettre dans la clause IF pour éviter un appel inutile si le GET existe).
$currentusergroupsids = groups_get_user_groups($COURSE->id, $USER->id)[0];
$currentusergroups = [];
$othergroups = [];
// Groupes du cours avec id, nom et liste des id utilisateur de tous les
// membres (3 clefs d'un tableau de groupes : id, name, member).