|
|
@ -101,10 +101,11 @@ if (empty($cats)) { |
|
|
|
$first_time = 1; |
|
|
|
$first_time = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$_GET['selectcat'] = $cats[0]->get_id(); |
|
|
|
$selectCat = (int) $cats[0]->get_id(); |
|
|
|
|
|
|
|
$_GET['selectcat'] = $selectCat; |
|
|
|
|
|
|
|
|
|
|
|
if (isset($_GET['isStudentView'])) { |
|
|
|
if (isset($_GET['isStudentView'])) { |
|
|
|
if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0) && (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'true')) { |
|
|
|
if ($selectCat > 0 && (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'true')) { |
|
|
|
$interbreadcrumb[] = array( |
|
|
|
$interbreadcrumb[] = array( |
|
|
|
'url' => 'index.php'.'?selectcat=0&isStudentView=true', |
|
|
|
'url' => 'index.php'.'?selectcat=0&isStudentView=true', |
|
|
|
'name' => get_lang('ToolGradebook'), |
|
|
|
'name' => get_lang('ToolGradebook'), |
|
|
@ -112,27 +113,37 @@ if (isset($_GET['isStudentView'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ((isset($_GET['selectcat']) && $_GET['selectcat']>0) && |
|
|
|
if ($selectCat > 0 && (isset($_SESSION['studentview']) && $_SESSION['studentview']=='true')) { |
|
|
|
(isset($_SESSION['studentview']) && $_SESSION['studentview']=='true') |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!isset($_GET['selectcat']) && |
|
|
|
if (empty($selectCat) && ( |
|
|
|
($_SESSION['studentview']=='studentview') || |
|
|
|
$_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') |
|
|
|
(isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') |
|
|
|
|
|
|
|
) { |
|
|
|
) { |
|
|
|
Display :: display_header(get_lang('Gradebook')); |
|
|
|
Display :: display_header(get_lang('Gradebook')); |
|
|
|
|
|
|
|
|
|
|
|
//Introduction tool: student view |
|
|
|
//Introduction tool: student view |
|
|
|
Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction')); |
|
|
|
Display::display_introduction_section( |
|
|
|
$addparams=array(); |
|
|
|
TOOL_GRADEBOOK, |
|
|
|
$cats = Category :: load (0, null, null, null, null, null, false); |
|
|
|
array('ToolbarSet' => 'AssessmentsIntroduction') |
|
|
|
$allcat= $cats[0]->get_subcategories($stud_id, $course_code, $session_id); |
|
|
|
); |
|
|
|
$alleval= $cats[0]->get_evaluations($stud_id); |
|
|
|
$addparams = array(); |
|
|
|
$alllink= $cats[0]->get_links($stud_id); |
|
|
|
$cats = Category:: load(0, null, null, null, null, null, false); |
|
|
|
$gradebooktable= new GradebookTable($cats[0], $allcat, $alleval,$alllink, $addparams); |
|
|
|
$allcat = $cats[0]->get_subcategories( |
|
|
|
|
|
|
|
$stud_id, |
|
|
|
|
|
|
|
$course_code, |
|
|
|
|
|
|
|
$session_id |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$alleval = $cats[0]->get_evaluations($stud_id); |
|
|
|
|
|
|
|
$alllink = $cats[0]->get_links($stud_id); |
|
|
|
|
|
|
|
$gradebooktable = new GradebookTable( |
|
|
|
|
|
|
|
$cats[0], |
|
|
|
|
|
|
|
$allcat, |
|
|
|
|
|
|
|
$alleval, |
|
|
|
|
|
|
|
$alllink, |
|
|
|
|
|
|
|
$addparams |
|
|
|
|
|
|
|
); |
|
|
|
$gradebooktable->display(); |
|
|
|
$gradebooktable->display(); |
|
|
|
Display :: display_footer(); |
|
|
|
Display:: display_footer(); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -171,14 +182,16 @@ if (isset($_GET['movecat'])) { |
|
|
|
GradebookUtils::block_students(); |
|
|
|
GradebookUtils::block_students(); |
|
|
|
$cats= Category :: load($_GET['movecat']); |
|
|
|
$cats= Category :: load($_GET['movecat']); |
|
|
|
if (!isset ($_GET['targetcat'])) { |
|
|
|
if (!isset ($_GET['targetcat'])) { |
|
|
|
$move_form= new CatForm(CatForm :: TYPE_MOVE, |
|
|
|
$move_form= new CatForm( |
|
|
|
|
|
|
|
CatForm :: TYPE_MOVE, |
|
|
|
$cats[0], |
|
|
|
$cats[0], |
|
|
|
'move_cat_form', |
|
|
|
'move_cat_form', |
|
|
|
null, |
|
|
|
null, |
|
|
|
api_get_self() . '?movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
api_get_self() . '?movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
. '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
|
|
. '&selectcat=' . $selectCat |
|
|
|
|
|
|
|
); |
|
|
|
if ($move_form->validate()) { |
|
|
|
if ($move_form->validate()) { |
|
|
|
header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
|
|
header('Location: ' . api_get_self() . '?selectcat=' . $selectCat |
|
|
|
. '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
. '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
. '&targetcat=' . $move_form->exportValue('move_cat')); |
|
|
|
. '&targetcat=' . $move_form->exportValue('move_cat')); |
|
|
|
exit; |
|
|
|
exit; |
|
|
@ -189,7 +202,7 @@ if (isset($_GET['movecat'])) { |
|
|
|
|
|
|
|
|
|
|
|
if (!($course_to_crsind && !isset($_GET['confirm']))) { |
|
|
|
if (!($course_to_crsind && !isset($_GET['confirm']))) { |
|
|
|
$cats[0]->move_to_cat($targetcat[0]); |
|
|
|
$cats[0]->move_to_cat($targetcat[0]); |
|
|
|
header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
|
|
header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . $selectCat); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
unset ($targetcat); |
|
|
|
unset ($targetcat); |
|
|
@ -203,16 +216,17 @@ if (isset($_GET['moveeval'])) { |
|
|
|
$evals= Evaluation :: load($_GET['moveeval']); |
|
|
|
$evals= Evaluation :: load($_GET['moveeval']); |
|
|
|
if (!isset ($_GET['targetcat'])) { |
|
|
|
if (!isset ($_GET['targetcat'])) { |
|
|
|
|
|
|
|
|
|
|
|
$move_form= new EvalForm(EvalForm :: TYPE_MOVE, |
|
|
|
$move_form= new EvalForm( |
|
|
|
|
|
|
|
EvalForm :: TYPE_MOVE, |
|
|
|
$evals[0], |
|
|
|
$evals[0], |
|
|
|
null, |
|
|
|
null, |
|
|
|
'move_eval_form', |
|
|
|
'move_eval_form', |
|
|
|
null, |
|
|
|
null, |
|
|
|
api_get_self() . '?moveeval=' . Security::remove_XSS($_GET['moveeval']) |
|
|
|
api_get_self() . '?moveeval=' . Security::remove_XSS($_GET['moveeval']). '&selectcat=' . $selectCat |
|
|
|
. '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if ($move_form->validate()) { |
|
|
|
if ($move_form->validate()) { |
|
|
|
header('Location: ' .api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
|
|
header('Location: ' .api_get_self() . '?selectcat='.$selectCat |
|
|
|
. '&moveeval=' . Security::remove_XSS($_GET['moveeval']) |
|
|
|
. '&moveeval=' . Security::remove_XSS($_GET['moveeval']) |
|
|
|
. '&targetcat=' . $move_form->exportValue('move_cat')); |
|
|
|
. '&targetcat=' . $move_form->exportValue('move_cat')); |
|
|
|
exit; |
|
|
|
exit; |
|
|
@ -223,12 +237,12 @@ if (isset($_GET['moveeval'])) { |
|
|
|
|
|
|
|
|
|
|
|
if (!($course_to_crsind && !isset($_GET['confirm']))) { |
|
|
|
if (!($course_to_crsind && !isset($_GET['confirm']))) { |
|
|
|
$evals[0]->move_to_cat($targetcat[0]); |
|
|
|
$evals[0]->move_to_cat($targetcat[0]); |
|
|
|
header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
|
|
header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . $selectCat); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
unset ($targetcat); |
|
|
|
unset($targetcat); |
|
|
|
} |
|
|
|
} |
|
|
|
unset ($evals); |
|
|
|
unset($evals); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//move a link |
|
|
|
//move a link |
|
|
@ -241,14 +255,14 @@ if (isset($_GET['movelink'])) { |
|
|
|
$link[0], |
|
|
|
$link[0], |
|
|
|
'move_link_form', |
|
|
|
'move_link_form', |
|
|
|
null, |
|
|
|
null, |
|
|
|
api_get_self() . '?movelink=' . $_GET['movelink'] . '&selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
|
|
api_get_self() . '?movelink=' . $_GET['movelink'] . '&selectcat=' . $selectCat |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if ($move_form->validate()) { |
|
|
|
if ($move_form->validate()) { |
|
|
|
$targetcat= Category :: load($move_form->exportValue('move_cat')); |
|
|
|
$targetcat= Category :: load($move_form->exportValue('move_cat')); |
|
|
|
$link[0]->move_to_cat($targetcat[0]); |
|
|
|
$link[0]->move_to_cat($targetcat[0]); |
|
|
|
unset ($link); |
|
|
|
unset($link); |
|
|
|
header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
|
|
header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . $selectCat); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -408,9 +422,7 @@ if (!empty($course_to_crsind) && !isset($_GET['confirm'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
$button = '<form name="confirm" method="post" action="'.api_get_self() .'?confirm=' |
|
|
|
$button = '<form name="confirm" method="post" action="'.api_get_self() .'?confirm=' |
|
|
|
.(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
.(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
|
|
: '&moveeval=' . Security::remove_XSS($_GET['moveeval']) ) |
|
|
|
: '&moveeval=' . Security::remove_XSS($_GET['moveeval'])).'&selectcat=' . $selectCat.'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'"> |
|
|
|
.'&selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
|
|
|
|
|
|
.'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'"> |
|
|
|
|
|
|
|
<input type="submit" value="'.get_lang('Ok').'"> |
|
|
|
<input type="submit" value="'.get_lang('Ok').'"> |
|
|
|
</form>'; |
|
|
|
</form>'; |
|
|
|
$warning_message = get_lang('MoveWarning').'<br><br>'.$button; |
|
|
|
$warning_message = get_lang('MoveWarning').'<br><br>'.$button; |
|
|
@ -532,24 +544,30 @@ if (isset($_POST['action'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset ($_POST['submit']) && isset ($_POST['keyword'])) { |
|
|
|
if (isset ($_POST['submit']) && isset ($_POST['keyword'])) { |
|
|
|
header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
|
|
header('Location: ' . api_get_self() . '?selectcat=' . $selectCat. '&search='.Security::remove_XSS($_POST['keyword'])); |
|
|
|
. '&search='.Security::remove_XSS($_POST['keyword'])); |
|
|
|
|
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DISPLAY HEADERS AND MESSAGES |
|
|
|
// DISPLAY HEADERS AND MESSAGES |
|
|
|
if (!isset($_GET['exportpdf'])) { |
|
|
|
if (!isset($_GET['exportpdf'])) { |
|
|
|
if (isset ($_GET['studentoverview'])) { |
|
|
|
if (isset ($_GET['studentoverview'])) { |
|
|
|
$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('ToolGradebook')); |
|
|
|
$interbreadcrumb[] = array( |
|
|
|
|
|
|
|
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat, |
|
|
|
|
|
|
|
'name' => get_lang('ToolGradebook') |
|
|
|
|
|
|
|
); |
|
|
|
Display :: display_header(get_lang('FlatView')); |
|
|
|
Display :: display_header(get_lang('FlatView')); |
|
|
|
} elseif (isset ($_GET['search'])) { |
|
|
|
} elseif (isset($_GET['search'])) { |
|
|
|
$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('ToolGradebook')); |
|
|
|
$interbreadcrumb[] = array( |
|
|
|
|
|
|
|
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat, |
|
|
|
|
|
|
|
'name' => get_lang('ToolGradebook') |
|
|
|
|
|
|
|
); |
|
|
|
Display :: display_header(get_lang('SearchResults')); |
|
|
|
Display :: display_header(get_lang('SearchResults')); |
|
|
|
} elseif(isset ($_GET['selectcat'])) { |
|
|
|
} elseif(!empty($selectCat)) { |
|
|
|
$interbreadcrumb[]= array ( 'url' =>'#','name' => get_lang('ToolGradebook')); |
|
|
|
$interbreadcrumb[] = array( |
|
|
|
if (!isset($_GET['gradebooklist_direction'])) { |
|
|
|
'url' => '#', |
|
|
|
//$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details')); |
|
|
|
'name' => get_lang('ToolGradebook') |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
Display :: display_header(''); |
|
|
|
Display :: display_header(''); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Display :: display_header(get_lang('ToolGradebook')); |
|
|
|
Display :: display_header(get_lang('ToolGradebook')); |
|
|
@ -603,22 +621,15 @@ if (isset ($move_form)){ |
|
|
|
|
|
|
|
|
|
|
|
$is_platform_admin = api_is_platform_admin(); |
|
|
|
$is_platform_admin = api_is_platform_admin(); |
|
|
|
$is_course_admin = api_is_allowed_to_edit(null, true); |
|
|
|
$is_course_admin = api_is_allowed_to_edit(null, true); |
|
|
|
|
|
|
|
$simple_search_form = ''; |
|
|
|
//load data for category, evaluation and links |
|
|
|
|
|
|
|
if (empty($_GET['selectcat'])) { |
|
|
|
|
|
|
|
$category = 0; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$category = $_GET['selectcat']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$simple_search_form=''; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_GET['studentoverview'])) { |
|
|
|
if (isset($_GET['studentoverview'])) { |
|
|
|
//@todo this code also seems to be deprecated ... |
|
|
|
//@todo this code also seems to be deprecated ... |
|
|
|
$cats = Category :: load($category); |
|
|
|
$cats = Category :: load($selectCat); |
|
|
|
$stud_id= (api_is_allowed_to_edit() ? null : $stud_id); |
|
|
|
$stud_id = (api_is_allowed_to_edit() ? null : $stud_id); |
|
|
|
$allcat = $cats[0]->get_subcategories($stud_id, $course_code, $session_id); |
|
|
|
$allcat = $cats[0]->get_subcategories($stud_id, $course_code, $session_id); |
|
|
|
$alleval= $cats[0]->get_evaluations($stud_id, true); |
|
|
|
$alleval = $cats[0]->get_evaluations($stud_id, true); |
|
|
|
$alllink= $cats[0]->get_links($stud_id, true); |
|
|
|
$alllink = $cats[0]->get_links($stud_id, true); |
|
|
|
if (isset ($_GET['exportpdf'])) { |
|
|
|
if (isset ($_GET['exportpdf'])) { |
|
|
|
$datagen = new GradebookDataGenerator($allcat,$alleval, $alllink); |
|
|
|
$datagen = new GradebookDataGenerator($allcat,$alleval, $alllink); |
|
|
|
$header_names = array( |
|
|
|
$header_names = array( |
|
|
@ -626,9 +637,14 @@ if (isset($_GET['studentoverview'])) { |
|
|
|
get_lang('Description'), |
|
|
|
get_lang('Description'), |
|
|
|
get_lang('Weight'), |
|
|
|
get_lang('Weight'), |
|
|
|
get_lang('Date'), |
|
|
|
get_lang('Date'), |
|
|
|
get_lang('Results'), |
|
|
|
get_lang('Results') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$data_array = $datagen->get_data( |
|
|
|
|
|
|
|
GradebookDataGenerator :: GDG_SORT_NAME, |
|
|
|
|
|
|
|
0, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
true |
|
|
|
); |
|
|
|
); |
|
|
|
$data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true); |
|
|
|
|
|
|
|
$newarray = array(); |
|
|
|
$newarray = array(); |
|
|
|
foreach ($data_array as $data) { |
|
|
|
foreach ($data_array as $data) { |
|
|
|
$newarray[] = array_slice($data, 1); |
|
|
|
$newarray[] = array_slice($data, 1); |
|
|
@ -709,7 +725,7 @@ if (isset($_GET['studentoverview'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
unset($cats); |
|
|
|
unset($cats); |
|
|
|
} |
|
|
|
} |
|
|
|
$cats = Category::load($category, null, null, null, null, null, false); |
|
|
|
$cats = Category::load($selectCat, null, null, null, null, null, false); |
|
|
|
|
|
|
|
|
|
|
|
//with this fix the teacher only can view 1 gradebook |
|
|
|
//with this fix the teacher only can view 1 gradebook |
|
|
|
if (api_is_platform_admin()) { |
|
|
|
if (api_is_platform_admin()) { |
|
|
@ -724,7 +740,7 @@ if (isset($_GET['studentoverview'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// add params to the future links (in the table shown) |
|
|
|
// add params to the future links (in the table shown) |
|
|
|
$addparams = array('selectcat' => $cats[0]->get_id()); |
|
|
|
$addparams = array('selectcat' => $selectCat); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($_GET['studentoverview'])) { |
|
|
|
if (isset($_GET['studentoverview'])) { |
|
|
|
$addparams['studentoverview'] = ''; |
|
|
|
$addparams['studentoverview'] = ''; |
|
|
@ -740,20 +756,18 @@ $no_qualification = false; |
|
|
|
|
|
|
|
|
|
|
|
// Show certificate link. |
|
|
|
// Show certificate link. |
|
|
|
$certificate = array(); |
|
|
|
$certificate = array(); |
|
|
|
|
|
|
|
|
|
|
|
$actionsLeft = ''; |
|
|
|
$actionsLeft = ''; |
|
|
|
|
|
|
|
|
|
|
|
if ($category != '0') { |
|
|
|
if (!empty($selectCat)) { |
|
|
|
$cat = new Category(); |
|
|
|
$cat = new Category(); |
|
|
|
$category_id = intval($_GET['selectcat']); |
|
|
|
$course_id = CourseManager::get_course_by_category($selectCat); |
|
|
|
$course_id = CourseManager::get_course_by_category($category_id); |
|
|
|
$show_message = $cat->show_message_resource_delete($course_id); |
|
|
|
$show_message = $cat->show_message_resource_delete($course_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($show_message == '') { |
|
|
|
if ($show_message == '') { |
|
|
|
// Student |
|
|
|
// Student |
|
|
|
if (!api_is_allowed_to_edit() && !api_is_excluded_user_type()) { |
|
|
|
if (!api_is_allowed_to_edit() && !api_is_excluded_user_type()) { |
|
|
|
$certificate = Category::register_user_certificate( |
|
|
|
$certificate = Category::register_user_certificate( |
|
|
|
$category_id, |
|
|
|
$selectCat, |
|
|
|
$stud_id |
|
|
|
$stud_id |
|
|
|
); |
|
|
|
); |
|
|
|
if (isset($certificate['pdf_url'])) { |
|
|
|
if (isset($certificate['pdf_url'])) { |
|
|
@ -764,17 +778,17 @@ if ($category != '0') { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$currentScore = Category::getCurrentScore($stud_id, $category_id, $course_code, $session_id, true); |
|
|
|
$currentScore = Category::getCurrentScore($stud_id, $selectCat, $course_code, $session_id, true); |
|
|
|
Category::registerCurrentScore($currentScore, $stud_id, $category_id); |
|
|
|
Category::registerCurrentScore($currentScore, $stud_id, $selectCat); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!api_is_allowed_to_edit(null, true)) { |
|
|
|
if (!api_is_allowed_to_edit(null, true)) { |
|
|
|
$actionsLeft .= Display::url( |
|
|
|
$actionsLeft .= Display::url( |
|
|
|
Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'), |
|
|
|
Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'), |
|
|
|
api_get_self()."?".api_get_self()."&action=export_table", |
|
|
|
api_get_self()."?".api_get_self()."&action=export_table", |
|
|
|
['class' => 'btn btn-default'] |
|
|
|
['class' => 'btn btn-default'] |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -784,38 +798,31 @@ if (api_is_allowed_to_edit(null, true)) { |
|
|
|
// Tool introduction |
|
|
|
// Tool introduction |
|
|
|
Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction')); |
|
|
|
Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction')); |
|
|
|
|
|
|
|
|
|
|
|
if ((isset ($_GET['selectcat']) && $_GET['selectcat']<>0)) { |
|
|
|
if (((empty($selectCat)) || (isset($_GET['cidReq']) && $_GET['cidReq'] !== '')) || |
|
|
|
// |
|
|
|
(isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') |
|
|
|
} else { |
|
|
|
) { |
|
|
|
if (( |
|
|
|
$cats = Category:: load( |
|
|
|
(isset ($_GET['selectcat']) && $_GET['selectcat'] == 0) || ( |
|
|
|
null, |
|
|
|
(isset($_GET['cidReq']) && $_GET['cidReq'] !== '')) |
|
|
|
null, |
|
|
|
) || |
|
|
|
$course_code, |
|
|
|
isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false' |
|
|
|
null, |
|
|
|
) { |
|
|
|
null, |
|
|
|
$cats = Category:: load( |
|
|
|
$session_id, |
|
|
|
null, |
|
|
|
false |
|
|
|
null, |
|
|
|
); |
|
|
|
$course_code, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
$session_id, |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { |
|
|
|
if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null,true)) { |
|
|
|
echo '<meta http-equiv="refresh" content="0;url='.api_get_self().'?'.api_get_cidreq().'" />'; |
|
|
|
echo '<meta http-equiv="refresh" content="0;url='.api_get_self().'?'.api_get_cidreq().'" />'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$cats = Category::load(null, null, $course_code, null, null, $session_id, false); |
|
|
|
$cats = Category::load(null, null, $course_code, null, null, $session_id, false); |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($cats)) { |
|
|
|
if (!empty($cats)) { |
|
|
|
if ((api_get_setting('gradebook_enable_grade_model') == 'true') && |
|
|
|
if ((api_get_setting('gradebook_enable_grade_model') === 'true') && |
|
|
|
( |
|
|
|
( |
|
|
|
api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && |
|
|
|
api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && |
|
|
|
api_get_setting('teachers_can_change_grade_model_settings') == 'true') |
|
|
|
api_get_setting('teachers_can_change_grade_model_settings') === 'true') |
|
|
|
) |
|
|
|
) |
|
|
|
) { |
|
|
|
) { |
|
|
|
// Getting grade models. |
|
|
|
// Getting grade models. |
|
|
@ -870,7 +877,7 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { |
|
|
|
$allcat = array(); |
|
|
|
$allcat = array(); |
|
|
|
/** @var Category $cat */ |
|
|
|
/** @var Category $cat */ |
|
|
|
foreach ($cats as $cat) { |
|
|
|
foreach ($cats as $cat) { |
|
|
|
$allcat = $cat->get_subcategories($stud_id, $course_code, $session_id); |
|
|
|
$allcat = $cat->get_subcategories($stud_id, $course_code, $session_id); |
|
|
|
$alleval = $cat->get_evaluations($stud_id); |
|
|
|
$alleval = $cat->get_evaluations($stud_id); |
|
|
|
$alllink = $cat->get_links($stud_id, true); |
|
|
|
$alllink = $cat->get_links($stud_id, true); |
|
|
|
|
|
|
|
|
|
|
@ -892,7 +899,7 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (api_is_allowed_to_edit(null,true) && |
|
|
|
if (api_is_allowed_to_edit(null,true) && |
|
|
|
api_get_setting('gradebook_enable_grade_model') == 'true' |
|
|
|
api_get_setting('gradebook_enable_grade_model') === 'true' |
|
|
|
) { |
|
|
|
) { |
|
|
|
//Showing the grading system |
|
|
|
//Showing the grading system |
|
|
|
if (!empty($grade_models[$grade_model_id])) { |
|
|
|
if (!empty($grade_models[$grade_model_id])) { |
|
|
|