Fix queries still using exe_cours_id and move as much as possible to integer variables around that - refs #7555

1.10.x
Yannick Warnier 10 years ago
parent 9106d63f3b
commit fedf5c3f31
  1. 15
      main/admin/user_move_stats.php
  2. 2
      main/exercice/exercice.php
  3. 35
      main/exercice/exercise.class.php
  4. 6
      main/exercice/exercise_result.class.php
  5. 8
      main/exercice/hotpotatoes_exercise_result.class.php
  6. 8
      main/exercice/mark_free_answer.php
  7. 8
      main/exercice/savescores.php
  8. 18
      main/gradebook/gradebook_result.class.php
  9. 19
      main/gradebook/lib/be/exerciselink.class.php
  10. 18
      main/inc/lib/api.lib.php
  11. 24
      main/inc/lib/course.lib.php
  12. 52
      main/inc/lib/exercise.lib.php
  13. 3
      main/inc/lib/myspace.lib.php
  14. 2
      main/inc/lib/sessionmanager.lib.php
  15. 80
      main/inc/lib/tracking.lib.php
  16. 10
      main/install/db_stats.sql
  17. 4
      main/mySpace/myStudents.php
  18. 4
      main/mySpace/progression.php
  19. 8
      main/mySpace/reussite.php
  20. 3
      main/reports/modules/quiz.php
  21. 5
      main/tracking/exams.php
  22. 2
      main/tracking/personnalLog.php
  23. 8
      tests/main/inc/lib/tracking.lib.test.php
  24. 6
      tests/scripts/fix_exercise_score_in_lp.php
  25. 3
      tests/scripts/move_users.php

