Search code examples
desire2learnvalence

Possible to "clear" a grade value using Desire2Learn Valence API?


Is there any possible way to completely clear a previously set grade value using the D2L Valence API? I can successfully set or update grade values, but it seems that there is no obvious way to totally delete the grade value like you can from the D2L user interface.

I've tried a few ways of doing this:

  1. Setting the incoming grade value to null using the grade value update route: PUT /d2l/api/le/(version)/(orgUnitId)/grades/(gradeObjectId)/values/(userId) (Note that I am correctly substituting valid values for all of the IDs, versions, etc.) This returns a "400 Bad Request" status code.
  2. Calling the same route with a DELETE verb. This returns a 404 Not Found error code (unsurprisingly, since it's not a documented route: I just tried it as a stab in the dark).
  3. Calling the PUT route but omitting the incoming grade value body. This also returns a 404.

I can always just set the grade value to 0, but that is less than satisfactory because it's not the same thing. I don't actually want to assign a grade of zero; I want to assign no grade so that it is obvious that the grade needs to be assigned manually, etc. Is there some other sort of magic number/sentinel I could use, besides null, to achieve this, or is this just a gap in the Valence API?


Solution

  • I believe this is a gap in the Valence Learning Framework APIs. You can use the APIs to explicitly set a grade value, 0 or otherwise, but you can't currently use the APIs to unset the value for a grade object.