Unexpected token < in JSON at position 0

Re: Unexpected token < in JSON at position 0

by Ken Task -
Number of replies: 5
Picture of Particularly helpful Moodlers

Don't use Windows, but don't think I've ever seen %2F's in urls that Moodle uses ... that's a '/' character.

In the error you can see file=%2Fblah%2F which, if your brower doesn't translate the %2F's into / characters can't find the file.

Since this is a json error, do you have the json extension to PHP loaded?

Above is a total guess ... like I said, don't think I've ever seen that before.

'spirit of sharing', Ken


In reply to Ken Task

Re: Unexpected token < in JSON at position 0

by Veronika Delvaux -

I have the same error. My Moodle is hosted, I created the questions in Notepad and I am using Windows 10

Attachment moodle error.JPG
In reply to Veronika Delvaux

Re: Unexpected token < in JSON at position 0

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Veronika,
the end effect is always the same in Moodle since a broken JSON response will be always shown as in your screenshot: to find the root reason for that you need to explore the responses of the server in the Developer Tools of your browser.

An example of what you can find, unrelated to your specific issue: https://tracker.moodle.org/browse/MDL-60691?focusedCommentId=597479&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-597479 .

HTH,
Matteo

In reply to Veronika Delvaux

Re: Unexpected token < in JSON at position 0

by Richard McHugh -

Hi Veronika, I did the exact same thing, I uploaded an Aiken format multiple choice quiz to the question bank and when I tried to access it via the quiz creation page I got the same error. Can I ask  if you have resolved the issue? 


many thanks, 


Richard

In reply to Richard McHugh

Re: Unexpected token < in JSON at position 0

by Veronika Delvaux -
Hello Richard,

I did, the error occurred because of a question instance not deleted

properly deleted from the question bank.

Hope that helps.





veronikadelvaux@googlemail.com

*Tel.:**626.780.6094*



You never know how strong you are until being strong is the only choice you

have.



— UNKNOWN







On Mon, Sep 3, 2018 at 9:02 AM Richard McHugh (via Moodle.org) <
In reply to Richard McHugh

Re: Unexpected token < in JSON at position 0

by Veronika Delvaux -

I did, the error occurred because of a question instance not deleted properly from the question bank.