All Collections
REST API
Submission Filters
Submission Filters
K
Written by Kevin Wesley
Updated over a week ago

If a learner’s work area has a lot of files, you can make use of submission filters to determine what gets submitted from the work area. You can use patterns to include, exclude or specify the list of the files and folders to be submitted.

Submission Filters:

include - specify the patterns to include in the submission e.g. *.py, *.c

exclude - specify the patterns to exclude in the submission e.g. *.o, *.exe

list - specify the list of files/folders to be submitted e.g. factorial.py, Lab1Submission

The patterns include and exclude are passed as such to rsync command so you can specify these patters accordingly. Currently, you can make use of the existing POST API end-point “parts” to specify these filters. All these parameters must be arrays in the submission_filters JSON.

e.g., adding include and exclude patterns

curl -X PUT -H 'Authorization: Token {{token}}' -H 'Content-Type: application/json' -H 'Accept: application/json' "https://api.vocareum.com/api/v2/courses/{{courseid}}/assignments/{{assignmentid}}/parts/{{partid}}" -d'{"submission_filters" : {"exclude": ["*.o"],"include": ["*.py"]}}'

e.g., adding list of folders to submit

curl -X PUT -H 'Authorization: Token {{token}}' -H 'Content-Type: application/json' -H 'Accept: application/json' "https://api.vocareum.com/api/v2/courses/{{courseid}}/assignments/{{assignmentid}}/parts/{{partid}}" -d'{"submission_filters" : {"list": ["TMASubmission", "ECASubmission"]}}'

You can also see the submission filters of a given part (if any) by calling the GET end-point and checking the response parameter “submission_filters”.

curl -X GET -H 'Authorization: Token {{token}}' -H 'Content-Type: application/json' -H 'Accept: application/json' "https://api.vocareum.com/api/v2/courses/{{courseid}}/assignments/{{assignmentid}}/parts/{{partid}}"

Did this answer your question?