Hi all,
I have a strange error when I delete a quiz from my Moodle 3.5.1+ (tested in 3.5.2+ too).
SyntaxError
Unexpected token < in JSON at position 0
SyntaxError: Unexpected token < in JSON at position 0
at parse (<anonymous>)
at Qb (https://---MONMOODLE---/lib/javascript.php/1538646131/lib/jquery/jquery-3.2.1.min.js:1:74283)
at A (https://---MONMOODLE---/lib/javascript.php/1538646131/lib/jquery/jquery-3.2.1.min.js:1:77810)
at XMLHttpRequest.<anonymous>
(https://---MONMOODLE---/lib/javascript.php/1538646131/lib/jquery/jquery-3.2.1.min.js:1:80414)
A few more information :
- it doesn't come from my theme, I changed it to test.
- the error occures under Firefox and Chrome. The message is slightly different, but it doesn't reaaly change anyhting.
- the problem only occures with activities based on the question bank (for me, with the native Quiz and the Offline Qui plugin)
- the problem only occures when the deleted quiz contains questions. If it is empty, there is no message.
- when I close the popup message, the activity is always here. But if I refresh my page, it disappears.
It indicates that some characters in the server response (in this case, the <br/>) aren't JSON string and apparently it made the JSON parser complain.