$hotpotatoe_where .= ' AND exe_name = "'.$hotpotatoe_path.'" ';
}
// sql for chamilo-type tests for teacher / tutor view
$sql_inner_join_tbl_track_exercices = "(SELECT ttte.*, if(tr.exe_id,1, 0) as revised FROM $TBL_TRACK_EXERCICES ttte LEFT JOIN $TBL_TRACK_ATTEMPT_RECORDING tr ON (ttte.exe_id = tr.exe_id) )";
if ($is_allowedToEdit || $is_tutor) {
//Teacher view
if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
//$exercise_where_query = ' te.exe_exo_id = ce.id AND ';
}
$sqlFromOption = "";
$sqlWhereOption = ""; // for hpsql
$sql_inner_join_tbl_user = "";
$sql_inner_join_tbl_track_exercices = "";
$filter_by_group = intval($filter_by_group);
$sqlFromOption = "";
$sqlWhereOption = ""; // for hpsql
$sql_inner_join_tbl_user = "";
$filter_by_group = intval($filter_by_group);
//@todo fix to work with COURSE_RELATION_TYPE_RRHH in both queries
$sqlWhereOption = " AND gru.c_id=".api_get_course_int_id()." AND gru.user_id=user.user_id AND gru.group_id=".Database :: escape_string($filter_by_group);
break;
}
// Filter by group
$sql_inner_join_tbl_user = "
(SELECT u.user_id, firstname, lastname, email, username, g.name as group_name, g.id as group_id
FROM $TBL_USER u
INNER JOIN $TBL_GROUP_REL_USER gru ON (
gru.user_id = u.user_id
AND gru.c_id=".api_get_course_int_id().")
INNER JOIN $TBL_GROUP g ON (gru.group_id = g.id)
)";
$sqlFromOption = " ,$TBL_GROUP_REL_USER AS gru ";
$sqlWhereOption = " AND gru.c_id=".api_get_course_int_id()." AND gru.user_id=user.user_id";
// sql for chamilo-type tests for teacher / tutor view
$sql_inner_join_tbl_track_exercices = "(SELECT ttte.*, if(tr.exe_id,1, 0) as revised FROM $TBL_TRACK_EXERCICES ttte LEFT JOIN $TBL_TRACK_ATTEMPT_RECORDING tr ON (ttte.exe_id = tr.exe_id) )";
$sql = "SELECT DISTINCT
user_id,
$first_and_last_name,
@ -864,8 +846,8 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
exe_user_id,
te.exe_duration,
propagate_neg,
revised
FROM
revised, group_name
FROM
$TBL_EXERCICES AS ce
INNER JOIN $sql_inner_join_tbl_track_exercices AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $sql_inner_join_tbl_user AS user ON (user.user_id = exe_user_id)
@ -901,7 +883,9 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
tth.exe_cours_id ASC,
tth.exe_date DESC";
} else {
// get only this user's results
//any view is proposed to the student, they should see the results in the overview.php page
exit;
// Student view
$sql = "SELECT DISTINCT
te.exe_duration,
@ -916,19 +900,20 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
steps_counter,
exe_user_id,
ce.results_disabled,
propagate_neg
propagate_neg,
revised
FROM
$TBL_EXERCICES AS ce
INNER JOIN $TBL_TRACK_EXERCICES AS te ON (te.exe_exo_id = ce.id)
$TBL_EXERCICES AS ce
INNER JOIN $sql_inner_join_tbl_track_exercices AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $TBL_USER AS user ON (user.user_id = exe_user_id)
WHERE $extra_where_conditions AND
te.status != 'incomplete'
AND te.exe_cours_id='".api_get_course_id()."'
AND te.exe_user_id = ".api_get_user_id()." $session_id_and
AND ce.active <>-1
AND orig_lp_id = 0
AND te.exe_cours_id='".api_get_course_id()."'
AND te.exe_user_id = ".api_get_user_id()." $session_id_and