Blocking exercise_report.php page for students

skala
Julio Montoya 13 years ago
parent 0b3200331a
commit 1ddab77bba
  1. 5
      main/exercice/exercise.lib.php
  2. 22
      main/inc/ajax/model.ajax.php

@ -976,10 +976,12 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
tth.exe_cours_id ASC, tth.exe_cours_id ASC,
tth.exe_date DESC"; tth.exe_date DESC";
} else { } else {
//any view is proposed to the student, they should see the results in the overview.php page //any view is proposed to the student, they should see the results in the overview.php page
exit; exit;
// Student view // Student view
/*
$sql = "SELECT DISTINCT $sql = "SELECT DISTINCT
te.exe_duration, te.exe_duration,
te.start_date, te.start_date,
@ -1013,6 +1015,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
FROM $TBL_TRACK_HOTPOTATOES FROM $TBL_TRACK_HOTPOTATOES
WHERE exe_user_id = '" . api_get_user_id() . "' AND exe_cours_id = '" . api_get_course_id() . "' $hotpotatoe_where WHERE exe_user_id = '" . api_get_user_id() . "' AND exe_cours_id = '" . api_get_course_id() . "' $hotpotatoe_where
ORDER BY exe_cours_id ASC, exe_date DESC"; ORDER BY exe_cours_id ASC, exe_date DESC";
*/
} }
$teacher_list = CourseManager::get_teacher_list_from_course_code(api_get_course_id()); $teacher_list = CourseManager::get_teacher_list_from_course_code(api_get_course_id());

@ -10,7 +10,7 @@ require_once '../global.inc.php';
$libpath = api_get_path(LIBRARY_PATH); $libpath = api_get_path(LIBRARY_PATH);
// 1. Setting variables needed by jqgrid // 1. Setting variables needed by jqgrid
$action = $_GET['a']; $action = $_GET['a'];
$page = intval($_REQUEST['page']); //page $page = intval($_REQUEST['page']); //page
$limit = intval($_REQUEST['rows']); //quantity of rows $limit = intval($_REQUEST['rows']); //quantity of rows
@ -105,7 +105,7 @@ switch ($action) {
case 'get_exercise_results': case 'get_exercise_results':
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php'; require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
$exercise_id = $_REQUEST['exerciseId']; $exercise_id = $_REQUEST['exerciseId'];
$count = get_count_exam_results($exercise_id); $count = get_count_exam_results($exercise_id);
break; break;
case 'get_sessions': case 'get_sessions':
$count = SessionManager::get_count_admin(); $count = SessionManager::get_count_admin();
@ -187,10 +187,18 @@ switch ($action) {
if ($is_allowedToEdit || $is_tutor) { if ($is_allowedToEdit || $is_tutor) {
$columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score','status','actions'); $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score','status','actions');
} else { } else {
$columns = array('exe_duration', 'start_date', 'exe_date', 'score', 'status', 'actions'); //$columns = array('exe_duration', 'start_date', 'exe_date', 'score', 'status', 'actions');
} }
$result = get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
if (isset($_GET['filter_by_user']) && !empty($_GET['filter_by_user'])) {
$filter_user = intval($_GET['filter_by_user']);
if ($where_condition == "") {
$where_condition .= " te.exe_user_id = '$filter_user'" ;
} else {
$where_condition .= " AND te.exe_user_id = '$filter_user'";
}
}
$result = get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
break; break;
case 'get_sessions': case 'get_sessions':
$columns = array('name', 'nbr_courses', 'nbr_users', 'category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility'); $columns = array('name', 'nbr_courses', 'nbr_users', 'category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');
@ -370,6 +378,6 @@ if (in_array($action, $allowed_actions)) {
$i++; $i++;
} }
} }
echo json_encode($response); echo json_encode($response);
} }
exit; exit;
Loading…
Cancel
Save