@ -135,7 +135,7 @@ if (isset($_REQUEST['load_ajax'])) {
//ORIGINAL COURSE
$sql = "SELECT * FROM $TABLETRACK_EXERCICES
WHERE exe_cours_id = '$origin_course_code' AND session_id = $origin_session_id AND exe_user_id = $user_id ";
WHERE c_id = $course_id AND session_id = $origin_session_id AND exe_user_id = $user_id ";
$res = Database::query($sql);
$list = array();
while($row = Database::fetch_array($res,'ASSOC')) {
@ -162,7 +162,7 @@ if (isset($_REQUEST['load_ajax'])) {
if (!$update_database) {
$sql = "SELECT * FROM $TABLETRACK_EXERCICES
WHERE exe_cours_id = '$origin_course_code' AND session_id = $new_session_id AND exe_user_id = $user_id ";
WHERE c_id = $course_id AND session_id = $new_session_id AND exe_user_id = $user_id ";
$res = Database::query($sql);
$list = array();
while($row = Database::fetch_array($res,'ASSOC')) {
@ -583,9 +583,9 @@ $htmlHeadXtra[] = '<script type="text/javascript">
function get_courses_list_by_user_id_based_in_exercises($user_id) {
$TABLETRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$user_id = intval($user_id);
//$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, exe_cours_id ORDER by exe_user_id, exe_cours_id ASC";
$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session
FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id ORDER by exe_user_id, exe_cours_id ASC";
//$sql = "SELECT DISTINCT exe_user_id, c_id, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, c_id ORDER by exe_user_id, c_id ASC";
$sql = "SELECT DISTINCT exe_user_id, c_id, session_id as id_session
FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id ORDER by exe_user_id, c_id ASC";
$res = Database::query($sql);
$course_list = array();
@ -655,6 +655,11 @@ if (!empty($user_list)) {
if (empty($course_reg['id_session'])) {
$course_reg['id_session'] = 0;
}
// Recover the code for historical reasons. If it can be proven
// that the code can be safely replaced by c_id in the following
// PHP code, feel free to do so
$courseInfo = api_get_course_info_by_id($course_reg['c_id']);
$course_reg['code'] = $courseInfo['code'];
$new_course_list[] = $course_reg['code'].'_'.$course_reg['id_session'];
}

@ -785,7 +785,7 @@ if (!empty($exercise_list)) {
WHERE
exe_exo_id = ".$row['id']." AND
exe_user_id = ".$userId." AND
exe_cours_id = '".api_get_course_id()."' AND
c_id = ".api_get_course_int_id()." AND
status <> 'incomplete' AND
orig_lp_id = 0 AND
orig_lp_item_id = 0 AND

@ -1600,7 +1600,7 @@ class Exercise
$sql = "SELECT exe_id
FROM $table_track_e_exercises
WHERE
exe_cours_id = '".api_get_course_id()."' AND
c_id = ".api_get_course_int_id()." AND
exe_exo_id = ".$this->id." AND
session_id = ".api_get_session_id()." ".
$sql_where;
@ -1622,7 +1622,7 @@ class Exercise
$session_id = api_get_session_id();
// delete TRACK_E_EXERCISES table
$sql = "DELETE FROM $table_track_e_exercises
WHERE exe_cours_id = '".api_get_course_id()."'
WHERE c_id = ".api_get_course_int_id()."
AND exe_exo_id = ".$this->id."
$sql_where
AND session_id = ".$session_id."";
@ -1725,7 +1725,7 @@ class Exercise
}
$condition = ' WHERE exe_exo_id = ' . "'" . $this->id . "'" .' AND
exe_user_id = ' . "'" . api_get_user_id() . "'" . ' AND
exe_cours_id = ' . "'" . api_get_course_id() . "'" . ' AND
c_id = ' . api_get_course_int_id() . ' AND
status = ' . "'" . Database::escape_string($status). "'" . ' AND
orig_lp_id = ' . "'" . $lp_id . "'" . ' AND
orig_lp_item_id = ' . "'" . $lp_item_id . "'" . ' AND
@ -1783,7 +1783,6 @@ class Exercise
$params = array(
'exe_exo_id' => $this->id ,
'exe_user_id' => api_get_user_id(),
'exe_cours_id' => api_get_course_id(),
'c_id' => api_get_course_int_id(),
'status' => 'incomplete',
'session_id' => api_get_session_id(),
@ -4567,24 +4566,22 @@ class Exercise
$ids = implode(',', $ids);
$track_exercises = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if ($sessionId != 0) {
$sql = "SELECT * FROM $track_exercises te "
. "INNER JOIN c_quiz cq ON cq.id = te.exe_exo_id "
. "INNER JOIN course c ON te.exe_cours_id = c.code AND c.id = cq.c_id "
. "WHERE "
. "c.id = %s AND "
. "te.session_id = %s AND "
. "cq.id IN (%s) "
. "ORDER BY cq.id ";
$sql = "SELECT * FROM $track_exercises te
INNER JOIN c_quiz cq ON cq.id = te.exe_exo_id AND te.c_id = cq.c_id
WHERE
te.id = %s AND
te.session_id = %s AND
cq.id IN (%s)
ORDER BY cq.id";
$sql = sprintf($sql, $courseId, $sessionId, $ids);
} else {
$sql = "SELECT * FROM $track_exercises te "
. "INNER JOIN c_quiz cq ON cq.id = te.exe_exo_id "
. "INNER JOIN course c ON te.exe_cours_id = c.code AND c.id = cq.c_id "
. "WHERE "
. "c.id = %s AND "
. "cq.id IN (%s) "
. "ORDER BY cq.id ";
$sql = "SELECT * FROM $track_exercises te
INNER JOIN c_quiz cq ON cq.id = te.exe_exo_id AND te.c_id = cq.c_id
WHERE
te.id = %s AND
cq.id IN (%s)
ORDER BY cq.id";
$sql = sprintf($sql, $courseId, $ids);
}
$result = Database::query($sql);

@ -89,7 +89,7 @@ class ExerciseResult
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
te.c_id = ce.c_id $user_id_and $session_id_and AND
ce.active <>-1";
} else {
$user_id_and = ' AND te.exe_user_id = ' . api_get_user_id() . ' ';
@ -116,9 +116,9 @@ class ExerciseResult
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
te.c_id = ce.c_id $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";
ORDER BY userpart2, te.c_id ASC, ce.title ASC, te.exe_date DESC";
}
$results = array();

@ -45,9 +45,9 @@ class HotpotatoesExerciseResult
tth.exe_date
FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu
WHERE tu.user_id=tth.exe_user_id AND
tth.exe_cours_id = '" . Database :: escape_string($cid) . "' AND
tth.c_id = $course_id AND
tth.exe_name = '$hotpotato_name'
ORDER BY tth.exe_cours_id ASC, tth.exe_date ASC";
ORDER BY tth.c_id ASC, tth.exe_date ASC";
} else {
$user_id_and = ' AND te.exe_user_id = ' . api_get_user_id() . ' ';
// get only this user's results
@ -56,9 +56,9 @@ class HotpotatoesExerciseResult
FROM $TBL_TRACK_HOTPOTATOES
WHERE
exe_user_id = '" . $user_id . "' AND
exe_cours_id = '" . Database :: escape_string($cid) . "' AND
c_id = $course_id AND
tth.exe_name = '$hotpotato_name'
ORDER BY exe_cours_id ASC, exe_date ASC";
ORDER BY c_id ASC, exe_date ASC";
}
$results = array();

@ -81,11 +81,11 @@ $my_msg = 'No change.';
if ($action == 'mark') {
if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0) {
//mark the user mark into the database using something similar to the following function:
$my_int_cid = api_get_course_int_id($my_cid);
$exercise_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
#global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id;
$sql = "SELECT * FROM $exercise_table
WHERE exe_user_id = ".intval($my_usr)." AND exe_cours_id = '".Database::escape_string($my_cid)."' AND exe_exo_id = ".intval($my_exe)."
WHERE exe_user_id = ".intval($my_usr)." AND c_id = $my_int_cid AND exe_exo_id = ".intval($my_exe)."
ORDER BY exe_date DESC";
#echo $sql;
$res = Database::query($sql);
@ -104,14 +104,14 @@ if ($action == 'mark') {
$reallyNow = time();
$sql = "INSERT INTO $exercise_table (
exe_user_id,
exe_cours_id,
c_id,
exe_exo_id,
exe_result,
exe_weighting,
exe_date
) VALUES (
".intval($my_usr).",
'".Database::escape_string($my_cid)."',
$my_int_cid,
".intval($my_exe).",
'".Database::escape_string($my_score)."',
'".Database::escape_string($obj_question->selectWeighting())."',

@ -29,7 +29,6 @@ $origin = $_REQUEST['origin'];
$learnpath_item_id = intval($_REQUEST['learnpath_item_id']);
$lpViewId = isset($_REQUEST['lp_view_id']) ? intval($_REQUEST['lp_view_id']) : null;
$course_id = $courseInfo['real_id'];
$_cid = api_get_course_id();
$jscript2run = '';
/**
@ -43,10 +42,11 @@ $jscript2run = '';
*/
function save_scores($file, $score)
{
global $origin, $_user, $_cid, $TABLETRACK_HOTPOTATOES;
global $origin, $_user, $TABLETRACK_HOTPOTATOES;
// if tracking is disabled record nothing
$weighting = 100; // 100%
$date = api_get_utc_datetime();
$c_id = api_get_course_int_id();
if ($_user['user_id']) {
$user_id = $_user['user_id'];
@ -54,11 +54,11 @@ function save_scores($file, $score)
// anonymous
$user_id = "NULL";
}
$sql = "INSERT INTO $TABLETRACK_HOTPOTATOES (exe_name, exe_user_id, exe_date, exe_cours_id, exe_result, exe_weighting) VALUES (
$sql = "INSERT INTO $TABLETRACK_HOTPOTATOES (exe_name, exe_user_id, exe_date, c_id, exe_result, exe_weighting) VALUES (
'".Database::escape_string($file)."',
".intval($user_id).",
'".Database::escape_string($date)."',
'".Database::escape_string($_cid)."',
$c_id,
'".Database::escape_string($score)."',
'".Database::escape_string($weighting)."')";

@ -101,28 +101,28 @@ class GradeBookResult
FROM $TBL_EXERCISES ce , $TBL_TRACK_EXERCISES te, $TBL_USER user
WHERE ce.c_id = $course_id AND
te.exe_exo_id = ce.id AND
user_id=te.exe_user_id AND te.exe_cours_id='$cid'
ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
user_id=te.exe_user_id AND te.c_id = ce.c_id
ORDER BY te.c_id ASC, ce.title ASC, te.exe_date ASC";
$hpsql="SELECT ".(api_is_western_name_order() ? "CONCAT(tu.firstname,' ',tu.lastname)" : "CONCAT(tu.lastname,' ',tu.firstname)").", tth.exe_name,
tth.exe_result , tth.exe_weighting, tth.exe_date, tu.email, tu.user_id
FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu
WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '".$cid."'
ORDER BY tth.exe_cours_id ASC, tth.exe_date ASC";
WHERE tu.user_id=tth.exe_user_id AND tth.c_id = $course_id
ORDER BY tth.c_id ASC, tth.exe_date ASC";
} else { // get only this user's results
$sql = "SELECT '',ce.title, te.exe_result , te.exe_weighting, te.exe_date,te.exe_id
FROM $TBL_EXERCISES ce , $TBL_TRACK_EXERCISES te
WHERE ce.c_id = $course_id AND
te.exe_exo_id = ce.id AND
te.exe_user_id = '".$user_id."' AND
te.exe_cours_id = '$cid'
ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
te.exe_user_id = $user_id AND
te.c_id = ce.c_id
ORDER BY te.c_id ASC, ce.title ASC, te.exe_date ASC";
$hpsql="SELECT '',exe_name, exe_result , exe_weighting, exe_date
FROM $TBL_TRACK_HOTPOTATOES
WHERE exe_user_id = '".$user_id."' AND exe_cours_id = '".$cid."'
ORDER BY exe_cours_id ASC, exe_date ASC";
WHERE exe_user_id = '".$user_id."' AND c_id = $course_id
ORDER BY c_id ASC, exe_date ASC";
}
$results=StatsUtils::getManyResultsXCol($sql,8);

@ -165,11 +165,12 @@ class ExerciseLink extends AbstractLink
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$session_id = api_get_session_id();
$course_id = api_get_course_int_id($this->get_course_code());
$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats."
WHERE
session_id = $session_id AND
exe_cours_id = '".Database::escape_string($this->get_course_code())."'".' AND
exe_exo_id = '.(int)$this->get_ref_id();
c_id = $course_id AND
exe_exo_id = ".(int)$this->get_ref_id();
$result = Database::query($sql);
$number=Database::fetch_row($result);
return ($number[0] != 0);
@ -192,6 +193,7 @@ class ExerciseLink extends AbstractLink
/* the following query should be similar (in conditions) to the one used
in exercice/exercice.php, look for note-query-exe-results marker*/
$session_id = api_get_session_id();
$courseId = $this->getCourseId();
if (!$this->is_hp) {
$sql = "SELECT * FROM $tblStats
WHERE
@ -202,21 +204,18 @@ class ExerciseLink extends AbstractLink
session_id = $session_id";
if (isset($stud_id)) {
$course_code_exe = $this->get_course_code();
$sql .= " AND exe_cours_id = '$course_code_exe' AND exe_user_id = '$stud_id' ";
$sql .= " AND c_id = $courseId AND exe_user_id = $stud_id ";
}
$sql .= ' ORDER BY exe_id DESC';
} else {
$course_code_exe = $this->get_course_code();
$courseId = $this->getCourseId();
$sql = "SELECT * FROM $tblHp hp, $tblDoc doc
WHERE
hp.exe_cours_id = '$course_code_exe' AND
hp.exe_user_id = '$stud_id' AND
hp.c_id = $courseId AND
hp.exe_user_id = $stud_id AND
hp.exe_name = doc.path AND
doc.c_id = $courseId AND
doc.id = ".intval($this->get_ref_id())."";
doc.c_id = hp.c_id AND
doc.id = ".intval($this->get_ref_id());
}
$scores = Database::query($sql);

@ -1532,14 +1532,28 @@ function api_get_course_id() {
* @return int
*/
function api_get_real_course_id() {
return isset($_SESSION['_real_cid']) ? intval($_SESSION['_real_cid']) : 0;
return api_get_course_int_id();
}
/**
* Returns the current course id (integer)
* @param string $code Optional course code
* @return int
*/
function api_get_course_int_id() {
function api_get_course_int_id($code = null) {
if (!empty($code)) {
$code = Database::escape_string($code);
$row = Database::select(
'id',
Database::get_main_table(TABLE_MAIN_COURSE),
array('where'=> array('code = ?' => array($code)))
);
if (is_array($row) && count($row == 1)) {
return $row['id'];
} else {
return false;
}
}
return isset($_SESSION['_real_cid']) ? intval($_SESSION['_real_cid']) : 0;
}

@ -2201,7 +2201,7 @@ class CourseManager
if ($count == 0) {
self::create_database_dump($code);
$sql = "SELECT * FROM $table_course WHERE code='" . $codeFiltered . "'";
$sql = "SELECT * FROM $table_course WHERE code = '" . $codeFiltered . "'";
$res = Database::query($sql);
$course = Database::fetch_array($res);
$course_tables = AddCourse::get_course_tables();
@ -2252,31 +2252,31 @@ class CourseManager
// Delete the course from the stats tables
$sql = "DELETE FROM $table_stats_hotpots WHERE exe_cours_id = '" . $codeFiltered . "'";
$sql = "DELETE FROM $table_stats_hotpots WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_attempt WHERE course_code = '" . $codeFiltered . "'";
Database::query($sql);
$sql = "DELETE FROM $table_stats_exercises WHERE exe_cours_id = '" . $codeFiltered . "'";
$sql = "DELETE FROM $table_stats_exercises WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_access WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_access WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_lastaccess WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_lastaccess WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_course_access WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_course_access WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_online WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_online WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_default WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_default WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_downloads WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_downloads WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_links WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_links WHERE c_id = $courseId";
Database::query($sql);
$sql = "DELETE FROM $table_stats_uploads WHERE c_id = '" . $courseId . "'";
$sql = "DELETE FROM $table_stats_uploads WHERE c_id = $courseId";
Database::query($sql);
// Delete the course from the database
$sql = "DELETE FROM $table_course WHERE code='" . $codeFiltered . "'";
$sql = "DELETE FROM $table_course WHERE code = '" . $codeFiltered . "'";
Database::query($sql);
// delete extra course fields

@ -1142,11 +1142,11 @@ class ExerciseLib
$sql = " SELECT q.*, tee.*
FROM $TBL_EXERCICES as q
INNER JOIN $TBL_TRACK_EXERCICES as tee
ON q.id=tee.exe_exo_id
ON q.id = tee.exe_exo_id
INNER JOIN $TBL_COURSE c
ON c.code = tee.exe_cours_id
WHERE tee.exe_id=$exe_id
AND q.c_id=c.id";
ON c.id = tee.c_id
WHERE tee.exe_id = $exe_id
AND q.c_id = c.id";
$res_fb_type = Database::query($sql);
$result = Database::fetch_array($res_fb_type, 'ASSOC');
@ -1302,7 +1302,7 @@ class ExerciseLib
$in_get_count = false,
$where_condition = null
) {
$course_code = api_get_course_id();
$courseId = api_get_course_int_id();
/* by default in_column = 1 If parameters given,
it is the name of the column witch is the bdd field name*/
if ($in_column == 1) {
@ -1321,7 +1321,7 @@ class ExerciseLib
$sql = "SELECT * FROM $TBL_TRACK_HOTPOTATOES thp
JOIN $TBL_USER u ON thp.exe_user_id = u.user_id
WHERE thp.exe_cours_id = '$course_code' AND exe_name LIKE '$in_hotpot_path%'";
WHERE thp.c_id = $courseId AND exe_name LIKE '$in_hotpot_path%'";
// just count how many answers
if ($in_get_count) {
@ -1336,10 +1336,9 @@ class ExerciseLib
$res = Database::query($sql);
$result = array();
$apiIsAllowedToEdit = api_is_allowed_to_edit();
$urlBase = api_get_path(
WEB_CODE_PATH
) . 'exercice/hotpotatoes_exercise_report.php?action=delete&' . api_get_cidreq(
) . '&id=';
$urlBase = api_get_path(WEB_CODE_PATH) .
'exercice/hotpotatoes_exercise_report.php?action=delete&' .
api_get_cidreq() . '&id=';
while ($data = Database::fetch_array($res)) {
$actions = null;
@ -1387,13 +1386,12 @@ class ExerciseLib
);
$courseInfo = api_get_course_info_by_id($courseId);
$courseCode = $courseInfo['code'];
$exercisePath = Database::escape_string($exercisePath);
$userId = intval($userId);
$sql = "SELECT * FROM $table
WHERE
exe_cours_id = '$courseCode' AND
c_id = $courseId AND
exe_name LIKE '$exercisePath%' AND
exe_user_id = $userId
ORDER BY id
@ -1474,7 +1472,7 @@ class ExerciseLib
FROM $TBL_TRACK_EXERCICES ttte LEFT JOIN $TBL_TRACK_ATTEMPT_RECORDING tr
ON (ttte.exe_id = tr.exe_id)
WHERE
exe_cours_id = '$course_code' AND
c_id = $course_id AND
exe_exo_id = $exercise_id AND
ttte.session_id = " . $sessionId . "
)";
@ -1564,8 +1562,8 @@ class ExerciseLib
}
$sqlFromOption = " , $TBL_GROUP_REL_USER AS gru ";
$sqlWhereOption = " AND gru.c_id = " . api_get_course_int_id(
) . " AND gru.user_id = user.user_id ";
$sqlWhereOption = " AND gru.c_id = " . $course_id .
" AND gru.user_id = user.user_id ";
$first_and_last_name = api_is_western_name_order(
) ? "firstname, lastname" : "lastname, firstname";
@ -1602,8 +1600,8 @@ class ExerciseLib
INNER JOIN $sql_inner_join_tbl_user AS user ON (user.user_id = exe_user_id)
WHERE
te.status != 'incomplete' AND
te.exe_cours_id='" . api_get_course_id() . "' $session_id_and AND
ce.active <>-1 AND ce.c_id=" . api_get_course_int_id() . "
te.c_id = " . $course_id . " $session_id_and AND
ce.active <>-1 AND ce.c_id = " . $course_id . "
$exercise_where
$extra_where_conditions
";
@ -1630,14 +1628,14 @@ class ExerciseLib
$sqlFromOption
WHERE
user.user_id=tth.exe_user_id
AND tth.exe_cours_id = '" . api_get_course_id() . "'
AND tth.c_id = " . $course_id . "
$hotpotatoe_where
$sqlWhereOption
AND user.status NOT IN(" . api_get_users_status_ignored_in_reports(
'string'
) . ")
ORDER BY
tth.exe_cours_id ASC,
tth.c_id ASC,
tth.exe_date DESC";
}
@ -2733,18 +2731,19 @@ class ExerciseLib
$exercise_id = intval($exercise_id);
$course_code = Database::escape_string($course_code);
$session_id = intval($session_id);
$courseId = api_get_course_int_id($course_code);
$sql = "SELECT MAX(marks) as max, MIN(marks) as min, AVG(marks) as average
FROM $track_exercises e
INNER JOIN $track_attempt a
ON (
a.exe_id = e.exe_id AND
e.exe_cours_id = a.course_code AND
e.c_id = a.c_id AND
e.session_id = a.session_id
)
WHERE
exe_exo_id = $exercise_id AND
course_code = '$course_code' AND
a.c_id = $courseId AND
e.session_id = $session_id AND
question_id = $question_id AND
status = ''
@ -2784,7 +2783,7 @@ class ExerciseLib
$question_id = intval($question_id);
$exercise_id = intval($exercise_id);
$course_code = Database::escape_string($course_code);
$courseId = api_get_course_int_id($course_code);
$session_id = intval($session_id);
if (empty($session_id)) {
@ -2804,13 +2803,13 @@ class ExerciseLib
INNER JOIN $track_attempt a
ON (
a.exe_id = e.exe_id AND
e.exe_cours_id = a.course_code AND
e.c_id = a.c_id AND
e.session_id = a.session_id
)
$courseCondition
WHERE
exe_exo_id = $exercise_id AND
a.course_code = '$course_code' AND
a.c_id = $courseId AND
e.session_id = $session_id AND
question_id = $question_id AND
answer <> '0' AND
@ -2929,6 +2928,7 @@ class ExerciseLib
$question_id = intval($question_id);
$answer_id = intval($answer_id);
$exercise_id = intval($exercise_id);
$courseId = api_get_course_int_id($course_code);
$course_code = Database::escape_string($course_code);
$session_id = intval($session_id);
@ -2960,13 +2960,13 @@ class ExerciseLib
INNER JOIN $track_attempt a
ON (
a.exe_id = e.exe_id AND
e.exe_cours_id = a.course_code AND
e.c_id = a.c_id AND
e.session_id = a.session_id
)
$courseCondition
WHERE
exe_exo_id = $exercise_id AND
a.course_code = '$course_code' AND
a.c_id = $courseId AND
e.session_id = $session_id AND
$answer_condition
question_id = $question_id AND

@ -1877,9 +1877,10 @@ class MySpace
public static function exercises_results($user_id, $course_code, $session_id = false)
{
$questions_answered = 0;
$courseId = api_get_course_int_id($course_code);
$sql = 'SELECT exe_result , exe_weighting
FROM '.Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES)."
WHERE exe_cours_id = '".Database::escape_string($course_code)."'
WHERE c_id = ' . $courseId . '
AND exe_user_id = '".intval($user_id)."'";
if($session_id !== false) {
$sql .= " AND session_id = '".$session_id."' ";

@ -1007,7 +1007,7 @@ class SessionManager
$lessons_left = $lessons_total - $lessons_done;
//Exercises
$exercises_progress = str_replace('%', '', Tracking::get_exercise_student_progress($exercises, $user['user_id'], $course['code'], $user['id_session']));
$exercises_progress = str_replace('%', '', Tracking::get_exercise_student_progress($exercises, $user['user_id'], $course['real_id'], $user['id_session']));
$exercises_done = round(($exercises_progress * $exercises_total) / 100);
$exercises_left = $exercises_total - $exercises_done;

@ -541,7 +541,7 @@ class Tracking
exe_user_id="' . $user_id . '" AND
orig_lp_id = "' . $lp_id . '" AND
orig_lp_item_id = "' . $row['myid'] . '" AND
exe_cours_id="' . $courseCode . '" AND
c_id = ' . $course_id . ' AND
status <> "incomplete" AND
session_id = ' . $session_id . '
ORDER BY exe_date DESC
@ -651,7 +651,7 @@ class Tracking
exe_user_id="' . $user_id . '" AND
orig_lp_id = "' . $lp_id . '" AND
orig_lp_item_id = "' . $row['myid'] . '" AND
exe_cours_id="' . $courseCode. '" AND
c_id = ' . $course_id . ' AND
status <> "incomplete" AND
session_id = ' . $session_id . '
ORDER BY exe_date DESC ';
@ -829,7 +829,7 @@ class Tracking
exe_user_id="' . $user_id . '" AND
orig_lp_id = "' . (int) $lp_id . '" AND
orig_lp_item_id = "' . (int) $lp_item_id . '" AND
exe_cours_id="' . $courseCode . '" AND
c_id = ' . $course_id . ' AND
session_id = ' . $session_id . '
ORDER BY exe_date';
$res_attempts = Database::query($sql);
@ -1676,7 +1676,7 @@ class Tracking
exe_exo_id IN ('".$exercise_id."')
$condition_user AND
status = '' AND
exe_cours_id = '$course_code'
c_id = {$course_info['real_id']}
$condition_session
$condition_into_lp
ORDER BY exe_date DESC";
@ -1724,9 +1724,9 @@ class Tracking
/**
* Get count student's exercise COMPLETED attempts
* @param $student_id
* @param $course_code
* @param $exercise_id
* @param int $student_id
* @param int $courseId
* @param int $exercise_id
* @param int $lp_id
* @param int $lp_item_id
* @param int $session_id
@ -1742,24 +1742,24 @@ class Tracking
*/
public static function count_student_exercise_attempts(
$student_id,
$course_code,
$courseId,
$exercise_id,
$lp_id = 0,
$lp_item_id = 0,
$session_id = 0,
$find_all_lp = 0
) {
$course_code = Database::escape_string($course_code);
$courseId = intval($courseId);
$student_id = intval($student_id);
$exercise_id = intval($exercise_id);
$session_id = intval($session_id);
$lp_id = intval($lp_id);
$lp_item_id = intval($lp_item_id);
$tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_stats_exercises = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sql = "SELECT COUNT(ex.exe_id) as essais FROM $tbl_stats_exercices AS ex
WHERE ex.exe_cours_id = '$course_code'
$sql = "SELECT COUNT(ex.exe_id) as essais FROM $tbl_stats_exercises AS ex
WHERE ex.c_id = $courseId
AND ex.exe_exo_id = $exercise_id
AND status = ''
AND exe_user_id= $student_id
@ -1785,28 +1785,28 @@ class Tracking
*
* @param array $exercise_list
* @param int $user_id
* @param string $course_code
* @param int $courseId
* @param int $session_id
*/
public static function get_exercise_student_progress($exercise_list, $user_id, $course_code, $session_id)
public static function get_exercise_student_progress($exercise_list, $user_id, $courseId, $session_id)
{
$course_code = Database::escape_string($course_code);
$courseId = intval($courseId);
$user_id = intval($user_id);
$session_id = intval($session_id);
if (empty($exercise_list)) {
return '0%';
}
$tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_stats_exercises = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$exercise_list = array_keys($exercise_list);
$exercise_list = array_map('intval', $exercise_list);
$exercise_list_imploded = implode("' ,'", $exercise_list);
$sql = "SELECT COUNT(DISTINCT ex.exe_exo_id)
FROM $tbl_stats_exercices AS ex
FROM $tbl_stats_exercises AS ex
WHERE
ex.exe_cours_id = '$course_code' AND
ex.c_id = $courseId AND
ex.session_id = $session_id AND
ex.exe_user_id = $user_id AND
ex.exe_exo_id IN ('$exercise_list_imploded') ";
@ -2315,6 +2315,7 @@ class Tracking
$item_id = $row_max_score['iid'];
$item_path = $row_max_score['path'];
$lp_item_view_id = $row_max_score['lp_item_view_id'];
$courseId = api_get_course_int_id($course_code);
// Get last attempt to this exercise through
// the current lp for the current user
@ -2325,7 +2326,7 @@ class Tracking
exe_user_id = $user_id AND
orig_lp_item_id = $item_id AND
orig_lp_item_view_id = $lp_item_view_id AND
exe_cours_id = '$course_code' AND
c_id = $course_id AND
session_id = $session_id AND
status = ''
ORDER BY exe_date DESC
@ -5302,7 +5303,7 @@ class Tracking
qq.position = rq.question_order AND
ta.question_id = rq.question_id
WHERE
te.exe_cours_id = '$whereCourseCode' ".(empty($whereSessionParams)?'':"AND te.session_id IN ($whereSessionParams)")."
te.c_id = $courseIdx ".(empty($whereSessionParams)?'':"AND te.session_id IN ($whereSessionParams)")."
AND q.c_id = $courseIdx
$where $order $limit";
$sql_query = vsprintf($sql, $whereParams);
@ -6044,7 +6045,7 @@ class TrackingCourseLog
$total_user_exercise = Tracking::get_exercise_student_progress(
$total_exercises,
$user['user_id'],
$course_code,
$courseId,
$session_id
);
@ -6232,11 +6233,16 @@ class TrackingUserLog
/**
* Displays the exercise results for a specific user in a specific course.
* @param string $view
* @param int $user_id User ID
* @param string $courseCode Course code
* @return array
* @todo remove globals
*/
public function display_exercise_tracking_info($view, $user_id, $course_id)
public function display_exercise_tracking_info($view, $user_id, $courseCode)
{
global $TBL_TRACK_HOTPOTATOES, $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $dateTimeFormatLong;
$courseId = api_get_course_int_id($courseCode);
if(substr($view,1,1) == '1') {
$new_view = substr_replace($view,'0',1,1);
echo "<tr>
@ -6248,15 +6254,15 @@ class TrackingUserLog
$sql = "SELECT ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date)
FROM $TABLECOURSE_EXERCICES AS ce , $TABLETRACK_EXERCICES AS te
WHERE te.exe_cours_id = '".Database::escape_string($course_id)."'
AND te.exe_user_id = '".intval($user_id)."'
WHERE te.c_id = $courseId
AND te.exe_user_id = ".intval($user_id)."
AND te.exe_exo_id = ce.id
ORDER BY ce.title ASC, te.exe_date ASC";
$hpsql = "SELECT te.exe_name, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date)
FROM $TBL_TRACK_HOTPOTATOES AS te
WHERE te.exe_user_id = '".intval($user_id)."' AND te.exe_cours_id = '".Database::escape_string($course_id)."'
ORDER BY te.exe_cours_id ASC, te.exe_date ASC";
WHERE te.exe_user_id = '".intval($user_id)."' AND te.c_id = $courseId
ORDER BY te.c_id ASC, te.exe_date ASC";
$hpresults = StatsUtils::getManyResultsXCol($hpsql, 4);
@ -6605,26 +6611,32 @@ class TrackingUserLogCSV
/**
* Displays the exercise results for a specific user in a specific course.
* @param string $view
* @param int $user_id User ID
* @param string $courseCode Course code
* @return array
* @todo remove globals
*/
public function display_exercise_tracking_info($view, $user_id, $course_id)
public function display_exercise_tracking_info($view, $userId, $courseCode)
{
global $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $TABLETRACK_HOTPOTATOES, $dateTimeFormatLong;
$courseId = api_get_course_int_id($courseCode);
$userId = intval($userId);
if (substr($view,1,1) == '1') {
$new_view = substr_replace($view,'0',1,1);
$title[1]= get_lang('ExercicesDetails');
$line='';
$title[1] = get_lang('ExercicesDetails');
$line = '';
$sql = "SELECT ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date)
FROM $TABLECOURSE_EXERCICES AS ce , $TABLETRACK_EXERCICES AS te
WHERE te.exe_cours_id = '$course_id'
AND te.exe_user_id = '$user_id'
WHERE te.c_id = $courseId
AND te.exe_user_id = $userId
AND te.exe_exo_id = ce.id
ORDER BY ce.title ASC, te.exe_date ASC";
$hpsql = "SELECT te.exe_name, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date)
FROM $TABLETRACK_HOTPOTATOES AS te
WHERE te.exe_user_id = '$user_id' AND te.exe_cours_id = '$course_id'
ORDER BY te.exe_cours_id ASC, te.exe_date ASC";
WHERE te.exe_user_id = '$userId' AND te.c_id = $courseId
ORDER BY te.c_id ASC, te.exe_date ASC";
$hpresults = StatsUtils::getManyResultsXCol($hpsql, 4);
@ -6632,7 +6644,7 @@ class TrackingUserLogCSV
$NoHPTestRes = 0;
$results = StatsUtils::getManyResultsXCol($sql, 4);
$title_line=get_lang('ExercicesTitleExerciceColumn').";".get_lang('Date').';'.get_lang('ExercicesTitleScoreColumn')."\n";
$title_line = get_lang('ExercicesTitleExerciceColumn').";".get_lang('Date').';'.get_lang('ExercicesTitleScoreColumn')."\n";
if (is_array($results)) {
for($i = 0; $i < sizeof($results); $i++)

@ -113,15 +113,14 @@ CREATE TABLE track_e_exercises (
exe_id int NOT NULL auto_increment,
exe_user_id int unsigned default NULL,
exe_date datetime NOT NULL default '0000-00-00 00:00:00',
exe_cours_id varchar(40) NOT NULL default '',
c_id int NOT NULL,
exe_exo_id mediumint unsigned NOT NULL default 0,
exe_result float(6,2) NOT NULL default 0,
exe_weighting float(6,2) NOT NULL default 0,
user_ip varchar(39) NOT NULL default '',
PRIMARY KEY (exe_id),
KEY exe_user_id (exe_user_id),
KEY exe_cours_id (exe_cours_id)
KEY idx_tee_user_id (exe_user_id),
KEY idx_tee_c_id (c_id)
);
ALTER TABLE track_e_exercises ADD status varchar(20) NOT NULL default '';
@ -179,12 +178,11 @@ CREATE TABLE track_e_hotpotatoes (
exe_name VARCHAR( 255 ) NOT NULL ,
exe_user_id int unsigned DEFAULT NULL ,
exe_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
exe_cours_id varchar(40) NOT NULL,
c_id int NOT NULL,
exe_result smallint default 0 NOT NULL ,
exe_weighting smallint default 0 NOT NULL,
KEY exe_user_id (exe_user_id),
KEY exe_cours_id (exe_cours_id)
KEY idx_tehp_user_id (exe_user_id),
KEY idx_tehp_c_id (c_id)
);
DROP TABLE IF EXISTS track_e_links;

@ -964,7 +964,7 @@ if (!empty($student_id)) {
if (Database :: num_rows($result_exercices) > 0) {
while ($exercices = Database :: fetch_array($result_exercices)) {
$exercise_id = intval($exercices['id']);
$count_attempts = Tracking::count_student_exercise_attempts($student_id, $course_code, $exercise_id, 0, 0, $session_id, 2);
$count_attempts = Tracking::count_student_exercise_attempts($student_id, $courseInfo['real_id'], $exercise_id, 0, 0, $session_id, 2);
$score_percentage = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $session_id, 1, 0);
if (!isset($score_percentage) && $count_attempts > 0) {
@ -1008,7 +1008,7 @@ if (!empty($student_id)) {
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
WHERE exe_exo_id ="'.$exercise_id.'" AND
exe_user_id ="'.$student_id.'" AND
exe_cours_id ="'.$course_code.'" AND
c_id = '.$courseInfo['real_id'].' AND
session_id ="'.$session_id.'" AND
status = ""
ORDER BY exe_date DESC LIMIT 1';

@ -34,7 +34,7 @@ $tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCIS
/*
MAIN CODE
*/
$sql_course = "SELECT title,code FROM $tbl_course as course ORDER BY title ASC";
$sql_course = "SELECT title, code, id FROM $tbl_course as course ORDER BY title ASC";
$result_course = Database::query($sql_course);
if (Database::num_rows($result_course) > 0) {
@ -48,7 +48,7 @@ if (Database::num_rows($result_course) > 0) {
// TODO: This query is to be checked, there are no HotPotatoes tests results.
$sql_moy_test = "SELECT exe_result,exe_weighting
FROM $tbl_track_exercice
WHERE exe_cours_id = '".$a_course['code']."'";
WHERE c_id = ".$a_course['id'];
$result_moy_test = Database::query($sql_moy_test);
$result = 0;
$weighting = 0;

@ -46,7 +46,7 @@ if (!empty($_GET['session'])) {
if (Database::num_rows($result_session) > 0) {
echo '<table class="data_table"><tr><th>'.get_lang('Session').'</th><th>'.get_lang('MoyenneTest').'</th><th>'.get_lang('MoyenneExamen').'</th></tr>';
while ($session = Database::fetch_array($result_session)) {
$sql_course = "SELECT title,code
$sql_course = "SELECT title, code, id
FROM $tbl_course as course
INNER JOIN $tbl_session_course AS rel_course
ON course.code = rel_course.course_code
@ -59,7 +59,7 @@ if (!empty($_GET['session'])) {
while ($course = Database::fetch_array($result_course)) {
$sql_moy_test = "SELECT exe_result,exe_weighting
FROM $tbl_track_exercice
WHERE exe_cours_id = '".$course['code']."'";
WHERE c_id = ".$course['id'];
$result_moy_test = Database::query($sql_moy_test);
$result = 0;
$weighting = 0;
@ -83,7 +83,7 @@ if (!empty($_GET['session'])) {
echo get_lang('NoSession');
}
} else {
$sql_course = "SELECT title,code
$sql_course = "SELECT title, code, id
FROM $tbl_course as course
ORDER BY title ASC";
@ -96,7 +96,7 @@ if (!empty($_GET['session'])) {
while ($course= Database::fetch_array($result_course)) {
$sql_moy_test = "SELECT exe_result,exe_weighting
FROM $tbl_track_exercice
WHERE exe_cours_id = '".$course['code']."'";
WHERE c_id = ".$course['id'];
$result_moy_test = Database::query($sql_moy_test);
$result = 0;
$weighting = 0;

@ -21,12 +21,13 @@ function reports_modules_quiz_init_forEachCourses($course_code, $course_id, $cou
}
function reports_modules_quiz_quizVal($quiz, $key_id) {
$courseId = api_get_course_int_id($quiz['course_code']);
return array('type'=> 'sql', 'sql' =>
'select '.$key_id.', exe_user_id as uid, '.
'session_id, -1 as attempt, exe_result as score, '.
REPORTS_PROGRESS_COMPLETED.' as progress, '.
'exe_duration as time, exe_date as ts from '.
Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
' where exe_cours_id = '."'".$quiz['course_code']."'".
' where c_id = ' . $courseId .
' and exe_exo_id='.$quiz['child_id']);
}

@ -469,6 +469,7 @@ function export_complete_report_xls($filename, $array)
function processStudentList($filter_score, $global, $exercise, $courseInfo, $sessionId, $newSessionList)
{
$exerciseStatsTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$courseId = api_get_course_int_id($courseInfo['code']);
if (empty($sessionId)) {
$students = CourseManager::get_student_list_from_course_code(
@ -528,7 +529,7 @@ function processStudentList($filter_score, $global, $exercise, $courseInfo, $ses
$sql = "SELECT COUNT(ex.exe_id) as count
FROM $exerciseStatsTable AS ex
WHERE
ex.exe_cours_id = '".$courseInfo['code']."' AND
ex.c_id = $courseId AND
ex.exe_exo_id = ".$exercise['id']." AND
exe_user_id='".$studentId."' AND
session_id = $sessionId
@ -540,7 +541,7 @@ function processStudentList($filter_score, $global, $exercise, $courseInfo, $ses
FROM $exerciseStatsTable
WHERE
exe_user_id = ".$studentId." AND
exe_cours_id = '".$courseInfo['code']."' AND
c_id = $courseId AND
exe_exo_id = ".$exercise['id']." AND
session_id = $sessionId
ORDER BY exe_result DESC

@ -211,7 +211,7 @@ api_display_tool_title($nameTools);
FROM $TABLECOURSE_EXERCICES AS ce , $TABLETRACK_EXERCICES AS te
WHERE te.exe_user_id = '".$_user['user_id']."'
AND te.exe_exo_id = ce.id
ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
ORDER BY te.c_id ASC, ce.title ASC, te.exe_date ASC";
echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>";
$results = getManyResultsXCol($sql,4);

@ -389,8 +389,8 @@ class TestTrackingUserLog extends UnitTestCase {
ob_start();
$view = '';
$user_id = 1;
$course_id = 1;
$res = TrackingUserLog::display_exercise_tracking_info($view, $user_id, $course_id);
$courseCode = 'TEST';
$res = TrackingUserLog::display_exercise_tracking_info($view, $user_id, $courseCode);
$this->assertTrue(is_null($res));
ob_end_clean();
//var_dump($res);
@ -444,8 +444,8 @@ class TestTrackingUserLogCSV extends UnitTestCase {
//ob_start();
$view = '';
$user_id = 1;
$course_id = 1;
$res = TrackingUserLogCSV::display_exercise_tracking_info($view, $user_id, $course_id);
$courseCode = 'TEST';
$res = TrackingUserLogCSV::display_exercise_tracking_info($view, $user_id, $courseCode);
$this->assertTrue(is_array($res));
//ob_end_clean();
//var_dump($res);

@ -22,14 +22,14 @@ $sql = "SELECT
exe_exo_id,
orig_lp_id,
orig_lp_item_view_id,
exe_cours_id,
c_id,
c.code,
c.id real_id,
session_id
FROM $tableExercise t INNER JOIN $tableCourse c
ON c.code = t.exe_cours_id
ON c.id = t.c_id
WHERE orig_lp_id != '' AND orig_lp_item_view_id = 0 AND status = ''
ORDER by session_id, exe_cours_id, exe_user_id, orig_lp_id, exe_exo_id
ORDER by session_id, c_id, exe_user_id, orig_lp_id, exe_exo_id
";
$result = Database::query($sql);

@ -67,9 +67,10 @@ function moveUserFromCourseToCourse($originCourse, $destinationCourse, $debug =
$output .= 'Moving students who have no exe results from course '.$originCourse.' to course '.$destinationCourse.$eol;
$tableCRU = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableTEE = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$courseId = api_get_course_int_id($originCourse);
// Get the users who have passed an exam in the course of origin
$sql = "SELECT distinct(exe_user_id) FROM $tableTEE
WHERE exe_cours_id = '$originCourse'";
WHERE c_id = $courseId";
//AND status != 'incomplete'";
$output .= "$sql".$eol;
$res = Database::query($sql);

Loading…
Cancel
Save