SafeExamBrowser / seb-server

The Safe Exam Browser Server web application simplifies and centralizes the configuration of SEB clients for exams. It interacts with a learning management or exam system for setting up and conducting e-assessments with Safe Exam Browser. It also improves security by allowing to monitor connected SEB clients in real time during e-assessments.
Mozilla Public License 2.0
46 stars 38 forks source link

Moodle mod_quiz_get_quizzes_by_courses warning for course id 0 breaks fetching, probably #74

Closed lucaboesch closed 1 year ago

lucaboesch commented 1 year ago

Describe the bug This probably connects to #67. Maybe, when fetching for courses on Moodle, SEB Server encounters a warning and then interrupts fetching, which results in an incomplete exam list. The precise problem might be bound to a Moodle misconfiguration itself, nonetheless, probably, skipping or circumventing the error could be managed.

To Reproduce Steps to reproduce the behavior: I have to drill down on what the exact cause is. Stack trace says (I think) that it tries to fetch quizzes of a course with ID 0. That is of course gibberish. 11:36:54.637 DEBUG [asyncService-1]:[ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.moodle.legacy.MoodleCourseAccess] There are warnings from Moodle response: Moodle: LmsSetup [id=3, institutionId=1, name=BFH Moodle, lmsType=MOODLE, lmsAuthName=<webservice username>, lmsAuthSecret=null, lmsApiUrl=<lms url>, lmsRestApiToken=null, proxyHost=null, proxyPort=null, proxyAuthUsername=null, proxyAuthSecret=null, active=true] request: mod_quiz_get_quizzes_by_courses warnings: 1 warning sample: Warning [item=course, itemid=0, warningcode=1, message=No access rights in course context]

Expected behavior Fetching of all exams works nonetheless.

Setup (please complete the following information):

anhefti commented 1 year ago

Hi Luca, thanks again for the information.

SEB Server shows the warnings that it receives from Moodle responses in the logs. The whole log page would be interesting here to see what was requested for example and if there is an error from SEB Server afterwards.

It is possible that an unexpected error leads to a abortion of course fetching as I've this just checked in the code. Although if so you should also see the error: "Unexpected error while trying to get courses page...." just slightly after the warning log you described above. If there is no such error in the logs, it seems that SEB Server just prints the warnings received from Moodle response and go on with fetching. Why Moodle sends this warning is unclear to me. I've seen such warnings before even if the fetch was working as expected. But indeed the "0" quiz identifier might indicate a data inconsistency.

For your information, Amr is currently working hard on a Plugin to improve Moodle integration for SEB Server where also the course and quiz fetching shall be more efficient and less error prone. We expect to release this with next SEB Server version coming soon (April or Mai this Year).

Best, Andreas

anhefti commented 1 year ago

Fixed for 1.5 and with new Moodle Plugin

lucaboesch commented 1 year ago

πŸ‘πŸ»πŸ‘πŸ»πŸ‘πŸ» @anhefti I see there's a 1.5-dev branch and I noted that in a demo you gave recently in the bottom right corner it said 1.5 as version info. Leads me to think you are in time for a a Q2/2023 release of version 1.5, aren't you? Excellent.

Best, Luca

anhefti commented 1 year ago

πŸ‘πŸ»πŸ‘πŸ»πŸ‘πŸ» @anhefti I see there's a 1.5-dev branch and I noted that in a demo you gave recently in the bottom right corner it said 1.5 as version info. Leads me to think you are in time for a a Q2/2023 release of version 1.5, aren't you? Excellent.

Best, Luca

Hi Luca, yes exactly, the official SEB Server release date is 8. 5. 23. The new Moodle Plugin release might be a bit later (I have to ask Amr)

Best, Andreas