$PAGE->set_pagelayout('report');
$PAGE->set_context(context_system::instance());
$PAGE->set_url(new moodle_url('/report/studentreport/index.php', array('userid' => $theuser->id)));
$PAGE->set_title(get_string('pluginname', 'report_studentreport'));
$PAGE->set_heading(get_string('pluginname', 'report_studentreport'));
echo $OUTPUT->header();
/*extaction of all courses (id and names) that this user is rolled in */
$courseListDisplay = report_course_manager::get_course_list($theuser->id, $DB);
/*extaction of all domaines */
$courseListDomaine = report_course_manager::extract_list_domaine($courseListDisplay, $DB);
/*mapping courses et domaines*/
$courseListFinal = report_course_manager::mapping_final_course_domaine($courseListDisplay, $courseListDomaine);
/*extraction of the activities related to the course : id,name,maximum_mark, student_mark*/
$listiditems = report_activities_manager::extract_items_id_list_from_db($courseListDisplay, $DB);
$listname = report_activities_manager::extract_info_grades_list_from_db($listiditems, $DB);
$listgradeuser = report_activities_manager::extract_user_grades_list_from_db($listiditems, $theuser->id, $DB);
/*Final table with activities information and the student's marks in every activity*/
$listitems = report_activities_manager::mapping_data_activities($listiditems, $listname, $listgradeuser, $DB);
/*arrays for the radar chart*/
$tabModule = array();
$tabNote = array();
$tabMoyenne = array();
foreach ($courseListDomaine as $key1 => $var1) {
    echo "<div id=\"cadreDomaine\"><a href=\"javascript:unhide('__" . $key1 . "');\"><font color=\"white\">{$var1}</font></a><br /></div>\n";
    // affichage nom domaine
    echo "<div id=\"__" . $key1 . "\" class=\"hidden\">";
    if (is_array($courseListFinal) and $courseListFinal != null) {
        $count_cor = 0;
        // calculer nombre de module dans le domaine courant
        foreach ($courseListFinal as $var2) {
            if ($var2["domaine"] == $var1) {