Symbolic Math Step by Step Example

Introduction

This article will provide a step-by-step guide on building a Symbolic Math question.

The Question

The following question is what will be used for this example. But rather than the bold values being set, we will make them variables.

Part 1 - Basic Numbers

Given the parabolic formula y = \(2x^2 - 4x + 1\), solve for x = 4

Part 2 - Symbolic Math

Write the equation for the parabola that passes through the point (3,2) but has the same shape as the previously given parabola.

 

Create a new Question

sym_maths.jpg

First we need to create a new question and add the question text itself.

  1. In Author, from Questions or within a Question Set, click ‘Create New’ and select Symbolic Math.
  2. Give the question a title
  3. Delete the placeholder text.
  4. In the man authoring area, write / paste the following Question Text:
Part 1 - Basic Numbers

Given the parabolic formula y = [formula], solve for x = [x_value]

[part1_answer]

Part 2 - Symbolic Math

Write the equation for the parabola that passes through the point ([x_coordinate],[y_coordinate]) but has the same shape as the previously given parabola.

[part2_answer]

 

create_text.jpg

Create the Program Model for Part 1

The next step involves creating the Program Model. This is where we declare all variables and their parameters. The sake of this example we will do the two parts individually.

  1. Click Program Model from the menu on the left, followed by Edit Program Model
  2. Delete the placeholder text in the Program Model.

For Part 1, there are 3 variables that need to be declared.

  • formula
  • x_value
  • part1_answer

Variable: formula

This is the starting formula for the question. For this question, it will always be the same but we need to add it to the Program Model as that’s what’s being used in the calculations. The format is always variable: value; so in this instance, the first line of the Program Model will be:

formula: 2*x^2 - 4*x + 1;

Variable: x_value

We want the value of x to change so we’ll use the rand_with_step(lower, higher, step)function. The three values in parenthesis state the lowest possible value, the high possible value, and the steps between each number. As we only want x to be either 2, 3, 4, 5, 6, 7, or 8, we write the following:

x_value: rand_with_step(2,8,1);

Variable: part1_answer

Finally, we need to set the answer. There are two options here. The long way would be to write the formula again but this time replacing x with x_value as that is the variable that will change each time based on the above parameters.

part1_answer: 2*x_value^2 - 4*x_value + 1;

A far more elegant solution is to use the function ev(a,b)which does it all for us. With ev(a,b),  a = the expression to evaluate, and b = the evaluation options. In this case, we can write the following:

part1_answer: ev(formula, x=x_value);

This evaluates the equation we have set as formula  and sets the value of x to be the value of x_value.

The Program Model should now look like the following:

formula: 2*x^2 - 4*x + 1;
x_value: rand_with_step(2,8,1);
part1_answer: ev(formula, x=x_value);

Now click ‘Compile’ and see the example values in the right column to ensure it’s working as expected. Each time you click ‘Compile’, it will re-run the Program Module. In the example we’re using, the x_value will change but the formula will not. Click Save.

part1.jpg

Insert Variables to Part 1

Now it’s time to replace our placeholder text with the actual variable.

  1. Delete the [formula] text and with the cursor in its location, click + Insert followed by Program Variable.
  2. Click on this Program Variable box and in the menu on the right, select ‘formula’ from the dropdown.
  3. Repeat this process for the [x_value] placeholder text and insert the x_value variable.
  4. At the end of Part 1, delete [Candidate Response] and with the cursor in its location, click + Insert followed by Candidate Response. This is the area the candidates write their answer.

assign_variables.jpg

insert_response.jpg

Set the Response Outcome for Part 1

All that’s left now is to set-up the correct response outcome.

  1. Click the Candidate Response field. It will be called RESPONSE-n.
  2. Under Response Outcome on the right, click + Add response outcome
  3. Select the Input Type as Basic numbers as the answer to this question is a number, not a formula.
  4. Click +Add outcome.
  5. As we’re setting the correct outcome, select the first dropdown as ‘Equal’
  6. The middle dropdown we select the variable we’re validating against. In this case, we named it part1_answer.
  7. Finally, we leave the final dropdown to Correct.
  8. Click Save.

