FROM $TBL_EXERCISES AS ce INNER JOIN $TBL_TRACK_EXERCISES AS te ON (te.exe_exo_id = ce.id) INNER JOIN
$TBL_USER AS user ON (user.user_id = exe_user_id)
te.exe_duration as duration,
te.orig_lp_id as orig_lp_id,
tlm.name as lp_name
FROM $TBL_EXERCISES AS ce
INNER JOIN $TBL_TRACK_EXERCISES AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $TBL_USER AS user ON (user.user_id = exe_user_id)
LEFT JOIN $TBL_TABLE_LP_MAIN AS tlm ON tlm.id = te.orig_lp_id AND tlm.c_id = ce.c_id
WHERE ce.c_id = $course_id AND
te.status != 'incomplete' AND
te.exe_cours_id='" . Database :: escape_string($cid) . "' $user_id_and $session_id_and AND
ce.active <>-1 AND
orig_lp_id = 0 AND
orig_lp_item_id = 0";
ce.active <>-1";
$hpsql="SELECT ".(api_is_western_name_order() ? "firstname as userpart1, lastname userpart2" : "lastname as userpart1, firstname as userpart2").",
email,
tth.exe_name,
@ -149,15 +152,18 @@ class ExerciseResult
steps_counter as exstep,
exe_user_id as excruid,
te.exe_duration as duration,
ce.results_disabled as exdisabled
FROM $TBL_EXERCISES AS ce INNER JOIN $TBL_TRACK_EXERCISES AS te ON (te.exe_exo_id = ce.id) INNER JOIN $TBL_USER AS user ON (user.user_id = exe_user_id)
WHERE ce.c_id = $course_id AND
te.status != 'incomplete' AND
te.exe_cours_id='" . Database :: escape_string($cid) . "' $user_id_and $session_id_and AND
ce.active <>-1 AND
orig_lp_id = 0 AND
orig_lp_item_id = 0
ORDER BY userpart2, te.exe_cours_id ASC, ce.title ASC, te.exe_date DESC";
ce.results_disabled as exdisabled,
te.orig_lp_id as orig_lp_id,
tlm.name as lp_name
FROM $TBL_EXERCISES AS ce
INNER JOIN $TBL_TRACK_EXERCISES AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $TBL_USER AS user ON (user.user_id = exe_user_id)
LEFT JOIN $TBL_TABLE_LP_MAIN AS tlm ON tlm.id = te.orig_lp_id AND tlm.c_id = ce.c_id
WHERE ce.c_id = $course_id AND
te.status != 'incomplete' AND
te.exe_cours_id='" . Database :: escape_string($cid) . "' $user_id_and $session_id_and AND
ce.active <>-1 AND
ORDER BY userpart2, te.exe_cours_id ASC, ce.title ASC, te.exe_date DESC";