Hello. please help me

How to add a question with mathematical formulas to canvas from api?

Hello. please help me

How to add a question with mathematical formulas to canvas from api?

There's a lot of useful information on how it should be formatted in this thread: Uploading answers to formula question using API

Thanks for the clarification. I did misunderstand what you're wanting.

Is the problem in (1) creating a text question, (2) creating the mathematical content within the question, or (3) both?

The explanation of how to create a question at all is lengthy. Creating just the mathematical content is quicker.

For the mathematical content, do you have this as LaTeX or is it an image that you want to embed somewhere? If it's LaTeX, then you might want to look at Best way to add LaTeX equations . It's been almost 2 years since I contributed there, but I think it still works.

If it's an image, then you can just create an img element like you would with regular HTML, just make sure that it's to an HTTPS connection, otherwise the content will likely get blocked by browsers not wanting to mix https and http on the same page.New Quizzes supports embedding LaTeX directly just by using \( and \) around it. However, I haven't seen an API for this yet and that approach doesn't work in the legacy quizzes.

There are two versions of quizzes right now.

The legacy version which has been called quizzes for years and is what all the Quiz APIs refer to. Development has stopped on this, so it's mostly frozen where it's at. This is what people get to when they click "Quizzes" in the course menu.

There is New Quizzes, which is found under the Assignments menu rather than the Quizzes menu. It has been in development for years and gone through several name changes. Our institution hasn't enabled it yet, but there is coming a time when legacy quizzes will disappear and everything will be new quizzes. There is no API (that I know of) for it yet, although there is a migration path from legacy quizzes to new quizzes.

With new quizzes, you can enter this directly into the text of the question, which means it just be part of a paragraph or div element inside the HTML.

\(\displaystyle e^y\left(\frac{dy}{dx}+1\right)=1\)

With legacy quizzes, you need to insert this into the HTML

<img class="equation_image" title="\displaystyle e^y\left(\frac{dy}{dx}+1\right)=1" src="/equation_images/%255Cdisplaystyle%2520e%255Ey%255Cleft(%255Cfrac%257Bdy%257D%257Bdx%257D%252B1%255Cright)%253D1" alt="LaTeX: \displaystyle e^y\left(\frac{dy}{dx}+1\right)=1" data-equation-content="\displaystyle e^y\left(\frac{dy}{dx}+1\right)=1" />

The Canvas Instructor Guide has a section on both Quizzes and New Quizzes.

Here's another thread from almost three years ago that may help: Adding equations without using the equation editor

Fathullo,

Thanks for the clarification. I did misunderstand what you're wanting.

Is the problem in (1) creating a text question, (2) creating the mathematical content within the question, or (3) both?

The explanation of how to create a question at all is lengthy. Creating just the mathematical content is quicker.

For the mathematical content, do you have this as LaTeX or is it an image that you want to embed somewhere? If it's LaTeX, then you might want to look at Best way to add LaTeX equations . It's been almost 2 years since I contributed there, but I think it still works.

If it's an image, then you can just create an img element like you would with regular HTML, just make sure that it's to an HTTPS connection, otherwise the content will likely get blocked by browsers not wanting to mix https and http on the same page.

New Quizzes supports embedding LaTeX directly just by using \( and \) around it. However, I haven't seen an API for this yet and that approach doesn't work in the legacy quizzes.