General developer forum

mod_assign_view_assign

 
Picture of Paul Kelly
mod_assign_view_assign
 

I want to use the web service to mark a lesson complete.  I tried using mod_assign_view_assign.  I got an error message, "dml_missing_record_exception".  I got a trace of the SQL statements that Moodle is running to mark a lesson complete.  The error message happens when it tries to do a SELECT from the moodle.mdl_assign table.  There are no records in this table.  I do have a course and a lesson within Moodle.  And, the lesson I use for within the select is within the lesson table.  The token used in the web service GET is valid also.  I used the token in another web service function.  Any ideas as to why mod_assign_view_assign is not working?  Here's what the url looks like:

http://localhost:8081/webservice/rest/server.php?wstoken=b801e89d77f3a1dcfbf0ff06d00c9c28&wsfunction=mod_assign_view_assign&moodlewsrestformat=json&assignid=1


 
Average of ratings: -
Brian
Re: mod_assign_view_assign
 

Not quite sure why calling a function belonging to a student assignment is relevant to marking a lesson complete.

If you have a look at the code on /local/mobile/db/services.php you can find a list of web services that the mobile app can call for example.

There are 4 web services that might be more relevant:

'core_completion_get_activities_completion_status',
'core_completion_get_course_completion_status',
'core_completion_mark_course_self_completed',
'core_completion_update_activity_completion_status_manually',

In particular the update activity completion status manually looks interesting.

If you call that web service the code in /completion/classes/external.php function you might have better results

update_activity_completion_status_manually

If you aren't trying to complete an activity manually, sorry, please explain what you are trying to achieve.

 
Average of ratings: -