Add api_get_cidreq()

1.10.x
Julio Montoya 10 years ago
parent 7e40244821
commit 75331ba831
  1. 12
      main/gradebook/gradebook_add_user.php
  2. 12
      main/gradebook/gradebook_edit_result.php
  3. 6
      main/gradebook/gradebook_statistics.php
  4. 12
      main/gradebook/gradebook_view_result.php
  5. 2
      main/gradebook/lib/GradebookUtils.php
  6. 3
      main/gradebook/lib/be/result.class.php
  7. 12
      main/gradebook/lib/fe/resulttable.class.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);

@ -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;

@ -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();

@ -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',

@ -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 = '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . ' &amp;cidReq=' . $eval->get_course_code() . '&id_session='.$eval->getSessionId(). '">' .
$modify_icons = '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . '&cidReq=' . $eval->get_course_code() . '&id_session='.$eval->getSessionId(). '">' .
Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
}

@ -64,6 +64,9 @@ class Result
$this->created_at = $creation_date;
}
/**
* @param float $score
*/
public function set_score($score)
{
$this->score = $score;

@ -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 = '<a href="' . api_get_self() . '?editres=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id() . '">'.Display::return_icon('edit.png', get_lang('Modify'),'','22').'</a>';
$edit_column .= ' <a href="' . api_get_self() . '?delete_mark=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id() . '">'.Display::return_icon('delete.png', get_lang('Delete'),'','22').'</a>';
if (api_is_allowed_to_edit(null, true) && $locked_status == 0) {
//api_is_course_admin()
$edit_column = '<a href="' . api_get_self() . '?editres=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id().'&'.api_get_cidreq().'">'.
Display::return_icon('edit.png', get_lang('Modify'),'','22').'</a>';
$edit_column .= ' <a href="' . api_get_self() . '?delete_mark=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id().'&'.api_get_cidreq().'">'.
Display::return_icon('delete.png', get_lang('Delete'),'','22').'</a>';
}
if ($this->evaluation->get_course_code() == null) {
$edit_column.= '&nbsp;<a href="' . api_get_self() . '?resultdelete=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id() . '" onclick="return confirmationuser();">

Loading…
Cancel
Save