MDL-58884 competency: Inaccurate stats proficient competencies in course
authorIssam Taboubi <issam.taboubi@umontreal.ca>
Wed, 10 May 2017 17:24:00 +0000 (13:24 -0400)
committerIssam Taboubi <issam.taboubi@umontreal.ca>
Wed, 10 May 2017 19:08:21 +0000 (15:08 -0400)
competency/classes/user_competency_course.php

index e0e7d4e..392e1c5 100644 (file)
@@ -243,6 +243,8 @@ class user_competency_course extends persistent {
 
         $sql = 'SELECT COUNT(comp.id)
                   FROM {' . self::TABLE . '} usercoursecomp
+                  JOIN {' . course_competency::TABLE . '} cc
+                    ON usercoursecomp.competencyid = cc.competencyid AND cc.courseid = usercoursecomp.courseid
                   JOIN {' . competency::TABLE . '} comp
                     ON usercoursecomp.competencyid = comp.id
                  WHERE usercoursecomp.courseid = ? AND usercoursecomp.userid = ? AND usercoursecomp.proficiency = ?';