Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: Formulas question page.

Formulas question page: Difference between revisions

From MoodleDocs
Line 102: Line 102:


==Part's text==
==Part's text==
The part text and answer box arrangement can be specified here. The answer box placeholders that can be used are:
<pre style="font-size:113%;">
{_0} {_1} {_2} ... {_u}
</pre>
<span style="font-family:monospace;font-size:113%;">{_0}</span>, <span style="font-family:monospace;font-size:113%;">{_1}</span>, <span style="font-family:monospace;font-size:113%;">{_2}</span> are the input boxes for the numbers and <span style="font-family:monospace;font-size:113%;">{_u}</span> is the input box for the unit.


==[Global] - Deduction for wrong unit (0-1)==
==[Global] - Deduction for wrong unit (0-1)==

Revision as of 20:01, 27 October 2017

< Formulas question type

The Formulas question page, titled Adding a formulas question, appears when a new Formulas question is added to a quiz. The page is titled Editing a formulas question when editing. To edit an existing question, simply click on the question.

The Formulas question page is shown below and the main settings, indicated by orange arrows, are described in order. Note that global settings affect the entire question, while local settings affect only each part. Settings marked with an asterisk must be defined.

Only Part 1 is shown. To see other parts, click on the Blanks for 2 more parts button.

Editing a formulas question .png

Random variables

Random values can be generated each time a question is created. This is done by defining a set of values to choose from, for example:

A = {1,2,3};
C = {[1,-1], [2,-2], [3,-3]};
E = {10:100:10, 100, 1000};

Values can be numbers, strings, lists of numbers, or lists of strings. At the beginning of a quiz, a value is taken in the set and assigned to the variable. Range notation may be used for sets of numbers, e.g. 10:100:10 (=[10,20,30,40,50,60,70,80,90]).

Global variables

Formulas can be specified here to manipulate instantiated random variables (all random variables are included here) and define global variables. The complete list of mathematical functions and operations is given in the Reference.

Examples:

a = 1.11111;
b = exp(3);
c = A + a + b;
d = sin(1.5*pi()) + c;
e = round(a, 0);
f = [0,1,2,3][A];
g = ["zero","one","two","three"][A];
distance = sqrt(a*a + b*b);

Question text*

Global variables and placeholder can be used in the question text. Global variables are replaced by their values, and placeholders are replaced by the corresponding parts. A simple example with variables A, B, C and placeholders #1, #2, #3 is shown below:

What is the result of {A} + {B}? {#1}
What is the result of {A} - {B}? {#2}
What is the result of {C} / {B}? {#3}

Part's mark*

The mark for the answer in this part. This mark must be a value greater than 0. The score for the whole question is the sum of the marks for each part.

Note that if the part mark is left blank, the part will be deleted when the question is saved successfully.

Local variables

Local variables can be defined here in the same way as global variables. The scope includes local and global variables. These can be used in the answer, grading variables, part's text and feedback. Note that each part has its own scope of local variables.

Answer type

There are four types of answers. Number, numeric and numerical formula require a list of numbers as an answer. The algebraic formula requires a list of strings (formula) as the answer.

Different types of answers impose different restrictions when entering responses. Therefore, students need to know how to enter answers. The format check will also tell them when they enter an answer incorrectly. Please refer to the other documents for more details.

Answer*

The answer consists of a list of numbers or a list of strings, depending on the answer type. The number of elements in the list defines the number of answer boxes for this part.

Examples:

123
[1, 0, 0, 1]
a
[1, a, b]
"exp(-a t)"
["vx t","vy t - 0.5 a t^2"]

Grading variables

The scope includes local variables and the student answers. See the other documents for this advanced feature.

Grading criteria*

A relative error or an absolute error with an error range can be chosen. Note that a relative error can not be used with the algebraic answer type. See the other documents for the precise definition of relative error and absolute error.

Units

The unit can be specified here.

The system of units of the Formulas question type complies with the International System of Units (SI) (available free of charge). For example, the multiplication of unit symbols is indicated by a space, as prescribed in Section 5.1 of SI. The half-high (centred) dot (⋅) is not supported. Division of unit symbols is indicated by a solidus (oblique stroke, /) or by negative exponents. Exponentiation is indicated by the circumflex accent (^, UTF-8 #94; or ASCII code 94 (alt+94)). Parentheses are required when there is a risk of misinterpretation. Permutations of the unit symbols are considered identical.

Examples:

1 m
0.1 m^2
20 m s^(-1)
400 kg m/s
100 kW

Other rules

Conversion rules for other accepted base units. See the other documents for this advanced feature.

Placeholder name

The placeholder is used to identify the location in the main question text where it is replaced by the content of the part. The name of the placeholder consists of an alphanumeric character string preceded by #, for example #1, #2a, #2b, and #A.

If this field is left empty, the content of the part is added at the end of the main question text.

Part's text

The part text and answer box arrangement can be specified here. The answer box placeholders that can be used are:

{_0} {_1} {_2} ... {_u}

{_0}, {_1}, {_2} are the input boxes for the numbers and {_u} is the input box for the unit.

[Global] - Deduction for wrong unit (0-1)

This option specify how penalties are applied for a wrong unit. It uses a value between 0 to 1. If the value is 1, both answer and unit must be correct at the same time in order to get mark. That is, the answer and the unit are treated as one entity. If the value is 0, students can get full mark for only the correct answer and all random strings at the end of answer will have no effect.

[Global] - Basic conversion rules

The Formulas question type has a build-in unit conversion system and has basic conversion rules. The basic system is the Common SI units which converts standard units, for example those for length (km, m, cm and mm). This option has no effect if no unit is used.

Trial mark sequence

This option has effect only in the adaptive mode. It will override the behavior of penalty in adaptive mode. The default behavior of adaptive mode always has infinite trial and deducts equal marks for each wrong trial. With this option, both finite trials or infinite trials can be used. For finite trials, say, you want to have three trials, the first one has 100%, second one has 60% and third one has 20%, you can type:

1.00, 0.6, 0.2

If you want to have infinite trials, each with 10% penalty, you can end the sequence by a comma:

1, 0.9,




< Formulas question type