The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
I'm creating an app to convert Vimeo Showcases into Canvas quizzes. I'm ready to try exporting the list of json files to the qti format. I've seen example qti format files and can get the json file MOSTLY exported to the right format, but I can't figure out how to set assessment identifier and item identifier codes. Where do those come from? I assume they are used to prevent two assessments having the same code, but what is the method used to set those?
Here are some example identifiers I got from the Kansas State qti converter:
<assessment ident="iebf33847de101fa787ad7b33b5be00f9" title="4 Car Trouble - Ed Chevy">
<fieldlabel>assessment_question_identifierref</fieldlabel>
<fieldentry>if29e0b74848f7755e6706cd2b06f2038</fieldentry
I've found some information on this.
For pretty much all of the identifiers - there is no specified formula. The identifier must be unique, but beyond that there is not specified requirement that I can find.
What people have been doing is creating a hash code from the quiz contents. This pretty guarantees that the identifier will be unique for each assessment.
I put it to the test and it worked.
On another note: A better term for this subject is the QTI API.
Hi,
I was trying to figure out this issue and I have found out how it was generated.
Just want to share with the community on this complex hash function that was used in this export feature.
From the opensource codes here https://github.com/instructure/canvas-lms/blob/master/lib/cc/cc_helper.rb#L116
you will be able to deep dive into the linkages and find out that the hash string is a "entity_" + id.
This id is a global id (or rather shard id) % local id.
To find out your shard id
1. Login to your Canvas Portal, go into any course, and do a content export (probably Quiz in this case).
2. There will be a job (link) for you to download the export. However, highlight the link and see that there is a JWT in the verifier parameter in the link behind.
3. Go to a JWT decoder page like https://jwt.io/ , and decode the JWT, you will see something like a 14 bit integer in the id parameter in the payload. (e.g. xxxx0000000yyyyyy).
4. The XXXX would be the indicator of your shard id, and the yyyy is your local id (the Quiz Id in this case since we are exporting a quiz), or the primary key of any objects that you are trying to find out the hash.
5. Lastly, you just have to do a ruby hash (Digest::MD5.hexdigest("quizzes:quiz_xxxx0000000yyyyyy"), and you will get the matching identifier that is in the XML of the export.
Hope this helps.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.