I'm working on a test bank for a stats class, and in writing some probability questions, here is what I found myself wanting to do:

I have a variable that represents a probability as a percent, which I am allowing to be, say, between 50 and 70. We'll call this P1.

I want a second probability to be related to the first one, and to be at least 20% lower than it, but with a random factor too. So what I really want to do is set up a computational-only variable, call it x, that can run between -5 and 5. Then I can compute my second probability, which I'll call P2, using the formula: P2=P1-25+x and use [P2]% in the problem text.

This achieves what I want, as P2 will run between 20% and 50%, but always at least 20% lower than P1. But I see no way to define the variable x at all, since I never use it in the problem text; and if I put [P2]% in the problem text, it only allows me to set a range for P2 numerically, not to define it in terms of other variables.

So I am assuming that it isn't possible to do what I want here... unless I'm missing something? Maybe this will be addressed by the new quiz engine? It seems like such a relatively simple/obvious thing, if you are using formulas in problems, this isn't a big leap. It would be simple to generate in Excel. I would really like to be able to do it in Canvas. For now, I'm just going to let P1 run from 50-70 and let P2 run from 20-45, but that isn't nearly as snazzy as how I would like to set it up.

Deborah Gaydos

You cannot use a formula to generate a value that goes into the text of the question. Any variables used in the question itself are limited to the random number generator where you can specify a range and number of decimals.

You could do p1 is random between 50 and 70 and p2 is random between 10 and 29.

You should not allow p2 to go between 20 and 50 because you might get p1=60 and p2=45 and then have percentages that add to 105%.

What I have done is

p1 is random between 50 and 70

p2 is random between 10 and 20

Then in the formula section, I do

x1 = p1/100

x2 = p2/100

x3 = 1 - x1 - x2

In general, the formula questions are limited. Even more generally, Canvas is limited for math and science questions and there are a lot of people struggling to get it to do what they have done in other systems or by hand and it is a mostly futile effort that is going to waste a lot of time and cause frustration. On the flip side, you may be forced into asking questions you don't really want to ask because that's all Canvas will let you ask.

I have used Respondus in combination with Excel to create the questions with the parameters I want to ask. I've also created my own questions through the API (not recommended for anyone with a heart condition) where I had complete control. In both cases, I used the programming (considering Excel formulas to be programming) to generate multiple versions of the question and then put them into Canvas as a numeric response question, not as a formula question.