Add API support for reading submission data
FR from Taico, who previously scraped assignment/submissions pages to get the required data.
Needed for CPL in Q3Idea is to add API support for reading submission data, in json format, with the following endpoints:
submissions
which returns the set of submissions for a givenassignment id
with:
- student id
- grade
- lastSaved timestamp
submission
which returns the following submission data for a givenassignment id
andstudent id
(netid/username/studnr)
- solution text
- code with [solution, test] fields
- grade
- lastSaved timestamp
assignment
which returns the following assignment data for a givenassignment id
- question text
- code with [solution, library, solution template, user test template, spec test] fields
API access:
Submitted by Elmer van Chastelet on 24 August 2021 at 13:09
- should be configurable at any level, allowing accessing data for that assignment and all sub-assignments recursively.
- will be done using an API key
- may only be visible to the person who configured the key, and access to this key can be mapped to the person’s account (so managers who are not manager at a sub-level, because of overridden set of managers, cannot access the data using the API key)
- The API will return json data
Issue Log
In this first version, only administrators can enable the API, after which course staff can access the configuration section (in
edit assignment
). The API requires parameters to be passed as query string, which are to be sighed with a HMAC (SHA256) signature based on a generate secret key (available from the configuration section), to be appended to the query string.The API uses the following scheme:
/api/V0/GET/
TYPE
?apikey=APIKEY
&assignment=ASSIGNMENTID
&student=STUDENTID
×tamp=TIMESTAMP
&signature=HMAC_SHA256_SIGNATURE
with TYPEs
SUBMISSIONS
ASSIGNMENT
andSUBMISSION
where the parameterstudent
is only needed when type isSUBMISSION
.The data returned is depending on the type of assignment, but is currently limited to return question-specific fields for Programming Questions only (needed for this year’s CPL).
Log in to post comments