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
(Created page with "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 subq...")
 
Line 2: Line 2:


You may also want to see the '''Tutorial''' for creating simple question and the '''Reference''' documentation for precise usage.
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==
==Question text==

Revision as of 03:46, 27 October 2017

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.

Editing a formulas question .png


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 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}

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:

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

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. 10:100:10 (=[10,20,30,40,50,60,70,80,90]).

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.

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);

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,

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.