Showing results for 
Show  only  | Search instead for 
Did you mean: 
New Member

Posting HTML for Question using canvas API, html not being parsed

Hi, Im trying to add a question with HTML content to a quiz using canvas api - see below for full call

question type is essay question - and the question text is HTML. when i view this in canvas i see all the HTML formatting. I see in the canvas UI there is an "HTML editor" option, that allows you to enter html formatting and see proper html output (not all the formatting). I need to do likewise in my API call. In the API doc I dont see any flag to indicate the content is HTML. what am i missing here? thanks for help

(api doc for create question : )


call im trying to make with url encoded html in question text

Labels (1)
Tags (4)
0 Kudos
2 Replies
New Member

I would be surprised if there wasnt a way to do this - as surely you need to send html in for a question - but i dont see an option in the api params for this - which makes me think you have to put something in the text itself - i tried surrounding it with <html> </html> - didnt work

Community Contributor


Don't encode the HTML script, POST the request as plain HTML (E.g. /questions?question[question_type]=text_only_question&question[question_text]=<strong>abc</strong>).

Canvas will also strip any HTML tags that are not in the allowed list. here: