public static function get_course_list($id_user, $DB)
 {
     $listid = report_course_manager::extract_course_id_list_from_db($id_user, $DB);
     $listname = report_course_manager::extract_course_name_list_from_db($listid, $DB);
     $final_result = report_course_manager::mapping_course_name_id($listid, $listname, $DB);
     return $final_result;
 }
// check that the user has the right to access this page
$theuser = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
//does the id exists in the database
$usercontext = CONTEXT_USER::instance($theuser->id);
$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) {