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: FQT Using variables in text and text equations.

FQT Using variables in text and text equations

From MoodleDocs
Revision as of 04:23, 4 December 2017 by Dominique Bauer (talk | contribs) (Created page with "==Using variable in text== It is simple to substitute the variables in the text, you only need to enclose the corresponding variables with { }. Each text field has a scope of...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using variable in text

It is simple to substitute the variables in the text, you only need to enclose the corresponding variables with { }. Each text field has a scope of variables. All variables x of either number or string in the scope of the text can be used to replace the corresponding placeholder {x} in the text.

It is also possible to evaluate an expression directly in the text by adding an equal sign at the beginning of the bracket such as {=x/1000}. It is easier to use if the named variables are not required. However, no error check is done unless the question is being instantiated in the quiz. An example is the rescaling of meters to kilometesr below:

What is the speed of the rocket if it travels with distance {=x/1000} km in {t} s?


< Formulas question type