Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- Canvas
- Canvas Question Forum
- Formula questions with LaTeX

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-27-2017
04:32 PM

I am looking to create multiple choice quizzes with formula questions AND use LaTeX (basically creating multiple versions of a quiz). I have managed to get the following:

which yields:

The first line is using LaTeX. The variables are recognized, but since it is an image, the variables are not subbed out by different values.

The second line uses a combination of plain text and LaTeX. This sort of works, but is very limited. I don't see any way to incorporate rational functions.

Both of these don't solve the dilemma of wanting multiple choice.

Any advice is appreciated.

Solved! Go to Solution.

1 Solution

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Not the Solution
- Email to a Friend
- Report Inappropriate Content

10-29-2017
07:43 PM

As you have surmised, you cannot use the variable substitution within a LaTeX expression.

What I have done in cases where I needed something like this was to make multiple questions of the question and bring them into Canvas using Respondus. Then I put them into a question group and randomly pick one of them.

All of that is a lot of work and it's not perfect, but it's the closest I've found so far.

Option 2 - Text Math

If you want to go the second route and use rational functions, you may just have to resort to the imperfect approach of representing it in non LaTeX mode.

f(x) = [ x^[a] + [b]x^[c] - 1 ] / [ x^[d] + [f]x^[g] + [h] ]

And now, that I've said this is the best so far, I tried something else before I hit the "Add comment" button that might work.

I pulled up MathType and typed in a function and then switched the Copy/Paste preferences to give me MathML. This is what I created

Here is the MathML it gave me

`<math display='block'>`

<semantics>

<mrow>

<mi>f</mi><mrow><mo>(</mo>

<mi>x</mi>

<mo>)</mo></mrow><mo>=</mo><mfrac>

<mrow>

<mn>3</mn><mi>x</mi><mo>+</mo><mn>2</mn></mrow>

<mrow>

<mn>5</mn><mi>x</mi><mo>−</mo><mn>7</mn></mrow>

</mfrac>

</mrow>

</semantics>

</math>

On a whim, I changed the 3, 2, 5, and -7 to [a], [b], [c], and [d]. I then asked to find f([f]). *Note, don't use [e] in a formula question for a variable, Canvas considers it to be the constant e rather than a variable.*

Here's what the code looks like now after the substitutions. I also changed the 2212 to just be a simple -. I don't know enough about MathML to know if that's legit or not, I'm assuming that MathType knows what it's doing, but I still didn't like it.

`<math display='block'>`

<semantics>

<mrow>

<mi>f</mi><mrow><mo>(</mo>

<mi>x</mi>

<mo>)</mo></mrow><mo>=</mo><mfrac>

<mrow>

<mn>[a]</mn><mi>x</mi><mo>+</mo><mn>[b]</mn></mrow>

<mrow>

<mn>[c]</mn><mi>x</mi><mo>-</mo><mn>[d]</mn></mrow>

</mfrac>

</mrow>

</semantics>

</math>

I then created a formula question, typed in the first part of my question and then switched to the HTML editor. Then I pasted in the MathML code. I filled out the rest of the information, generated some questions, and got this when I saved it.

Obviously not what I was hoping for. However, if you save and reload the quiz, then it shows up.

Now, when I preview the quiz, I get

That's close. Now I changed the display="block" to display="inline" (which is the default, so I could have removed it completely)

I don't know enough about MathML to know if there is a \displaystyle type command or a \dfrac that will make the fraction full height.

Before you jump up and down for joy, I hear that support is for MathML is really lacking without plugins or extensions. I did the testing in Chrome on a PC, but according to CanIUse, Chrome doesn't support MathML. Neither does Edge. Firefox and Safari are the ones that do. The Wikipedia article on MathML says similar things. I have no idea if the Canvas apps support MathML or not. Canvas has fallback mechanisms in place, svg, mathml, images, for these things.

So, the one thing that is most promising most likely can't be used unless you have a controlled setting where you can force everyone to use Firefox.

2 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Not the Solution
- Email to a Friend
- Report Inappropriate Content

10-29-2017
07:43 PM

As you have surmised, you cannot use the variable substitution within a LaTeX expression.

What I have done in cases where I needed something like this was to make multiple questions of the question and bring them into Canvas using Respondus. Then I put them into a question group and randomly pick one of them.

All of that is a lot of work and it's not perfect, but it's the closest I've found so far.

Option 2 - Text Math

If you want to go the second route and use rational functions, you may just have to resort to the imperfect approach of representing it in non LaTeX mode.

f(x) = [ x^[a] + [b]x^[c] - 1 ] / [ x^[d] + [f]x^[g] + [h] ]

And now, that I've said this is the best so far, I tried something else before I hit the "Add comment" button that might work.

I pulled up MathType and typed in a function and then switched the Copy/Paste preferences to give me MathML. This is what I created

Here is the MathML it gave me

`<math display='block'>`

<semantics>

<mrow>

<mi>f</mi><mrow><mo>(</mo>

<mi>x</mi>

<mo>)</mo></mrow><mo>=</mo><mfrac>

<mrow>

<mn>3</mn><mi>x</mi><mo>+</mo><mn>2</mn></mrow>

<mrow>

<mn>5</mn><mi>x</mi><mo>−</mo><mn>7</mn></mrow>

</mfrac>

</mrow>

</semantics>

</math>

On a whim, I changed the 3, 2, 5, and -7 to [a], [b], [c], and [d]. I then asked to find f([f]). *Note, don't use [e] in a formula question for a variable, Canvas considers it to be the constant e rather than a variable.*

Here's what the code looks like now after the substitutions. I also changed the 2212 to just be a simple -. I don't know enough about MathML to know if that's legit or not, I'm assuming that MathType knows what it's doing, but I still didn't like it.

`<math display='block'>`

<semantics>

<mrow>

<mi>f</mi><mrow><mo>(</mo>

<mi>x</mi>

<mo>)</mo></mrow><mo>=</mo><mfrac>

<mrow>

<mn>[a]</mn><mi>x</mi><mo>+</mo><mn>[b]</mn></mrow>

<mrow>

<mn>[c]</mn><mi>x</mi><mo>-</mo><mn>[d]</mn></mrow>

</mfrac>

</mrow>

</semantics>

</math>

I then created a formula question, typed in the first part of my question and then switched to the HTML editor. Then I pasted in the MathML code. I filled out the rest of the information, generated some questions, and got this when I saved it.

Obviously not what I was hoping for. However, if you save and reload the quiz, then it shows up.

Now, when I preview the quiz, I get

That's close. Now I changed the display="block" to display="inline" (which is the default, so I could have removed it completely)

I don't know enough about MathML to know if there is a \displaystyle type command or a \dfrac that will make the fraction full height.

Before you jump up and down for joy, I hear that support is for MathML is really lacking without plugins or extensions. I did the testing in Chrome on a PC, but according to CanIUse, Chrome doesn't support MathML. Neither does Edge. Firefox and Safari are the ones that do. The Wikipedia article on MathML says similar things. I have no idea if the Canvas apps support MathML or not. Canvas has fallback mechanisms in place, svg, mathml, images, for these things.

So, the one thing that is most promising most likely can't be used unless you have a controlled setting where you can force everyone to use Firefox.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content

02-27-2018
01:33 PM

Were you able to find an answer to your question? I am going to go ahead and mark this question as answered because there hasn't been any more activity in a while so I assume that you have the information that you need. If you still have a question about this or if you have information that you would like to share with the community, by all means, please do come back and leave a comment. Also, if this question has been answered by one of the previous replies, please feel free to mark that answer as correct.

Robbie

Related Topic

- Using Formula Questions to Convert Hex to Decimal in Canvas Question Forum
- Feature Option Overview: New Quizzes in Canvas Releases
- Beta Release Notes: New Quizzes Migration (2021-12-22) in Canvas Releases
- Bug fix request. Importing formula questions to New Quizzes: Decimal precision bug. in Canvas Question Forum
- In a formula question, is there any way to embed computed expressions within the question text? in Canvas Question Forum

- Reference
- Community Guidelines
- Security
- Developers
- Open Source