Setting dropbox "out of"/ScoreDenominator from API

Steve.B.446
Steve.B.446 Posts: 76
edited November 2022 in Development

I'm trying to create an assignment dropbox and a new grade item from the API, with the dropbox linked to the new grade item.

 

Everything works in isolation, but when I add the AssociatedTool parameters to the call which creates the Grade object (to link it to the dropbox), it generates a 500 error. 

 

Trial and error has shown that this is a result of the dropbox not having the "Out of" field set, which seems to translate to the ScoreDenominator value in the JSON block. This seems to be read only, if I try to set it the value I supply gets ignored and the result shows it as null.

 

I can't set that parameter either in the initial POST request to create the dropbox or using a PUT request to update it. Am I missing something, or is there a better way to do this?

 

Example input:

 

{

"CategoryId": null,

"Name": "(01-2) Computing assignment 1a",

"Assessment": {

"ScoreDenominator": 100.000000000,

"Rubrics": []

},

"CustomInstructions": {

"Content": "",

"Type": "Text/Html"

},

"Availability": null,

"GroupTypeId": null,

"DueDate": "2018-04-12T16:00:00.000Z",

"DisplayInCalendar": true,

"NotificationEmail": null,

"IsHidden": false

}

 

 

Example output:

 

{

"Id": 68,

"CategoryId": null,

"Name": "(01-2) Computing assignment 1a",

"CustomInstructions": {

"Text": "",

"Html": ""

},

"Attachments": [],

"TotalFiles": 0,

"UnreadFiles": 0,

"FlaggedFiles": 0,

"TotalUsers": 1,

"TotalUsersWithSubmissions": 0,

"TotalUsersWithFeedback": 0,

"Availability": null,

"Assessment": {

"ScoreDenominator": null,

"Rubrics": []

},

"GroupTypeId": null,

"DueDate": "2018-04-12T16:00:00.000Z",

"DisplayInCalendar": true

}

Tagged:

Answers