OKTech REST (function oktech_get_grades)

OKTech REST (function oktech_get_grades)

by Raymond Cosgrave -
Number of replies: 1

I may not be using this method correctly but I am not getting any data for courses, it is either blank or the records returned denote that the user did not complete the course. I have attached a screenshot, here is a sample of what I would use:

 

http://MOODLE_URL/moodle/webservice/rest/server.php?courseids[0]=VALID_IDNUMBER_FOR_A_COURSE&courseidfield=idnumber&useridfield=id&userid=VALID_MOODLE_USER_ID

 

I know the user has completed the course (a SCORM course FYI) because he has the green check box next to the course.

 

Screenshot of output:

 

 

Average of ratings: -
In reply to Raymond Cosgrave

Re: OKTech REST (function oktech_get_grades)

by Patrick Pollet -

@raymond,

1) first make sure that your scorm activities did record grades in your course gradebook. I have seen recently that it is not always the case see https://moodle.org/mod/forum/discuss.php?d=225008

2) according to your screenshot you are calling properly oktech_get_grades since you get the expect answer in ULI Test course and Greening Your facility Management Operation, that is an instance of class gradeRecord (as defined in wspp/classes) with course id number in field itemid , but unfortunaltely 0 as grade... 

3) make sure you are using the latest from https://github.com/patrickpollet/moodlews . Some issues were recently reported against Moodle 2.4 see https://moodle.org/mod/forum/discuss.php?d=226161 and https://moodle.org/mod/forum/discuss.php?d=225924

4) you may try enabling debug mode in OK Tech in site administration settings . Then you will find in your moodledata directory a file named debug.out with a lot of var dumps of intermediate PHP variables and another one named wspp_db_errors.log that records specific database errosr that starts to appear more and more often with successive Moodle versions. 

Cheers