@@ 1285-1312 (lines=28) @@ | ||
1282 | $total_score_obtained = 0; |
|
1283 | $total_score_possible = 0; |
|
1284 | $total_questions_answered = 0; |
|
1285 | while ($row = Database::fetch_object($result)) { |
|
1286 | // get time spent in the course and session |
|
1287 | $time_spent += Tracking::get_time_spent_on_the_course($row->user_id, $courseInfo['real_id']); |
|
1288 | $progress_tmp = Tracking::get_avg_student_progress($row->user_id, $course_code, array(), null, true); |
|
1289 | $progress += $progress_tmp[0]; |
|
1290 | $nb_progress_lp += $progress_tmp[1]; |
|
1291 | $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true); |
|
1292 | if(is_array($score_tmp)) { |
|
1293 | $score += $score_tmp[0]; |
|
1294 | $nb_score_lp += $score_tmp[1]; |
|
1295 | } |
|
1296 | $nb_messages += Tracking::count_student_messages($row->user_id, $course_code); |
|
1297 | $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); |
|
1298 | $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false); |
|
1299 | if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned |
|
1300 | $last_login_date = $last_login_date_tmp; |
|
1301 | } else if($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned. |
|
1302 | // Find the max and assign it to first_login_date |
|
1303 | if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
|
1304 | $last_login_date = $last_login_date_tmp; |
|
1305 | } |
|
1306 | } |
|
1307 | ||
1308 | $exercise_results_tmp = MySpace::exercises_results($row->user_id, $course_code); |
|
1309 | $total_score_obtained += $exercise_results_tmp['score_obtained']; |
|
1310 | $total_score_possible += $exercise_results_tmp['score_possible']; |
|
1311 | $total_questions_answered += $exercise_results_tmp['questions_answered']; |
|
1312 | } |
|
1313 | if($nb_progress_lp > 0) { |
|
1314 | $avg_progress = round($progress / $nb_progress_lp, 2); |
|
1315 | } else { |
|
@@ 1434-1462 (lines=29) @@ | ||
1431 | $total_score_obtained = 0; |
|
1432 | $total_score_possible = 0; |
|
1433 | $total_questions_answered = 0; |
|
1434 | while ($row = Database::fetch_object($result)) { |
|
1435 | // get time spent in the course and session |
|
1436 | $time_spent += Tracking::get_time_spent_on_the_course($row->user_id, $courseId); |
|
1437 | $progress_tmp = Tracking::get_avg_student_progress($row->user_id, $course_code, array(), null, true); |
|
1438 | $progress += $progress_tmp[0]; |
|
1439 | $nb_progress_lp += $progress_tmp[1]; |
|
1440 | $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true); |
|
1441 | if(is_array($score_tmp)) { |
|
1442 | $score += $score_tmp[0]; |
|
1443 | $nb_score_lp += $score_tmp[1]; |
|
1444 | } |
|
1445 | $nb_messages += Tracking::count_student_messages($row->user_id, $course_code); |
|
1446 | $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); |
|
1447 | ||
1448 | $last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false); |
|
1449 | if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. |
|
1450 | $last_login_date = $last_login_date_tmp; |
|
1451 | } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned. |
|
1452 | // Find the max and assign it to first_login_date |
|
1453 | if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
|
1454 | $last_login_date = $last_login_date_tmp; |
|
1455 | } |
|
1456 | } |
|
1457 | ||
1458 | $exercise_results_tmp = MySpace::exercises_results($row->user_id, $course_code); |
|
1459 | $total_score_obtained += $exercise_results_tmp['score_obtained']; |
|
1460 | $total_score_possible += $exercise_results_tmp['score_possible']; |
|
1461 | $total_questions_answered += $exercise_results_tmp['questions_answered']; |
|
1462 | } |
|
1463 | if($nb_progress_lp > 0) { |
|
1464 | $avg_progress = round($progress / $nb_progress_lp, 2); |
|
1465 | } else { |