Forums
Hello,
Whilst creating a new View I've spotted a potential bug. It looks like when users are added to a course they aren't automatically set to "Not Started" in the database.
For clarity, I'll explain the potential bug as I came across it.
Create a simple View to show the logged in user all lessons in a course, alongside their current Lesson State 'Not started...In progress..etc'
Add a test course
Add the admin + studentA to the test course
Add some test lessons to the test course
Test the view as admin & as student
When testing the view, the Admin and StudentA see all lessons and their status. However, in the views output their 'Lesson Status' is 'In progress', as opposed to the expected 'Not started'
Add a new student to the course (studentB)
When testing the view, studentB sees no lessons at all.
For testing purposes, I edited a test lesson in the test course (in order to create a new revision of it).
When testing the view now, studentB can now see the single edited lesson but still no others in the course. Their 'Lesson Status' is set to 'In progress' instead of the expected 'Not started'
This testing leads me to believe that when students are added to a course, the 'Not started' flag isn't being set, and also when a revision is created the status defaults to 'In progress' when it's expected to default to 'Not started'
Do you have any ideas for how I can fix this?
Thanks,
Gavin
Hi aotu,
Hi aotu,
There is no such thing as a flag "Not started". Not started is simply result of the user not having any entry in the database for a given quiz.
The issue is in your view. I recomment going to the view settings and enabling show sql. This way you can see the query that is beeing ran, and then run and test the sql directly in the database to check what is happening.
Best regards
Hi James,
Hi aotu
Hi aotu
I just looked at the file quiz_views_handler_field_user_quiz_state.inc inside the quiz module, and i only see there finished and in progress, try returning Not started if is_finished=null
Best regards