'; $header .= ''. Display::return_icon(('back.png'),get_lang('FolderView')) . get_lang('FolderView') . ''; if ($evalobj->get_course_code() == null) { $header .= '' . get_lang('AddStudent') . ' ' . get_lang('AddStudent') . ''; } elseif (!$evalobj->has_results()) { $header .= '' . get_lang('AddResult') . ' ' . get_lang('AddResult') . ''; } $header .= '' . ' ' . get_lang('ImportResult') . ''; if ($evalobj->has_results()) { $header .= '' . ' ' . get_lang('ExportResult') . ''; $header .= '' . get_lang('EditResult') . ' ' . get_lang('EditResult') . ''; $header .= '' . ' ' . get_lang('DeleteResult') . ''; } $header .= '' . get_lang('Print') . ' ' . get_lang('Print') . ''; $header .= ''; } if ($evalobj->is_visible() == '1') { $visible= get_lang('Yes'); } else { $visible= get_lang('No'); } $scoredisplay = ScoreDisplay :: instance(); if (($evalobj->has_results())){ // TODO this check needed ? $score= $evalobj->calc_score(); if ($score != null) $average= get_lang('Average') . ' : ' .$scoredisplay->display_score($score,SCORE_AVERAGE) . ''; } if (!$evalobj->get_description() == '') { $description= get_lang('Description') . ' : ' . $evalobj->get_description() . '
'; } if ($evalobj->get_course_code() == null) { $course= get_lang('CourseIndependent'); } else { $course= get_course_name_from_code($evalobj->get_course_code()); } $evalinfo= '
'; $evalinfo .= get_lang('EvaluationName') . ' : ' . $evalobj->get_name() . ' (' . api_format_date($evalobj->get_date(), "%d/%m/%Y %R") . ')
' . get_lang('Course') . ' : ' . $course . '
' . get_lang('Weight') . ' : ' . $evalobj->get_weight() . '
' . get_lang('Max') . ' : ' . $evalobj->get_max() . '
' . $description . get_lang('Visible') . ' : ' . $visible . '
' . $average; if (!$evalobj->has_results()) $evalinfo .= '
' . get_lang('NoResultsInEvaluation') . ''; elseif ($scoredisplay->is_custom() && api_get_self() != '/dokeos/main/gradebook/gradebook_statistics.php') $evalinfo .= '

