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: Editing a Formulas question.

Editing a Formulas question: Difference between revisions

From MoodleDocs
Line 48: Line 48:


==Local variables==
==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==
==Answer type==

Revision as of 05:00, 27 October 2017

< Formulas question type

The page for editing a Formulas question is shown in the figure below. 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.

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

Answer*

Grading variables

Grading criteria*

Unit

Other rules

Placeholder name

Part's text

[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