|
|
|
@ -20,7 +20,7 @@ class DisplayGradebook |
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
$header = '<div class="actions">'; |
|
|
|
|
if ($page != 'statistics') { |
|
|
|
|
$header .= '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq().'">'. |
|
|
|
|
$header .= '<a href="'.Category::getUrl().'selectcat='.$selectcat.'">'. |
|
|
|
|
Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
if (($evalobj->get_course_code() != null) && !$evalobj->has_results()) { |
|
|
|
|
$header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat='.$selectcat.'&selecteval='.$evalobj->get_id().'"> |
|
|
|
@ -110,15 +110,25 @@ class DisplayGradebook |
|
|
|
|
if ($page != 'statistics') { |
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
$evalinfo .= '<br /><a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.Security::remove_XSS($_GET['selecteval']).'"> '. |
|
|
|
|
Display::return_icon('statistics.png', get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
Display::return_icon( |
|
|
|
|
'statistics.png', |
|
|
|
|
get_lang('ViewStatistics'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
).'</a>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$evalinfo .= '</td><td>'.Display::return_icon('tutorial.gif', '', ['style' => 'float:right; position:relative;']).'</td></table>'; |
|
|
|
|
$evalinfo .= '</td><td>'. |
|
|
|
|
Display::return_icon( |
|
|
|
|
'tutorial.gif', |
|
|
|
|
'', |
|
|
|
|
['style' => 'float:right; position:relative;'] |
|
|
|
|
) |
|
|
|
|
.'</td></table>'; |
|
|
|
|
echo $evalinfo; |
|
|
|
|
echo $header; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Displays the header for the flatview page containing filters |
|
|
|
|
* @param $catobj |
|
|
|
@ -130,7 +140,7 @@ class DisplayGradebook |
|
|
|
|
$header = '<div class="actions">'; |
|
|
|
|
if ($catobj->get_parent_id() == 0) { |
|
|
|
|
$select_cat = $catobj->get_id(); |
|
|
|
|
$url = Security::remove_XSS($_SESSION['gradebook_dest']); |
|
|
|
|
$url = Category::getUrl(); |
|
|
|
|
} else { |
|
|
|
|
$select_cat = $catobj->get_parent_id(); |
|
|
|
|
$url = 'gradebook_flatview.php'; |
|
|
|
@ -149,7 +159,12 @@ class DisplayGradebook |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$header .= Display::url( |
|
|
|
|
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM), |
|
|
|
|
Display::return_icon( |
|
|
|
|
'export_csv.png', |
|
|
|
|
get_lang('ExportAsCSV'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
$exportCsvUrl |
|
|
|
|
); |
|
|
|
|
|
|
|
|
@ -160,7 +175,12 @@ class DisplayGradebook |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$header .= Display::url( |
|
|
|
|
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM), |
|
|
|
|
Display::return_icon( |
|
|
|
|
'export_excel.png', |
|
|
|
|
get_lang('ExportAsXLS'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
$exportXlsUrl |
|
|
|
|
); |
|
|
|
|
|
|
|
|
@ -171,7 +191,12 @@ class DisplayGradebook |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$header .= Display::url( |
|
|
|
|
Display::return_icon('export_doc.png', get_lang('ExportAsDOC'), '', ICON_SIZE_MEDIUM), |
|
|
|
|
Display::return_icon( |
|
|
|
|
'export_doc.png', |
|
|
|
|
get_lang('ExportAsDOC'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
$exportDocUrl |
|
|
|
|
); |
|
|
|
|
|
|
|
|
@ -181,7 +206,12 @@ class DisplayGradebook |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$header .= Display::url( |
|
|
|
|
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM), |
|
|
|
|
Display::return_icon( |
|
|
|
|
'printer.png', |
|
|
|
|
get_lang('Print'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
$exportPrintUrl, |
|
|
|
|
['target' => '_blank'] |
|
|
|
|
); |
|
|
|
@ -195,7 +225,12 @@ class DisplayGradebook |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$header .= Display::url( |
|
|
|
|
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM), |
|
|
|
|
Display::return_icon( |
|
|
|
|
'pdf.png', |
|
|
|
|
get_lang('ExportToPDF'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
$exportPdfUrl |
|
|
|
|
); |
|
|
|
|
|
|
|
|
@ -306,7 +341,13 @@ class DisplayGradebook |
|
|
|
|
$header .= '<tr>'; |
|
|
|
|
if (!$selectcat == '0') { |
|
|
|
|
$header .= '<td><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'. |
|
|
|
|
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>'; |
|
|
|
|
Display::return_icon( |
|
|
|
|
'back.png', |
|
|
|
|
get_lang('BackTo').' '.get_lang('RootCat'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
). |
|
|
|
|
'</a></td>'; |
|
|
|
|
} |
|
|
|
|
$header .= '<td>'.get_lang('CurrentCategory').'</td>'. |
|
|
|
|
'<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
|
|
|
@ -347,13 +388,18 @@ class DisplayGradebook |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// for course admin & platform admin add item buttons are added to the header |
|
|
|
|
|
|
|
|
|
$actionsLeft = ''; |
|
|
|
|
$actionsRight = ''; |
|
|
|
|
$my_api_cidreq = api_get_cidreq(); |
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
if (empty($grade_model_id) || $grade_model_id == -1) { |
|
|
|
|
$actionsLeft .= '<a href="gradebook_add_cat.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'. |
|
|
|
|
Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM).'</a></td>'; |
|
|
|
|
Display::return_icon( |
|
|
|
|
'new_folder.png', |
|
|
|
|
get_lang('AddGradebook'), |
|
|
|
|
array(), |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
).'</a></td>'; |
|
|
|
|
} |
|
|
|
|
if ($selectcat != '0') { |
|
|
|
|
$my_category = $catobj->showAllCategoryInfo($catobj->get_id()); |
|
|
|
@ -424,7 +470,6 @@ class DisplayGradebook |
|
|
|
|
$actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
|
|
|
Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} elseif (isset($_GET['search'])) { |
|
|
|
@ -437,12 +482,21 @@ class DisplayGradebook |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if ($isDrhOfCourse) { |
|
|
|
|
$$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
|
|
|
Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
|
|
|
Display::return_icon( |
|
|
|
|
'stats.png', |
|
|
|
|
get_lang('FlatView'), |
|
|
|
|
'', |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
). |
|
|
|
|
'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
|
echo $toolbar = Display::toolbarAction('gradebook-actions', array($actionsLeft, $actionsRight)); |
|
|
|
|
echo $toolbar = Display::toolbarAction( |
|
|
|
|
'gradebook-actions', |
|
|
|
|
array($actionsLeft, $actionsRight) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (api_is_allowed_to_edit(null, true)) { |
|
|
|
@ -486,15 +540,17 @@ class DisplayGradebook |
|
|
|
|
$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')); |
|
|
|
|
$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')); |
|
|
|
|
$scoretotal_display = isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'); |
|
|
|
|
$scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />'; |
|
|
|
|
if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) |
|
|
|
|
$scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>'; |
|
|
|
|
$scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>'; |
|
|
|
|
Display::addFlash(Display::return_message($scoreinfo, 'normal', false)); |
|
|
|
|
Display::addFlash( |
|
|
|
|
Display::return_message($scoreinfo, 'normal', false) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
// show navigation tree and buttons? |
|
|
|
|
$header = '<div class="actions">'; |
|
|
|
@ -527,8 +583,16 @@ class DisplayGradebook |
|
|
|
|
$scoredisplay = ScoreDisplay::instance(); |
|
|
|
|
|
|
|
|
|
// generating the total score for a course |
|
|
|
|
$allevals = $catcourse[0]->get_evaluations($userId, true, api_get_course_id()); |
|
|
|
|
$alllinks = $catcourse[0]->get_links($userId, true, api_get_course_id()); |
|
|
|
|
$allevals = $catcourse[0]->get_evaluations( |
|
|
|
|
$userId, |
|
|
|
|
true, |
|
|
|
|
api_get_course_id() |
|
|
|
|
); |
|
|
|
|
$alllinks = $catcourse[0]->get_links( |
|
|
|
|
$userId, |
|
|
|
|
true, |
|
|
|
|
api_get_course_id() |
|
|
|
|
); |
|
|
|
|
$evals_links = array_merge($allevals, $alllinks); |
|
|
|
|
$item_value = 0; |
|
|
|
|
$item_total = 0; |
|
|
|
|