Of course I will add this to the BugTracker but it was easier to use the forum to paste some screen copies illustrating the problem.
Imagine a quiz with just a multiple choice question with 2 answers one is true (graded 100%) and the other false (graded 0%). Of course I could have used a true/false question for my demonstration but as there is currently a problem in item analysis with true/false question results display (see my bugtracker report), I choose a multiple choice question for clarity.
This test has been attempted by 3 students Huey, Dewey and Louie
The list of attempts is as follow :
|First name / Surname||Started on||Time taken||Grade/10||#1|
|Huey Duck||16 July 2005, 01:25 PM||13 secs||0||0|
| ||16 July 2005, 01:29 PM||6 secs||10||1|
|Dewey Duck||16 July 2005, 01:26 PM||7 secs||10||1|
| ||16 July 2005, 01:26 PM||10 secs||0||0|
| ||16 July 2005, 01:27 PM||16 secs||0||0|
|Louie Duck||16 July 2005, 01:28 PM||7 secs||10||1|
| ||16 July 2005, 01:28 PM||8 mins 50 secs||10||1|
If we choose Attempts to analyze per user : "All attempts", the SQL query generated is
SELECT qa.* FROM mdl_user u LEFT JOIN mdl_quiz_attempts qa ON u.id = qa.userid WHERE u.id IN (3,4,5,6,7,8) AND ( qa.quiz = 5) AND ( qa.sumgrades >= 0 )
wich is correct and I found no problem in iten analysis display :
But if we choose Attempts to analyze per user : "highest grade" the SQL query is
SELECT qa.* , max(qa.sumgrades) FROM mdl_user u LEFT JOIN mdl_quiz_attempts qa ON u.id = qa.userid WHERE u.id IN (3,4,5,6,7,8) AND ( qa.quiz = 5) AND ( qa.sumgrades >= 0 ) GROUP BY qa.userid
wich obviously has a problem because not all non agregated fields are in the group by.
And the display confirm the problem :
R. Counts should be 0/3 for answer1 and 3/3 for answer2. I am not quite sure of a good (and scalable for large number of students/attempts/questions) solution.
If any (my)sql expert has any advice ?
Until this problem is solved it is safe to only rely on item analysis for all attempts