Create questions 2.9

Calculated questions

Example calculated question

Follow the steps in Calculated questions for the general fields. Below are the steps to create the Question text, including the formula, supply the answer and setup wildcards.

Question text (asking a calculated question)

In the Question text field enter your question that is based on a formula such as <base>*<height> as the formula allows wildcards to be used. e.g.

Calculate the area of a rectangle that is {base} base and {height} high.

NB: You must use { } brackets to enclose the area you wish the wildcard number to be displayed in. The text value could be anything, as long as you use the same text value in the answer and the wildcards.

If there are wildcards already set up in the current course they will be displayed above the question name. See an example below:

Shared wildcards

In this case wildcards for each value have a range set as 1.0 - 10.0 so only numbers in this range will appear when the question is used.

For example, based on the question text above one student may get displayed:
Calculate the area of a rectangle that is 2 base and 7 high. 
and another may be asked:
Calculate the area of a rectangle that is 8 base and 5 high.


Type in the formula that eCampus will use to calculate the correct answer. See below for the answer to the above question text.
Answer for calculated question

NB: In some cases it may be possible that two formula may be able to provide the correct answer to the question text. If this is the case choose [Blanks for 1 more answers] An Answer 2 formula box will appear in which the alternate formula could be entered. In this case you may make the grades different, providing for example a weighting for the preferred formula.

The remaining fields on the Editing a calculated question page can be left unchanged for this example.

Scroll to the bottom and pick [Save changes] to progress to setting up wildcards.
Press this button to save changes and exit the question.

Setting up Wildcards

Once you have saved your changes to a calculated question, you will be prompted to set up wildcards dataset properties. These wildcards will be set up using the formula displayed in the Answers panel, in this case the wildcards are set to "{base}" and "{height}." 

Setting the properties of the formula wildcards

When setting the wildcard dataset properties, there are two options to choose from:

Will use the same existing private dataset as before: This will allow the wildcards to only be used by this particular question.

Will use a new shared dataset: This will allow the wildcards to be shared among all calculated questions within this category. 

Once you have finished choosing your dataset properties, click on the Next page button (button to open the next page) to begin setting the values for the wildcards.

There are two ways in which wildcard values can be generated. 

Generate the values yourself

Adding your own values involves the following steps

Adding a set of values to the wildcard

  • In the Paramater field for each wildcard enter the value you want
  • Scroll down the page and in the Add panel, press Add to add a set of wildcard values.

Adding another set of wildcard value

  • When the values have been added, they will appear below with the set with an answered formula.

A set of wildcard values with the intended formula and result

Have Moodle generate values for you

To have Moodle generate the wildcard values, follow these steps: 

Moodle will generate a set of wildcard values between 1 & 10

  • In the Range of Values fields enter the minimum and maximum values you would accept.
  • Choose a number of decimal places for the value.
  • Choose the configuration of the values.
    • Uniform: any value between the limits are equally likely to be generated.
    • Loguniform: Values towards the minimum are more likely to be generated.

automatically generate wildcards once 'Add' is pressed.

  • In the Add section click on "force regeneration"
  • In the menu next to the 'Add' button, select the number of wildcard value sets you wish to generate. The maximum number of values that can be generated is 100
  • Once you completed the above steps, you may finally click the Add button.

Once you have finished editing the wildcard settings, press Save Changes.

Press this button to save changes and exit the question.

Back to top
Skip Administration