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 options.

Formulas question options: Difference between revisions

From MoodleDocs
(Blanked the page)
Line 1: Line 1:
The following are the explanations of options in the editing page of the Formulas question type. These options are divided into the ''global options'' that affect the all subquestions answer and the ''local options'' for each individual answer.


You may also want to see the '''Tutorial''' for creating simple question and the '''Reference''' documentation for precise usage.
[[File:Editing a formulas question .png|600px|thumb|center]]
==Question text==
In addition to the main question text, you can also use global variables and placeholder here.
The global variables will be replaced by their values and the placeholders will be replaced by the subquestion. A simple example with variables <span style="font-family:monospace;font-size:113%;">A</span>, <span style="font-family:monospace;font-size:113%;">B</span>, <span style="font-family:monospace;font-size:113%;">C</span> and placeholders <span style="font-family:monospace;font-size:113%;">#1</span>, <span style="font-family:monospace;font-size:113%;">#2</span>, <span style="font-family:monospace;font-size:113%;">#3</span> is shown below:
<pre style="font-size:113%;">
What is the result of {A} + {B}? {#1}
What is the result of {A} - {B}? {#2}
What is the result of {C} / {B}? {#3}
</pre>
==Random variables==
New random values can be generated whenever a question is created. It can be done by defining a set of elements to choose from:
<pre style="font-size:113%;">
A = {1,2,3};
C = {[1,-1], [2,-2], [3,-3]};
E = {10:100:10, 100, 1000};
</pre>
The elements can be numbers, strings, lists of numbers or lists of strings. During the start of a quiz, one element will be drawn from the set and assigned to the variable on the left. Range notation can be used for sets of numbers, e.g. <span style="font-family:monospace;font-size:113%;">10:100:10</span> (=<span style="font-family:monospace;font-size:113%;">[10,20,30,40,50,60,70,80,90]</span>).
==Global variables==
Formulas can be specified here to manipulate the instantiated random variables (all random variables are included here). The full list of mathematical functions and operations is given in the '''Reference'''.
<pre style="font-size:113%;">
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);
</pre>
==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:
<pre style="font-size:113%;">1.00, 0.6, 0.2</pre>
If you want to have infinite trials, each with 10% penalty, you can end the sequence by a comma:
<pre style="font-size:113%;">1, 0.9,</pre>
==Deduction for wrong unit==
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.
==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.

Revision as of 03:54, 27 October 2017