File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -3816,31 +3816,29 @@ public static function get_student_stats_by_question(
3816
3816
$ session_id = (int ) $ session_id ;
3817
3817
$ courseId = api_get_course_int_id ($ course_code );
3818
3818
3819
- if (empty ($ session_id )) {
3820
- $ courseCondition = "
3819
+ $ sql = "SELECT MAX(marks) as max, MIN(marks) as min, AVG(marks) as average
3820
+ FROM $ track_exercises e
3821
+ " ;
3822
+ if (true == $ onlyStudent ) {
3823
+ $ courseCondition = '' ;
3824
+ if (empty ($ session_id )) {
3825
+ $ courseCondition = "
3821
3826
INNER JOIN $ courseUser c
3822
3827
ON (
3823
3828
e.exe_user_id = c.user_id AND
3824
3829
e.c_id = c.c_id AND
3825
3830
c.status = " .STUDENT ."
3826
3831
AND relation_type <> 2
3827
- )
3828
- " ;
3829
- } else {
3830
- $ courseCondition = "
3832
+ ) " ;
3833
+ } else {
3834
+ $ courseCondition = "
3831
3835
INNER JOIN $ courseUser c
3832
3836
ON (
3833
3837
e.exe_user_id = c.user_id AND
3834
3838
e.c_id = c.c_id AND
3835
3839
c.status = 0
3836
- )
3837
- " ;
3838
- }
3839
-
3840
- $ sql = "SELECT MAX(marks) as max, MIN(marks) as min, AVG(marks) as average
3841
- FROM $ track_exercises e
3842
- " ;
3843
- if ($ onlyStudent == true ) {
3840
+ ) " ;
3841
+ }
3844
3842
$ sql .= $ courseCondition ;
3845
3843
}
3846
3844
$ sql .= "
You can’t perform that action at this time.
0 commit comments