Suggestion for an improved calculated question syntax

Suggestion for an improved calculated question syntax

by P Sunthar -
Number of replies: 0

Here is a suggestion for the calculated question type syntax, which can improve the readability when rendered, as well as be useful to the Teacher to create question datasets.

The wildcards that appear in the question can have the syntax 

  1. {var[=value]} instead of {var} or 
  2. {=expr[,format]} instead of {=expr}

where var is the wildcard, value is the default value to be used in the first item (usually for real-world problems, teachers have a sense of the default value), and expr is a php math expression that has to be evaluated from the variables, format is any string supported by php to format a number.

Examples
  1. {a=0.52784} 
  2. {={a=3.14}*{b=0.921e-5},"%0.2g"} 

Advantages

  1. When there are default values available, the answer formula can be (potentially) quickly checked in Page-1 itself.
  2. With the default values, the first item in Page-3 is readily computed.  This will also ensure that there is at least one item to add with meaningful values. Sometimes, for complex formulae, we need to abandon at Page-3 without adding an item, because of some mistake in the dataset or the formula; and redo the entire range selection again.
  3. With the default values, the default range for the variables can be chosen around the default value. 


One way to guess a starting range is based on the order of magnitude of the value

min = 10^(log10(value)-0.5)
max = 10^(log10(value)+0.5)

which evaluates to one order of magnitude of values centred around value.

Average of ratings: -