Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Going over powers of i. The only answers are i, -1, -i, or 1.
First attempt was to use a formula question with i^`a` and have it randomly generate natural numbers for a. I learned that Canvas doesn't like imaginary numbers, so only will generate a values that produce 1 or -1. Not very helpful for the concept.
Multiple choice questions, to my knowledge, cannot have generated numbers/formulas in them. I'm hoping to NOT have to create a bunch of MC questions where I just change the exponent. Any ideas? TIA!
Solved! Go to Solution.
I've had to hack Canvas in similar ways before so that I can use a formula question.
What I would do is give them an answer key as part of the question.
Here is the HTML of the question. Nothing fancy other than adding extra spacing after the question prompt because Canvas doesn't.
<p style="padding-bottom: 1em;">Simplify \(i^{`n`}\).</p>
<p>Use these directions for entering your answer.</p>
<ul>
<li>Enter 1 if the answer is \(1\)</li>
<li>Enter -1 if the answer is \(-1\)</li>
<li>Enter 2 if the answer is \(i\)</li>
<li>Enter -2 if the answer is \(-i\)</li>
</ul>
We know the answer is dependent upon n mod 4. I took the easy way out and used the modulus to get the value in a specific position within a list.
Canvas doesn't have a facility for entering a list directly. You can use reverse() to enter it in reverse order or sort() to a list. Sort() won't help, but reverse() will maintain the order. Since we want 1, 2, -1, -2, we have to enter it as reverse(-2, -1, 2, 1).
Once you have a list, you can use the at() function to get the number from a certain position. It uses a 0-based index, which works great with our remainders.
Here's the code I used for the answers.
at(reverse(-2,-1,2,1),mod(n,4))
Using this technique allows you to change the codes. For example, you could say enter 1, 2, 3, or 4. The reason I went with the weird way I did is that it's going to be confusing to the student to enter 3 when the answer is -1, but they can see that the i thing is different.
You might add a note that the reason we're using the conversion table is because Canvas will not allow you to enter an i with a formula question.
I've had to hack Canvas in similar ways before so that I can use a formula question.
What I would do is give them an answer key as part of the question.
Here is the HTML of the question. Nothing fancy other than adding extra spacing after the question prompt because Canvas doesn't.
<p style="padding-bottom: 1em;">Simplify \(i^{`n`}\).</p>
<p>Use these directions for entering your answer.</p>
<ul>
<li>Enter 1 if the answer is \(1\)</li>
<li>Enter -1 if the answer is \(-1\)</li>
<li>Enter 2 if the answer is \(i\)</li>
<li>Enter -2 if the answer is \(-i\)</li>
</ul>
We know the answer is dependent upon n mod 4. I took the easy way out and used the modulus to get the value in a specific position within a list.
Canvas doesn't have a facility for entering a list directly. You can use reverse() to enter it in reverse order or sort() to a list. Sort() won't help, but reverse() will maintain the order. Since we want 1, 2, -1, -2, we have to enter it as reverse(-2, -1, 2, 1).
Once you have a list, you can use the at() function to get the number from a certain position. It uses a 0-based index, which works great with our remainders.
Here's the code I used for the answers.
at(reverse(-2,-1,2,1),mod(n,4))
Using this technique allows you to change the codes. For example, you could say enter 1, 2, 3, or 4. The reason I went with the weird way I did is that it's going to be confusing to the student to enter 3 when the answer is -1, but they can see that the i thing is different.
You might add a note that the reason we're using the conversion table is because Canvas will not allow you to enter an i with a formula question.
Thanks for the code. I saw a previous post of yours on formula questions with yes/no and having students use numbers. I used this for divisibility of a generated number (a) by another (b), with the formula "if(a/b==floor(a/b), 1, 0)" and had the directions state for them to use 0 for no and 1 for yes. I teach HS, so I'd rather it be true/false, but it works without me putting in a BUNCH of separate questions.
I totally get the 2, -2, because it looks a bit like how we write i.
Do you think they'll ever update it so non-numerical responses can be put in?
I'm not quite clear on why you have to reverse it. Why can't you just put the list in normally?
On a side note, I appreciate your detailed responses. I've wanted to create a large bank of various quizzes for a while to help students with concepts, and am finally at a time/place that I can.
Canvas does not have a function for entering an ordered list of numbers. That is, there is no list(x1,x2,x3,...) command. The only way to enter a list of numbers -- so that you can use the at() function, is reverse() or sort().
sort(-2,-1,2,1) would give you (-2,-1,1,2). You could use that, but it would make the position calculation more difficult than just mod(n,4).
That leaves us with the only way to enter a list and keep its order is to use reverse().
Another use of reverse() and at() function to look up values of statistical distributions in a table. Unfortunately, you cannot use the web interface to generate calculated values to use in the question. For example, "What is the square root of x?" where x is a perfect square.
With classic quizzes, you can use the API to generate your own formula questions. It doesn't generate them on the fly, you generate them ahead of time, and then it saves the pre-generated responses. You could do this with Python, JavaScript, or other language of your choice and generate the questions.
I haven't played around with that with new quizzes -- although they finally have some New Quizzes APIs in the documentation.
I don't expect that Canvas will support complex numbers anytime soon. I've been using Canvas since 2012 and there has been no movement on this part. The closest I've seen are feature requests to allow multiple numeric responses or to allow units.
Canvas would likely leave any development like that to a third party vendor. Instructure's partner's page allow you to filter on Assessment Management System (AMS) to see some of what is available. Of course, those products are additional cost. Several publishers also provide a system that understands mathematics and will provide it free for the instructors, but make the students pay.
To participate in the Instructure Community, you need to sign up or log in:
Sign In