@dssimmons
The functionality to programmatically create your own questions is supported through the Quiz Questions API. Unfortunately, the documentation in the API on what the questions should look like is lacking. What I need a better explanation, I typically do is go into Canvas, do what I'm going to do, and then open the browser developer tools (F12 in Chrome and Firefox). Then I switch to the network tab, keep (persist) the logs, and then click the button inside Canvas to see what is sent to the network.
Given this setup
![354277_pastedImage_3.png 354277_pastedImage_3.png](https://community.canvaslms.com/t5/image/serverpage/image-id/33882i16A5A22FFEC44549/image-size/large?v=1.0&px=999)
Here is what is sent (I stopped it after 4 items, it continues for the 10 I generated)
question[question_name]: Question
question[assessment_question_id]:
question[question_type]: calculated_question
question[points_possible]: 1
question[correct_comments_html]:
question[incorrect_comments_html]:
question[neutral_comments_html]:
question[question_text]: <p>What is [a] + [b] ?</p>
question[regrade_option]:
question[position]: 0
question[text_after_answers]:
question[matching_answer_incorrect_matches]:
question[formulas][]: c=a-b
question[formulas][]: a+b
question[variables][0][name]: a
question[variables][0][min]: 1
question[variables][0][max]: 10
question[variables][0][scale]: 0
question[variables][1][name]: b
question[variables][1][min]: 20
question[variables][1][max]: 30
question[variables][1][scale]: 0
question[answer_tolerance]: 5
question[formula_decimal_places]: 0
question[answers][0][variables][0][name]: a
question[answers][0][variables][0][value]: 4
question[answers][0][variables][1][name]: b
question[answers][0][variables][1][value]: 21
question[answers][0][answer_text]: 25
question[answers][1][variables][0][name]: a
question[answers][1][variables][0][value]: 9
question[answers][1][variables][1][name]: b
question[answers][1][variables][1][value]: 28
question[answers][1][answer_text]: 37
question[answers][2][variables][0][name]: a
question[answers][2][variables][0][value]: 5
question[answers][2][variables][1][name]: b
question[answers][2][variables][1][value]: 23
question[answers][2][answer_text]: 28
question[answers][3][variables][0][name]: a
question[answers][3][variables][0][value]: 7
question[answers][3][variables][1][name]: b
question[answers][3][variables][1][value]: 21
question[answers][3][answer_text]: 28
Note that if you edit the questions in Canvas to the point that you have to regenerate them, you will lose all of your customization, but you can use the Canvas API to edit a quiz question as well.
Interestingly, the table that you see at the bottom of the formula question after you generate it is sent -- as is -- to Canvas when creating the question. You could even replace those values with your table before hitting the update button. I wrote a blog post describing this that may help: Using Calculated Values in the Text of Formula Questions
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.