# Canvas - How do I create multiple step Formula questions in New Quizzes?

Formula questions in New quizzes in Canvas allow the instructor to generate variables that are randomly selected (within parameters specified by the instructor) for each student. This creates a different set of numbers for each student. Instructors can have a formula that depends on the randomized variable that is a single line, or can have the formula built up in multiple steps.

Canvas provides documentation on how to create a simple formula quiz question in New Quizzes, but the steps below show how to utilize multiple steps in your formula by using the calculation of standard deviation (formula below) as an example. #### 3) Build up the formula for the correct answer line-by-line in the Formula Definition box. The complete list of text for the box is included above the screenshot (which only shows a snippet.) In this example, we first use the built in “mean” function in Canvas to find the mean of the data set and label it m (this is the "xbar" in our formula). We then take each data value of v,w,x,y,z, subtract the mean, m, and square the result. These are stored as d1 through d5. We then use the built in “sum” function in canvas to add the values of d1 through d5. Finally we divide by 5-1=4 and apply the square root. Canvas will use the result of the last row as the final answer to the quiz question. A list of built-in helper functions such as mean and sum can be found at Canvas Helper Functions.

`m=mean(v,w,x,y,z)d1=(v-m)^2d2=(w-m)^2d3=(x-m)^2d4=(y-m)^2d5=(z-m)^2ss=sum(d1,d2,d3,d4,d5)s=sqrt(ss/4)` #### 4) Finally, generate as many possible solutions as you need for the quiz question. For this example, fifty different data sets of size 5 were generated and the standard deviation was found for each via the formula. You can also set a margin of error if desired. 24/7/365 Canvas Support is available through the help icon in Canvas, by calling the phone support for faculty, staff and students or email us directly at canvas@uwlax.edu.