|
@@ 953-980 (lines=28) @@
|
| 950 |
|
$total_score_obtained = 0; |
| 951 |
|
$total_score_possible = 0; |
| 952 |
|
$total_questions_answered = 0; |
| 953 |
|
while ($row = Database::fetch_object($result)) { |
| 954 |
|
// get time spent in the course and session |
| 955 |
|
$time_spent += Tracking::get_time_spent_on_the_course($row->user_id, $courseInfo['real_id']); |
| 956 |
|
$progress_tmp = Tracking::get_avg_student_progress($row->user_id, $course_code, array(), null, true); |
| 957 |
|
$progress += $progress_tmp[0]; |
| 958 |
|
$nb_progress_lp += $progress_tmp[1]; |
| 959 |
|
$score_tmp = Tracking::get_avg_student_score($row->user_id, $course_code, array(), null, true); |
| 960 |
|
if(is_array($score_tmp)) { |
| 961 |
|
$score += $score_tmp[0]; |
| 962 |
|
$nb_score_lp += $score_tmp[1]; |
| 963 |
|
} |
| 964 |
|
$nb_messages += Tracking::count_student_messages($row->user_id, $course_code); |
| 965 |
|
$nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); |
| 966 |
|
$last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false); |
| 967 |
|
if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned |
| 968 |
|
$last_login_date = $last_login_date_tmp; |
| 969 |
|
} else if($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned. |
| 970 |
|
// Find the max and assign it to first_login_date |
| 971 |
|
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
| 972 |
|
$last_login_date = $last_login_date_tmp; |
| 973 |
|
} |
| 974 |
|
} |
| 975 |
|
|
| 976 |
|
$exercise_results_tmp = self::exercises_results($row->user_id, $course_code); |
| 977 |
|
$total_score_obtained += $exercise_results_tmp['score_obtained']; |
| 978 |
|
$total_score_possible += $exercise_results_tmp['score_possible']; |
| 979 |
|
$total_questions_answered += $exercise_results_tmp['questions_answered']; |
| 980 |
|
} |
| 981 |
|
if ($nb_progress_lp > 0) { |
| 982 |
|
$avg_progress = round($progress / $nb_progress_lp, 2); |
| 983 |
|
} else { |
|
@@ 1102-1130 (lines=29) @@
|
| 1099 |
|
$total_score_obtained = 0; |
| 1100 |
|
$total_score_possible = 0; |
| 1101 |
|
$total_questions_answered = 0; |
| 1102 |
|
while ($row = Database::fetch_object($result)) { |
| 1103 |
|
// get time spent in the course and session |
| 1104 |
|
$time_spent += Tracking::get_time_spent_on_the_course($row->user_id, $courseId); |
| 1105 |
|
$progress_tmp = Tracking::get_avg_student_progress($row->user_id, $course_code, array(), null, true); |
| 1106 |
|
$progress += $progress_tmp[0]; |
| 1107 |
|
$nb_progress_lp += $progress_tmp[1]; |
| 1108 |
|
$score_tmp = Tracking::get_avg_student_score($row->user_id, $course_code, array(), null, true); |
| 1109 |
|
if(is_array($score_tmp)) { |
| 1110 |
|
$score += $score_tmp[0]; |
| 1111 |
|
$nb_score_lp += $score_tmp[1]; |
| 1112 |
|
} |
| 1113 |
|
$nb_messages += Tracking::count_student_messages($row->user_id, $course_code); |
| 1114 |
|
$nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); |
| 1115 |
|
|
| 1116 |
|
$last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false); |
| 1117 |
|
if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. |
| 1118 |
|
$last_login_date = $last_login_date_tmp; |
| 1119 |
|
} else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned. |
| 1120 |
|
// Find the max and assign it to first_login_date |
| 1121 |
|
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
| 1122 |
|
$last_login_date = $last_login_date_tmp; |
| 1123 |
|
} |
| 1124 |
|
} |
| 1125 |
|
|
| 1126 |
|
$exercise_results_tmp = self::exercises_results($row->user_id, $course_code); |
| 1127 |
|
$total_score_obtained += $exercise_results_tmp['score_obtained']; |
| 1128 |
|
$total_score_possible += $exercise_results_tmp['score_possible']; |
| 1129 |
|
$total_questions_answered += $exercise_results_tmp['questions_answered']; |
| 1130 |
|
} |
| 1131 |
|
if($nb_progress_lp > 0) { |
| 1132 |
|
$avg_progress = round($progress / $nb_progress_lp, 2); |
| 1133 |
|
} else { |