'. get_lang('ViewStatistics') . ''; $evalinfo .= '
'; Display :: display_normal_message($evalinfo,false); echo $header; } /** * Displays the header for the flatview page containing filters * @param $catobj * @param $showeval * @param $showlink */ function display_header_flatview($catobj, $showeval, $showlink,$simple_search_form) { $header= ''; $header .= ''; $header .= ''; if (!$catobj->get_id() == '0') { $header .= ''; } $header .= ''; $header .= '
' . Display::return_icon('gradebook.gif') . get_lang('Gradebook') . '' . get_lang('FilterCategory') . '
'.get_lang('Up').''.$simple_search_form->toHtml().' . get_lang( ' . get_lang('ExportPDF') . ''; $header .= ' . get_lang( ' . get_lang('Print') . ''; $header .= '
'; if (!$catobj->get_id() == '0') { $header .= '
Show Evaluations  '; $header .= ''.get_lang('ShowLinks').'
'; } if (isset ($_GET['search'])) { $header .= ''.get_lang('SearchResults').' :'; } echo $header; } /** * Displays the header for the flatview page containing filters * @param $catobj * @param $showeval * @param $showlink */ function display_header_reduce_flatview($catobj, $showeval, $showlink,$simple_search_form) { $header = '
'; $header .= ''. Display::return_icon('back.png',get_lang('FolderView')) . get_lang('FolderView') . ''; // $header .= ' . get_lang( ' . get_lang('ExportPDF') . ''; // this MUST be a GET variable not a POST if (isset($_GET['show'])) { $show=Security::remove_XSS($_GET['show']); } else { $show=''; } echo '
'; echo ''; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo '
'; $header .= ''.Display::return_icon('csv.gif', get_lang('ExportAsCSV')).' '.get_lang('ExportAsCSV').''; $header .= ''.Display::return_icon('excel.gif', get_lang('ExportAsXLS')).' '.get_lang('ExportAsXLS').''; $header .= ''.Display::return_icon('printmgr.gif', get_lang('Print')).' ' . get_lang('Print') . ''; $header .= ''.Display::return_icon('file_pdf.gif', get_lang('ExportToPDF')).' ' . get_lang('ExportToPDF') . ''; //exportpdf //
$header .= '
'; if (!$catobj->get_id() == '0') { //this is necessary? //$header .= '
Show Evaluations  '; //$header .= ''.get_lang('ShowLinks').'
'; } /* if (isset ($_GET['search'])) { $header .= ''.get_lang('SearchResults').' :'; }*/ echo $header; } /** * Displays the header for the gradebook containing the navigation tree and links * @param category_object $currentcat * @param int $showtree '1' will show the browse tree and naviation buttons * @param boolean $is_course_admin * @param boolean $is_platform_admin * @param boolean Whether to show or not the link to add a new qualification (we hide it in case of the course-embedded tool where we have only one calification per course or session) * @param boolean Whether to show or not the link to add a new item inside the qualification (we hide it in case of the course-embedded tool where we have only one calification per course or session) * @return void Everything is printed on screen upon closing */ function display_header_gradebook($catobj, $showtree, $selectcat, $is_course_admin, $is_platform_admin, $simple_search_form, $show_add_qualification = true, $show_add_link = true) { //student $status=CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id()); $objcat=new Category(); //$objdat=new Database(); $course_id=Database::get_course_by_category($selectcat); $message_resource=$objcat->show_message_resource_delete($course_id); if (!$is_course_admin && $status<>1 && $selectcat<>0) { $user_id = api_get_user_id(); $user= get_user_info_from_id($user_id); $catcourse= Category :: load($catobj->get_id()); $scoredisplay = ScoreDisplay :: instance(); $scorecourse = $catcourse[0]->calc_score($user_id); // generating the total score for a course $allevals= $catcourse[0]->get_evaluations($user_id,true); $alllinks= $catcourse[0]->get_links($user_id,true); $evals_links = array_merge($allevals, $alllinks); $item_value=0; $item_total=0; for ($count=0; $count < count($evals_links); $count++) { $item = $evals_links[$count]; $score = $item->calc_score($user_id); $my_score_denom=($score[1]==0) ? 1 : $score[1]; $item_value+=$score[0]/$my_score_denom*$item->get_weight(); $item_total+=$item->get_weight(); //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT); } $item_value = number_format($item_value, 2, '.', ' '); $total_score=array($item_value,$item_total); $scorecourse_display = $scoredisplay->display_score($total_score,SCORE_DIV_PERCENT); //---------------------- //$scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable')); $cattotal = Category :: load(0); $scoretotal= $cattotal[0]->calc_score(api_get_user_id()); $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal,SCORE_PERCENT) : get_lang('NoResultsAvailable')); $scoreinfo = get_lang('StatsStudent') . ' : '.api_get_person_name($user['firstname'], $user['lastname']).'
'; if ((!$catobj->get_id() == '0') && (!isset ($_GET['studentoverview'])) && (!isset ($_GET['search']))) { $scoreinfo.= '
'.get_lang('Total') . ' : ' . $scorecourse_display . ''; } //$scoreinfo.= '
'.get_lang('Total') . ' : ' . $scoretotal_display . ''; Display :: display_normal_message($scoreinfo,false); } // show navigation tree and buttons? $header=''; $header .= '
'; if (($showtree == '1') || (isset ($_GET['studentoverview']))) { $header .= ''; if (!$selectcat == '0') { $header .= ''; } $header .= '' . ''; if (!empty($simple_search_form) && $message_resource===false) { $header .= ''; } else { $header .= ''; } if ($is_course_admin && $message_resource===false && $_GET['selectcat']!=0) { /*$header .= ''; } $header.='
'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('RootCat')).get_lang('BackTo').' '.get_lang('RootCat').'' . get_lang('CurrentCategory') . '
'.$simple_search_form->toHtml().'' . get_lang('FlatView') . ' ' . get_lang('FlatView') . ''; if ($is_course_admin && $message_resource===false) { $header .= '' . get_lang('ScoreEdit') . ' ' . get_lang('ScoreEdit') . ''; }*/ } elseif (!(isset ($_GET['studentoverview']))) { if ( $message_resource===false ) { //$header .= '' . get_lang('FlatView') . ' ' . get_lang('FlatView') . ''; } } else { $header .= '' . get_lang('ExportPDF') . ' ' . get_lang('ExportPDF') . ''; } $header .= '
'; // for course admin & platform admin add item buttons are added to the header $header .= '
'; $my_category=$catobj->shows_all_information_an_category($catobj->get_id()); $user_id=api_get_user_id(); $course_code=$my_category['course_code']; $status_user=api_get_status_of_user_in_course ($user_id,$course_code); if (($status_user==1 && $is_course_admin && !isset ($_GET['search'])) || api_is_platform_admin()) { if ($selectcat == '0') { if ($show_add_qualification === true) { // $header .= '' . get_lang('NewCategory') . ' ' . get_lang('NewCategory') . ''; } if ($show_add_link === true) { //$header .= '' . get_lang('NewEvaluation') . ' ' . get_lang('NewEvaluation') . ''; } } else { if ($show_add_qualification === true && $message_resource===false) { //$header .= '' . get_lang('NewSubCategory') . ' ' . get_lang('NewSubCategory') . ''; } $my_category=$catobj->shows_all_information_an_category($catobj->get_id()); $my_api_cidreq = api_get_cidreq(); if ($my_api_cidreq=='') { $my_api_cidreq='cidReq='.$my_category['course_code']; } if ($show_add_link === true && $message_resource==false) { $header .= ''.Display::return_icon('filenew.gif', get_lang('NewEvaluation')).' ' . get_lang('NewEvaluation') . ' '; $cats= Category :: load($selectcat); if ($cats[0]->get_course_code() != null && $message_resource===false) { //$header .= '' . get_lang('MakeLink') . ' ' . get_lang('MakeLink') . ''; $header .= ''.Display::return_icon('link.gif', get_lang('MakeLink')).' ' . get_lang('MakeLink') . ' '; } else { $header .= ''.Display::return_icon('link.gif', get_lang('MakeLink')).' ' . get_lang('MakeLink') . ' '; } } if ($message_resource===false ) { $myname=$catobj->shows_all_information_an_category($catobj->get_id()); $header .= ''.Display::return_icon('statistics.gif', get_lang('EditAllWeights')).' ' . get_lang('EditAllWeights') . ''; $my_course_id=api_get_course_id(); $my_file= substr($_SESSION['gradebook_dest'],0,5); if (($my_file!='index' || $status_user==1) || api_is_platform_admin()) { $header .= ''.Display::return_icon('stats_access.gif', get_lang('FlatView')).' ' . get_lang('FlatView') . ''; if (/*($is_course_admin && $message_resource===false && $status_user==1) ||*/ api_is_platform_admin()) { $header .= ''.Display::return_icon('acces_tool.gif', get_lang('ScoreEdit')).' ' . get_lang('ScoreEdit') . ''; $header .= ''.Display::return_icon('acces_tool.gif', get_lang('AttachCertificate')).' ' . get_lang('AttachCertificate') . ''; $header .= ''.Display::return_icon('acces_tool.gif', get_lang('Certificate')).' ' . get_lang('GradebookSeeListOfStudentsCertificates') . ''; } } } } } elseif (isset ($_GET['search'])) { $header .= ''.get_lang('SearchResults').' :'; } $header .= '
'; echo $header; } function display_reduce_header_gradebook($catobj,$is_course_admin, $is_platform_admin, $simple_search_form, $show_add_qualification = true, $show_add_link = true) { //student if (!$is_course_admin) { /*$user= get_user_info_from_id(api_get_user_id()); $catcourse= Category :: load($catobj->get_id()); $scoredisplay = ScoreDisplay :: instance(); $scorecourse = $catcourse[0]->calc_score(api_get_user_id()); $scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable')); $cattotal = Category :: load(0); $scoretotal= $cattotal[0]->calc_score(api_get_user_id()); $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal,SCORE_PERCENT) : get_lang('NoResultsAvailable')); $scoreinfo = get_lang('StatsStudent') . ' : '.api_get_person_name($user['firstname'], $user['lastname']).'
'; if ((!$catobj->get_id() == '0') && (!isset ($_GET['studentoverview'])) && (!isset ($_GET['search']))) $scoreinfo.= '
'.get_lang('TotalForThisCategory') . ' : ' . $scorecourse_display . ''; $scoreinfo.= '
'.get_lang('Total') . ' : ' . $scoretotal_display . ''; Display :: display_normal_message($scoreinfo,false); */ } // show navigation tree and buttons? $header = '
'; if ($is_course_admin) { $header .= ''.Display::return_icon('stats_access.gif', get_lang('FlatView')).' '. get_lang('FlatView') . ''; if ( api_is_platform_admin() /*$is_platform_admin || $is_course_admin*/) $header .= ''.Display::return_icon('acces_tool.gif', get_lang('ScoreEdit')).' ' . get_lang('ScoreEdit') . ''; } elseif (!(isset ($_GET['studentoverview']))) { $header .= ''.Display::return_icon('view_list.gif', get_lang('FlatView')).' ' . get_lang('FlatView') . ''; } else { $header .= ''.Display::return_icon('file_pdf.gif', get_lang('ExportPDF')).' ' . get_lang('ExportPDF') . ''; } $header.='
'; echo $header; } function display_header_user($userid) { $select_cat=Security::remove_XSS($_GET['selectcat']); $user_id = $userid; $user= get_user_info_from_id($user_id); $catcourse= Category :: load($select_cat); $scoredisplay = ScoreDisplay :: instance(); $scorecourse = $catcourse[0]->calc_score($user_id); // generating the total score for a course $allevals= $catcourse[0]->get_evaluations($user_id,true); $alllinks= $catcourse[0]->get_links($user_id,true); $evals_links = array_merge($allevals, $alllinks); $item_value=0; $item_total=0; for ($count=0; $count < count($evals_links); $count++) { $item = $evals_links[$count]; $score = $item->calc_score($user_id); $my_score_denom=($score[1]==0) ? 1 : $score[1]; $item_value+=$score[0]/$my_score_denom*$item->get_weight(); $item_total+=$item->get_weight(); //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT); } $item_value = number_format($item_value, 2, '.', ' '); $total_score=array($item_value,$item_total); $scorecourse_display = $scoredisplay->display_score($total_score,SCORE_DIV_PERCENT); //---------------------- //$scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable')); $cattotal = Category :: load(0); $scoretotal= $cattotal[0]->calc_score($user_id); $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal,SCORE_PERCENT) : get_lang('NoResultsAvailable')); //--------------------- $image_syspath = UserManager::get_user_picture_path_by_id($userid,'system',false,true); $image_size = getimagesize($image_syspath['dir'].$image_syspath['file']); //Web path $image_path = UserManager::get_user_picture_path_by_id($userid,'web',false,true); $image_file = $image_path['dir'].$image_path['file']; $img_attributes= 'src="' . $image_file . '?rand=' . time() . '" ' . 'alt="' . api_get_person_name($user['firstname'], $user['lastname']) . '" '; if ($image_size[0] > 200) { //limit display width to 200px $img_attributes .= 'width="200" '; } $info = '
'; $info.= get_lang('Name') . ' : ' . api_get_person_name($user['firstname'], $user['lastname']) . ' ( ' . get_lang('MoreInfo') . '... )
'; $info.= get_lang('Email') . ' : ' . $user['email'] . '

'; $info.= get_lang('TotalUser') . ' : ' . $scorecourse_display . '
'; $info.= '
'; $info.= '
'; //-------------- //$scoreinfo = get_lang('StatsStudent') . ' : '.api_get_person_name($user['lastname'], $user['firstname']).'
'; //$scoreinfo.= '
'.get_lang('Total') . ' : ' . $scorecourse_display . ''; //$scoreinfo.= '
'.get_lang('Total') . ' : ' . $scoretotal_display . ''; Display :: display_normal_message($info,false); } }