diff --git a/main/gradebook/gradebook_add_user.php b/main/gradebook/gradebook_add_user.php index 08d7752349..a99bcb46f9 100755 --- a/main/gradebook/gradebook_add_user.php +++ b/main/gradebook/gradebook_add_user.php @@ -21,7 +21,7 @@ $evaluation= Evaluation :: load($_GET['selecteval']); $newstudents = $evaluation[0]->get_not_subscribed_students(); if (count($newstudents) == '0') { - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval'])); + header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); exit; } $add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, @@ -50,7 +50,7 @@ if ( isset($_POST['submit_button']) ) { $result->add(); } } - header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); + header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); exit; } elseif ($_POST['firstLetterUser']) { $firstletter= $_POST['firstLetterUser']; @@ -61,10 +61,10 @@ if ( isset($_POST['submit_button']) ) { } $interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); -$interbreadcrumb[]= array ( - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']), - 'name' => get_lang('ViewResult' -)); +$interbreadcrumb[]= array( + 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq() + 'name' => get_lang('ViewResult') +); Display :: display_header(get_lang('AddUserToEval')); if (isset ($_GET['erroroneuser'])){ Display :: display_warning_message(get_lang('AtLeastOneUser'),false); diff --git a/main/gradebook/gradebook_edit_result.php b/main/gradebook/gradebook_edit_result.php index b942da05af..c916afd88e 100755 --- a/main/gradebook/gradebook_edit_result.php +++ b/main/gradebook/gradebook_edit_result.php @@ -32,18 +32,18 @@ if ($edit_result_form->validate()) { } next($scores); } - header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&editallresults='); + header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&editallresults=&'.api_get_cidreq()); exit; } $interbreadcrumb[] = array ( 'url' => $_SESSION['gradebook_dest'], - 'name' => get_lang('Gradebook' - )); + 'name' => get_lang('Gradebook') +); $interbreadcrumb[]= array ( - 'url' => 'gradebook_view_result.php?selecteval='.$select_eval, - 'name' => get_lang('ViewResult' - )); + 'url' => 'gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq() + 'name' => get_lang('ViewResult') +); Display :: display_header(get_lang('EditResult')); DisplayGradebook :: display_header_result ($evaluation[0],null,0,0); echo $table; diff --git a/main/gradebook/gradebook_statistics.php b/main/gradebook/gradebook_statistics.php index 0bf846baaf..45bd081863 100755 --- a/main/gradebook/gradebook_statistics.php +++ b/main/gradebook/gradebook_statistics.php @@ -26,9 +26,9 @@ $interbreadcrumb[]= array ( if (api_is_allowed_to_edit()) { $interbreadcrumb[]= array ( - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), - 'name' => get_lang('ViewResult' - )); + 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), + 'name' => get_lang('ViewResult') + ); } $displayscore = ScoreDisplay :: instance(); diff --git a/main/gradebook/gradebook_view_result.php b/main/gradebook/gradebook_view_result.php index 1f23b18c44..a9545dbd16 100755 --- a/main/gradebook/gradebook_view_result.php +++ b/main/gradebook/gradebook_view_result.php @@ -63,8 +63,7 @@ if (isset($_GET['editres'])) { $resultedit[0], 'edit_result_form', null, - api_get_self() . '?editres=' . $resultedit[0]->get_id( - ) . '&selecteval=' . $select_eval_edit + api_get_self() . '?editres=' . $resultedit[0]->get_id() . '&selecteval=' . $select_eval_edit.'&'.api_get_cidreq() ); if ($edit_res_form->validate()) { @@ -76,18 +75,21 @@ if (isset($_GET['editres'])) { $result->set_user_id($values['hid_user_id']); $result->set_evaluation_id($select_eval_edit); $row_value = isset($values['score']) ? (float) $values['score'] : 0; - if ((!empty($row_value)) || ($row_value == 0)) { + if (!empty($row_value) || $row_value == 0) { $result->set_score(floatval(number_format($row_value, api_get_setting('gradebook_number_decimals')))); } $result->save(); unset($result); - header('Location: gradebook_view_result.php?selecteval=' . $select_eval_edit . '&editresmessage='); + header('Location: gradebook_view_result.php?selecteval=' . $select_eval_edit . '&editresmessage=&'.api_get_cidreq()); exit; } } $file_type = null; if (isset($_GET['import'])) { - $interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult')); + $interbreadcrumb[] = array( + 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), + 'name' => get_lang('ViewResult') + ); $import_result_form = new DataForm( DataForm :: TYPE_IMPORT, 'import_result_form', diff --git a/main/gradebook/lib/GradebookUtils.php b/main/gradebook/lib/GradebookUtils.php index f55964ac95..8330957ac4 100644 --- a/main/gradebook/lib/GradebookUtils.php +++ b/main/gradebook/lib/GradebookUtils.php @@ -292,7 +292,7 @@ class GradebookUtils if ($is_locked && !api_is_platform_admin()) { $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); } else { - $modify_icons = '' . + $modify_icons = '' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . ''; } diff --git a/main/gradebook/lib/be/result.class.php b/main/gradebook/lib/be/result.class.php index 6f933eb173..25a656261f 100755 --- a/main/gradebook/lib/be/result.class.php +++ b/main/gradebook/lib/be/result.class.php @@ -64,6 +64,9 @@ class Result $this->created_at = $creation_date; } + /** + * @param float $score + */ public function set_score($score) { $this->score = $score; diff --git a/main/gradebook/lib/fe/resulttable.class.php b/main/gradebook/lib/fe/resulttable.class.php index 7e0a5aac8e..3b64c476a5 100755 --- a/main/gradebook/lib/fe/resulttable.class.php +++ b/main/gradebook/lib/fe/resulttable.class.php @@ -137,12 +137,16 @@ class ResultTable extends SortableTable return $sortable_data; } - private function build_edit_column ($item) { + private function build_edit_column ($item) + { $status=CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id()); $locked_status = $this->evaluation->get_locked(); - if (api_is_allowed_to_edit(null, true) && $locked_status == 0) {//api_is_course_admin() - $edit_column = ''.Display::return_icon('edit.png', get_lang('Modify'),'','22').''; - $edit_column .= ' '.Display::return_icon('delete.png', get_lang('Delete'),'','22').''; + if (api_is_allowed_to_edit(null, true) && $locked_status == 0) { + //api_is_course_admin() + $edit_column = ''. + Display::return_icon('edit.png', get_lang('Modify'),'','22').''; + $edit_column .= ' '. + Display::return_icon('delete.png', get_lang('Delete'),'','22').''; } if ($this->evaluation->get_course_code() == null) { $edit_column.= '