Setting dropbox "out of"/ScoreDenominator from API
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
}
Answers
-
There is currently a gap in our api for posting an out of score, so the only currently available way to do that is to set an out of score manually in the UI. The 500 error will be replaced with a real error message in a coming release.
-
Hi Steve,
Thank you for your feedback. We've taken your request into account, starting with the 10.8.6 release you can now create an assignment with a ScoreDenominator from the valence API. This change will apply with API version 1.25 onward. For more information please refer to the documentation at https://docs.valence.desire2learn.com/res/dropbox.html#Dropbox.DropboxFolderUpdateData. There is now a section to specify a ScoreDenominator within the Assessment section of your POST request. Here is a sample body that may help you out when testing https://gist.github.com/mtjandra/500656627b60438c83deff21c22d05ae. I hope this satisfies your use case!
Regards,
Miles Tjandrawidjaja