Dates not honored when QTI package imported via Canvas API (SOLUTION)

Jump to solution
canvas_voyager
Community Explorer

REAL SOLUTION UPDATE:

Given that this problem was inaccurately flagged as solved, I am leading this revision with the actual solution that comes from Canvas engineering. If one ventures into generating XML code for automated QTI generation, know that the assessment identifier string CANNOT begin with a number. It must be either a letter or underscore. If the QTI importer encounters a number at the beginning, the flags in the assessment_meta.xml are simply ignored. This is a Canvas-specific issue (currently) and not related to the QTI schema in general. On a related note, this same limitation holds when uploading files via the API. The filename cannot begin with a number.

Below is the original problem I posted, however, the ordering discussed below was not relevant. It just happened that the QTI packages with ignored flags had identifier strings (automatically generated) that started with a number. Hope this is helpful.

 

----------- Original post ---------------

I am using the Canvas API to automate quiz imports to save time.

Zipped QTI (1.2) package includes three files 1) imsmanifest.xml and two additional files in a folder: 2) assessment_meta.xml and 3) the assessment data file. The files do not derive from any previously exported QTI package, although the file schema is identical.

Problem:

If I import a quiz named "quiz 1", the package imports without issue, however, the following flags in the assessment_meta.xml file are ignored:  <available>;<lock_at>;<unlock_at>, <show_correct_answers_at>; and<hide_correct_answers_at>

However, if I repeat the import using the identical quiz name "quiz 1", the flags are honored. I note that all the identification flags (i.e. <manifest identifier>; <assignment_identifier>; <assignment_group_identifierref>, etc) are newly generated for the second import, only the quiz name is the same.

Trying to understand the bottleneck:

Now, if I import again, changing the quiz name to 'quiz 2', flags are ignored (as expected from above), but if I change the name back to 'quiz 1', I was expecting the flags to be honored because a 'quiz 1' without flags is already present on Canvas. However, they are not. This seems to suggest that Canvas uses cached or stored information to allow the flags to be honored, but only if the second import uses the identical quiz name as the first, without any import between. 

I have scoured the API documentation to no avail. Does anyone have an idea what is going on here? Why are the flags ignored in the first place and why are they honored under the conditions outlined above?

I'd appreciate any suggestions and/or insight.

Labels (1)
0 Likes
1 Solution
cstrikwerda
Instructure
Instructure

Hello @canvas_voyager thanks for posting in the Community. 

Investigating this, it doesn't seem that we have API documentation for how the QTI files are formatted to be able to import quizzes via API, so this is new territory we do not have documentation on. I was looking at previous Canvas Community threads regarding similar questions about importing quizzes and quiz question banks via API, and finding that there is not a current API for QTI file formatting for importing of quizzes via API.

Seeing that similar conversation here: https://community.canvaslms.com/t5/Canvas-Question-Forum/Can-I-use-the-REST-API-to-import-a-testbank...

I am also seeing that there is a Roadmap for New Quiz API, however some ways away. https://community.canvaslms.com/t5/Quizzes-Transition/New-Quizzes-API-Planned-Roadmap/ba-p/504075

Right now this does seem like a limitation as we do not have documentation regarding this. I would suggest to create a feature idea request in order to get better documentation regarding QTI file formatting  as well as further documentation to be able to import quizzes in QTI files via API. https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas/status-key/complete

View solution in original post

0 Likes