|
@@ 1307-1336 (lines=30) @@
|
| 1304 |
|
$total_score_obtained = 0; |
| 1305 |
|
$total_score_possible = 0; |
| 1306 |
|
$total_questions_answered = 0; |
| 1307 |
|
while ($row_user = Database::fetch_object($result_users)) { |
| 1308 |
|
// get time spent in the course and session |
| 1309 |
|
$time_spent += Tracking::get_time_spent_on_the_course($row_user->user_id, $courseId, $session_id); |
| 1310 |
|
$progress_tmp = Tracking::get_avg_student_progress($row_user->user_id, $row->code, array(), $session_id, true); |
| 1311 |
|
$progress += $progress_tmp[0]; |
| 1312 |
|
$nb_progress_lp += $progress_tmp[1]; |
| 1313 |
|
$score_tmp = Tracking::get_avg_student_score($row_user->user_id, $row->code, array(), $session_id, true); |
| 1314 |
|
if (is_array($score_tmp)) { |
| 1315 |
|
$score += $score_tmp[0]; |
| 1316 |
|
$nb_score_lp += $score_tmp[1]; |
| 1317 |
|
} |
| 1318 |
|
$nb_messages += Tracking::count_student_messages($row_user->user_id, $row->code, $session_id); |
| 1319 |
|
$nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id); |
| 1320 |
|
$last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row_user->user_id, $courseInfo, $session_id, false); |
| 1321 |
|
if ($last_login_date_tmp != false && $last_login_date == false) { |
| 1322 |
|
// TODO: To be cleaned. |
| 1323 |
|
$last_login_date = $last_login_date_tmp; |
| 1324 |
|
} else if($last_login_date_tmp != false && $last_login_date != false) { |
| 1325 |
|
// TODO: Repeated previous condition! To be cleaned. |
| 1326 |
|
// Find the max and assign it to first_login_date |
| 1327 |
|
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
| 1328 |
|
$last_login_date = $last_login_date_tmp; |
| 1329 |
|
} |
| 1330 |
|
} |
| 1331 |
|
|
| 1332 |
|
$exercise_results_tmp = self::exercises_results($row_user->user_id, $row->code, $session_id); |
| 1333 |
|
$total_score_obtained += $exercise_results_tmp['score_obtained']; |
| 1334 |
|
$total_score_possible += $exercise_results_tmp['score_possible']; |
| 1335 |
|
$total_questions_answered += $exercise_results_tmp['questions_answered']; |
| 1336 |
|
} |
| 1337 |
|
if ($nb_progress_lp > 0) { |
| 1338 |
|
$avg_progress = round($progress / $nb_progress_lp, 2); |
| 1339 |
|
} else { |
|
@@ 1468-1510 (lines=43) @@
|
| 1465 |
|
$total_score_obtained = 0; |
| 1466 |
|
$total_score_possible = 0; |
| 1467 |
|
$total_questions_answered = 0; |
| 1468 |
|
while($row_user = Database::fetch_object($result_users)) { |
| 1469 |
|
// get time spent in the course and session |
| 1470 |
|
$time_spent += Tracking::get_time_spent_on_the_course($row_user->user_id, $courseId, $session_id); |
| 1471 |
|
$progress_tmp = Tracking::get_avg_student_progress($row_user->user_id, $row->code, array(), $session_id, true); |
| 1472 |
|
$progress += $progress_tmp[0]; |
| 1473 |
|
$nb_progress_lp += $progress_tmp[1]; |
| 1474 |
|
$score_tmp = Tracking::get_avg_student_score($row_user->user_id, $row->code, array(), $session_id, true); |
| 1475 |
|
if (is_array($score_tmp)) { |
| 1476 |
|
$score += $score_tmp[0]; |
| 1477 |
|
$nb_score_lp += $score_tmp[1]; |
| 1478 |
|
} |
| 1479 |
|
$nb_messages += Tracking::count_student_messages( |
| 1480 |
|
$row_user->user_id, |
| 1481 |
|
$row->code, |
| 1482 |
|
$session_id |
| 1483 |
|
); |
| 1484 |
|
|
| 1485 |
|
$nb_assignments += Tracking::count_student_assignments( |
| 1486 |
|
$row_user->user_id, |
| 1487 |
|
$row->code, |
| 1488 |
|
$session_id |
| 1489 |
|
); |
| 1490 |
|
|
| 1491 |
|
$last_login_date_tmp = Tracking:: get_last_connection_date_on_the_course( |
| 1492 |
|
$row_user->user_id, |
| 1493 |
|
$courseInfo, |
| 1494 |
|
$session_id, |
| 1495 |
|
false |
| 1496 |
|
); |
| 1497 |
|
if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. |
| 1498 |
|
$last_login_date = $last_login_date_tmp; |
| 1499 |
|
} else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned. |
| 1500 |
|
// Find the max and assign it to first_login_date |
| 1501 |
|
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
| 1502 |
|
$last_login_date = $last_login_date_tmp; |
| 1503 |
|
} |
| 1504 |
|
} |
| 1505 |
|
|
| 1506 |
|
$exercise_results_tmp = self::exercises_results($row_user->user_id, $row->code, $session_id); |
| 1507 |
|
$total_score_obtained += $exercise_results_tmp['score_obtained']; |
| 1508 |
|
$total_score_possible += $exercise_results_tmp['score_possible']; |
| 1509 |
|
$total_questions_answered += $exercise_results_tmp['questions_answered']; |
| 1510 |
|
} |
| 1511 |
|
if($nb_progress_lp > 0) { |
| 1512 |
|
$avg_progress = round($progress / $nb_progress_lp, 2); |
| 1513 |
|
} else { |