Formulas: Hon Wai Lau's examples
Hon Wai Lau's examples
Example 1.1: Minimal question
For a minimal question, you must define a sub-question with:
- mark
- answer
- grading criteria
- question text (optional)
General Question name! Minimal question Main question Question text! What is 2 + 2? Part 1 Part's mark* 1 Answer type Number Answer* 4 Grading criteria* Relative error < 0.01
The Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
Example 1.2: Generate random data
Random data can be defined in the random variables, such as a = {2,3,4,5}. Upon quiz generation, one deterministic value will be chosen.
General Question name! Generate random data Variables Random variables a = {2,3,4,5}; Main question Question text! In this instantiation, a takes the value {a}. Part 1 Part's mark* 1 Answer type Number Answer* a Grading criteria* Relative error < 0.01 Part's text Enter the value of a:
The Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
Example 1.3: Multiple parts
By default, all parts will be added at the end of the question. If placeholders are used, the parts will be inserted at the location of placeholders.
General Question name Multiple parts Main question Question text This is the beginning of the main question text. {#1} This is the continuation of the main question text. {#2} This is the continuation and the end of the main question text. Part 1 Part's mark 1 Answer type Number Answer 3 Grading criteria Relative error < 0.01 Placeholder name #1 Part's text This is the text of Part 1. The correct answer is 3: Part 2 Part's mark 1 Answer type Number Answer 1 Grading criteria Relative error < 0.01 Placeholder name #2 Part's text This is the text of Part 2. The correct answer is 1: Part 3 Part's mark 1 Answer type Number Answer 4 Grading criteria Relative error < 0.01 Part's text This is the text of Part 3. The correct answer is 4:
With the question behaviour set to Interactive with multiple tries, the Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
With the question behaviour set to Adaptive mode, the Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
An important advantage of the Adaptive mode behaviour is that all the answers do not have to be entered before they can be checked by clicking the Check button. Thus, the answers for each part can be checked one at a time or as they are entered.
Example 1.4: Placeholders of numbers and unit
This question shows different display methods of the number and unit boxes.
General Question name 04 Placeholders of numbers and unit Variables Random variables v = {20:100:10}; dt = {2:6}; Global variables s = v*dt; Main question Question text If a car travels {s} m in {dt} s, what is the speed of the car? Part 1 Part's mark 1 Answer type Number Answer v Grading criteria Relative error < 0.01 Unit m/s Part's text Number box and unit box side by side {_0}{_u} Part 2 Part's mark 1 Answer type Number Answer v Grading criteria Relative error < 0.01 Unit m/s Part's text Number box and unit box side by side {_0} {_u} Part 3 Part's mark 1 Answer type Number Answer v Grading criteria Relative error < 0.01 Unit m/s Part's text No unit box {_0} m/s Part 4 Part's mark 1 Answer type Number Answer v Grading criteria Relative error < 0.01 Unit m/s Part's text No unit box speed = {_0} m/s
The Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
Example 3.2: Variable multiple and variable range
This question is similar to Example: Multiples of 7 between 10 and 100 (Mark = 0, 0.5 or 1), except that the multiples are multiple of a variable d which can be 5, 6, 7, 8 or 9, and that the range is variable by requiring that x satisfies a < x < b where a = k*d-3, b = (k+2)*d-2 and k ranges from 4 to 9.
General Question name 3.2 Variable multiple and variable range Variables Random variables k = {4:10:1}; d = {5,6,7,8,9}; Global variables a = k*d-3; b = (k+2)*d-2; Main question Question text Two Grading criteria are defined here, each of which is worth half a mark. Part 1 Part's mark* 1 Answer type Number Answer* k*d Grading variables criterion1 = _0 % d == 0; criterion2 = a <= _0 && _0 <= b; Grading criteria (criterion1 + criterion2)/2 Part's text Give a number x that is a multiple of {d} and satisties {a} < x < {b}:
The Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
Example 5.5: Roots of a quadratic function
The technique is illustrated by the problem of finding the roots of a quadratic function. Here is what is easily obtained: the coefficients of the quadratic function are variable and whole numbers, and the roots are always two, real and whole numbers. Here is how it is done:
Let
f(x) = x2 + bx + c = 0
where
b = -(r1 + r2)
and
c = r1*r2
Thus,
x2 - (r1 + r2)x + r1r2 = 0
with roots
x1, x2 = [ (r1 + r2) ± √ (r1 + r2)2 - 4 r1 r2 ] / 2
= r1, r2
The 'trick' is to define the coefficients of the quadratic as a function of the roots.
General Question name 5.5 Roots of a quadratic function Variables Random variables r1 = {-9:-5}; r2 = {-5:-1}; symbol = {"t","w","x","z"}; Main question Question text Roots of a quadratic function Part 1 Part's mark 1 Local variables b = -(r1 + r2); c = r1*r2; Answer type Number Answer [r1,r2] Grading criteria Absolute error == 0 Part's text What are the roots of the quadratic function f({symbol}) = {symbol}<sup>2</sup> + {b}{symbol} + {c}? Enter the smaller root first {symbol} = {_0} and {symbol} = {_1}
The Formulas question should look like this:
Play it Login info (Open in new tab: Ctrl+Shift+Click)
An informed student could quickly find the value of the roots as soon as he realizes that the negative value of their sum is equal to coefficient b of the quadratic function and that the negative value of their product is equal to coefficient c. If this is the case, then the question could be made more complex so as to make it less easy. In any case, the purpose of this example was to illustrate the technique of the inverse solution, which is often useful when making up Formulas questions.