part1_response.jpg

Now click on the Preview icon and you’ll see Part 1 is complete. The formula itself is now showing as is a value for x. Try answering and clicking ‘Check answer’. Now refresh your browser and you’ll see the value of x has changed, as has the correct answer.

Part 1 is now done.

part1_preview.jpg

Create the Program Model for Part 2

Return to the Program Model to declare the final variables. For Part 2 we need:

  • x_coordinate
  • y_coordinate
  • part2_answer

For x_coordinate and y_coordinate, the logic will be the same - a random integer between two values. For this we can again use the function rand_with_step(lower, higher, step).

x_coordinate: rand_with_step(1,12,1);
y_coordinate: rand_with_step(1,12,1);

Each coordinate will now be a random integer between 2 and 12.

Finally we need to set the part2_answer. In the case of this question, we need to recreate the shape of y = \(2x^2 - 4x + 1\) but have it pass through our randomly generate x and y coordinates. 

What the question is therefore asking is to first solve for z in the formula y = \(2x^2 - 4x + z\) and enter the full formula as the response.

To achieve this we need declare the value of z which is z = \(2x^2 - 4x - y\) and set it as a variable remembering to substitute x and y for the actual variable names as those are the values that are needed for the calculation.

z: 2*x_coordinate^2 - 4*x_coordinate - y_coordinate;

This variable won't be exposed to the candidate in the question text but it is a calculation that needs to happen within the Program Model in order for the correct answer to be calculated.

The correct answer for Part 2 can be set in a variable.

part2_answer: 2*x^2 - 4*x + z;

The Program Model in its entirety should now look like the following:

formula: 2*x^2 - 4*x + 1;
x_value: rand_with_step(2,8,1);
part1_answer: ev(formula, x=x_value);
x_coordinate: rand_with_step(1,12,1);
y_coordinate: rand_with_step(1,12,1);
z: 2*x_coordinate^2 - 4*x_coordinate - y_coordinate;
part2_answer: 2*x^2 - 4*x + z;

Click ‘Compile’ and see the example values in the right column to ensure it’s working as expected. Then click Save.

part2_compile.jpg

Insert Variables to Part 2

Following the same process as before:

  1. Delete the [x_coordinate] and [y_coordinate] text and with the cursor in its location, click + Insert followed by Program Variable.
  2. Click on this Program Variable box and in the menu on the right, select ‘x_coordinate’ from the dropdown.
  3. Repeat this process for the [y_coordinate] placeholder text and insert the y_coordinate variable.
  4. At the end of Part 2, delete [Candidate Response] and with the cursor in its location, click + Insert followed by Candidate Response.

part2_variables.jpg

Set the Response Outcome for Part 2

  1. Click the Candidate Response field. It will be called RESPONSE-n.
  2. Under Response Outcome on the right, click + Add response outcome
  3. Select the Input Type as Symbolic Math as the answer to this question is an equation and we want it to be treated as such.
  4. Click +Add outcome.
  5. From the first dropdown, select Algebraic. This will ensure that provided the equation is correct, it will be marked correctly.
    • Setting it as String Match would mean that every character of the equation must be in the same position as set out in the Program Model.
  6. The middle dropdown we select the variable we’re validating against. In this case, we named it part2_answer.
  7. Finally, we leave the final dropdown to Correct.
  8. Click Save.

part2_outcome.jpg

Our question is now complete and with the 3 random variables included within the Program Model, there are 864 possible versions to be generated.

Click Preview Icon to view. As an author, each time you refresh the page, the variables will be recalculated.

final_result.jpg

Artikler i denne seksjonen

Var denne artikkelen nyttig?
1 av 1 syntes dette var nyttig