Error Connecting to the Server

Re: Error Connecting to the Server

by Mykola Kostiuchenko -
Number of replies: 2

Hi Isabel,

I installed Moodle desktop application and I see error for lesson:

preview

Response

Text from Preview tab:

<br />
<b>Notice</b>:  Undefined property: stdClass::$attemptsremaining in <b>/var/www/moodle/mod/lesson/locallib.php</b> on line <b>3412</b><br />
{"newpageid":43,"inmediatejump":true,"nodefaultresponse":false,"feedback":"","attemptsremaining":null,"correctanswer":false,"noanswer":false,"isessayquestion":false,"maxattemptsreached":false,"response":"","studentanswer":"","userresponse":"","reviewmode":false,"ongoingscore":"","progress":null,"displaymenu":false,"messages":[],"warnings":[]}

Text from Response tab:

<br />
<b>Notice</b>:  Undefined property: stdClass::$attemptsremaining in <b>/var/www/moodle/mod/lesson/locallib.php</b> on line <b>3412</b><br />
{"newpageid":43,"inmediatejump":true,"nodefaultresponse":false,"feedback":"","attemptsremaining":null,"correctanswer":false,"noanswer":false,"isessayquestion":false,"maxattemptsreached":false,"response":"","studentanswer":"","userresponse":"","reviewmode":false,"ongoingscore":"","progress":null,"displaymenu":false,"messages":[],"warnings":[]}

Test from Headers (I've replaced sensitive information to ######):

Request URL: https://###########/moodle/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=mod_lesson_process_page
Request Method: POST
Status Code: 200 OK
Remote Address: ##########:443
Referrer Policy: no-referrer-when-downgrade
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US
Connection: keep-alive
Content-Length: 386
Content-Type: application/x-www-form-urlencoded
Cookie: MoodleSession=#########
Host: ##############
Origin: file://
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) moodledesktop/3.7.0 Chrome/69.0.3497.106 Electron/4.0.1 Safari/537.36 MoodleMobile
moodlewsrestformat: json
wsfunction: mod_lesson_process_page
lessonid: 4
pageid: 27
data[0][name]: id
data[0][value]: 192
data[1][name]: jumpto
data[1][value]: -1
data[2][name]: pageid
data[2][value]: 27
data[3][name]: sesskey
data[3][value]: #########
review: 0
moodlewssettingfilter: true
moodlewssettingfileurl: true
wsfunction: mod_lesson_process_page
wstoken: ########


Regards,

Mykola

In reply to Mykola Kostiuchenko

Re: Error Connecting to the Server

by Isabel Renedo -
Picture of Moodle HQ Picture of Particularly helpful Moodlers

Hi Mykola,

Those Notices are probably due to the fact that you have the debugging on. Please disable it on your site (Site administration >> Development >> Debugging). Probably changing 'Display debug messages' to No is enough, if not please change the 'Debug messages' to NONE: Do not show any errors or warnings.

Regards,
Isabel