Getting Rubrics Using Web Services

Getting Rubrics Using Web Services

by Carlos G -
Number of replies: 0

Hello , any one have tried to get rubric assessments/grades of students using the  Api Rest?

There was an old  post but without reply (https://moodle.org/mod/forum/discuss.php?d=412660)

The call should be something like this:
http://{{domain}}/webservice/rest/server.php?wstoken={{token}}&moodlewsrestformat=json
&wsfunction=gradingform_rubric_grader_gradingpanel_fetch&component=mod_assign&contextid=1&itemname=submissions&gradeduserid=3
It has four parameters:
component: (Required)  --> (Which are the possible values besides mod_assign)
contextid (Required) -->(No idea , have tried several values obtained from debugging)
itemname (Required)-->( This is the parameter that generate the exception)
gradeduserid  (Required)

{"exception":"coding_exception","errorcode":"codingerror","message":"Coding error detected, it must be fixed by a programmer: Unknown gradeitem for component mod_assign\\grades\\_gradeitem"}

The possible list of itemname matching the selected component (mod_assign) is validaded using this class call:
component_gradeitems::get_itemname_mapping_for_component($component)
obtaining the following array:
array (size=1)
  0 =>  'submissions' (length=11)
/moodle/grade/grading/form/rubric/classes/grades/grader/gradingpanel/external/fetch.php:115:

Api rest error
Any idea?
Regards


La media da valetaziuns: -