Given the example above a possible value generated for the length could be -1.45 mi. This value falls between -20 and +20, is reported to three significant digits and has units of miles. A possible value for time could be 4.1532 s. This value falls between -4.0 and -0.2 or between 0.2 and 5.0, is reported to five significant digits and has units of seconds. You notice that two bounds are given for time. This makes it possible to exclude problematic conditions (dividing by zero) when calculating equations.<Variable>length</Variable> <Bounds>-20.0,20.0</Bounds> <Sigfigs>3</Sigfigs> <Vunits>mi</Vunits> <Variable>time</Variable> <Bounds>0.2,5.0</Bounds> <Bounds>-0.2,-4.0</Bounds> <Sigfigs>5</Sigfigs> <Vunits>hr</Vunits>
The bounds tag does not need to use decimal values, but can use integer and scientific notation forms. The restriction on the bounds tag is that it must contain an ordered pair of numbers separated by a comma. Therefore, decimal values must use a period rather than a comma when representing their numbers in this tag. The following uses of the bounds tag are all equally valid.
One additional tag is available when working with variables. It is the granularity tag, <Granularity>, and it is used to indicate how close a variable is to zero before it is set equal to zero. Lets use the following variable definition to generate a value.<Bounds>1, 15</Bounds> <Bounds>1.5e-15, 1.5e-12</Bounds> <Bounds>-25, 2.5e1</Bounds>
This definition may be used to generate an integer value in the range indicated. However, it is possible that x could equal 0.000000034. By default the granularity is set to 0.01. Therefore, this generated value would be represented as 0. With this definition is is still possible to get a number such as 0.011. This might be acceptable; however, if the granularity tag is set to 1,<Variable>x</Variable> <Bounds>-99, 99</Variable> <Sigfigs>2</Sigfigs>
then any value smaller than 1.0 would be assigned a value of 0. To use a variable in a question's text the variable name must be preceded by an & and terminated with a ;. Therefore, using the variables defined above we may have the following text.<Granularity>1.0</Granularity>
When this text is displayed it would appear asA car travels &length; in &time;. What is the speed of the car?
A car travels -1.45 mi in 4.1532 s. What is the speed of the car?
Function Name | Usage | Argument |
Sine | @sin( angle ) | angle - Value given in radians |
Arc Sine | @asin( arg ) | arg - Value between -1 and 1 |
Cosine | @cos( angle ) | angle - Value given in radians |
Arc Cosine | @acos( arg ) | arg - Value between -1 and 1 |
Tangent | @tan( angle ) | angle - Value given in radians |
Arc Tangent | @atan( arg ) | arg - Any value possible |
Natural log | @ln( arg ) | arg - Value greater than 0 |
Natural Exponential ( ex ) | @exp( arg ) | arg - Any value possible |
Logarithm base 10 | @log( arg ) | arg - Value greater than 0 |
Square Root | @sqrt( arg ) | arg - Value greater then 0 |
Factorial (x!) | @fact( arg ) | arg - If not already, will be made a positive integer |
Variables can be used in equations as described above. There are also two defined variables pi and exp that always return the same value. Pi is defined as 3.1415927 and is accessed by using π. Exp is defined as 2.7182818 and is accessed by using &exp;.
&exp; is different than @exp(); however, they can be used to generate the same result. &exp;^2 is the same as @exp( 2 ).Another equivalence is with the square root where @sqrt( 16 ) can be replaced with 16^0.5 or 16^(1/2).
These variables were accesses to generate a question asking for the speed.<Variable>length</Variable> <Bounds>-20.0,20.0</Bounds> <Sigfigs>3</Sigfigs> <Vunits>mi</Vunits> <Variable>time</Variable> <Bounds>0.2,5.0</Bounds> <Bounds>-0.2,-4.0</Bounds> <Sigfigs>5</Sigfigs> <Vunits>hr</Vunits>
The answer to this question will change with the values generated for length and time. By defining the answer as an equation this problem can be avoided. Within the computation question an answer field is provided with the following code.A car travels &length; in &time;. What is the speed of the car?
A text field is provided which appears as follows (except it will all be on one line).<Label>speed</Label> <Answer>&length;/&time;</Answer> <Mode>equation</Mode> <Aunits>mi/hr</Aunits> <Accuracy>0.01</Accuracy>
Speed: mi/hrIf the value of length is -1.45 and the time is 4.1532, then the generated answer for the speed is -0.349. The student's answer will be consider correct if it falls within 1% of this value as indicated by the accuracy tag. The mode tag needs to be set to equation otherwise the answer is considered to be literally the text "&length;/&time;".