Skip to content

Commit

Permalink
Merge branch 'develop4'
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysius committed Mar 11, 2019
2 parents 9bdb6a1 + f064f28 commit abf1c20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,15 +880,17 @@ function mod_studentquiz_helper_attempt_stat_joins($aggregated) {
SUM(1 - lastanswercorrect) AS last_attempt_incorrect
FROM {studentquiz_progress} sp
JOIN {studentquiz} sq ON sq.id = sp.studentquizid
WHERE sq.coursemodule = :cmid2
JOIN {question} q ON q.id = sp.questionid
WHERE sq.coursemodule = :cmid2 and q.hidden = 0
GROUP BY sp.userid
) lastattempt ON lastattempt.userid = u.id
LEFT JOIN (
SELECT SUM(attempts) AS counta, SUM(correctattempts) AS countright,
SUM(attempts - correctattempts) AS countwrong, sp.userid AS userid
FROM {studentquiz_progress} sp
JOIN {studentquiz} sq ON sq.id = sp.studentquizid
WHERE sq.coursemodule = :cmid1
JOIN {question} q ON q.id = sp.questionid
WHERE sq.coursemodule = :cmid1 and q.hidden = 0
GROUP BY sp.userid
) attempts ON attempts.userid = u.id";
} else {
Expand Down

0 comments on commit abf1c20

Please sign in to comment.