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

Formulas question type: Difference between revisions

From MoodleDocs
Formulas question type
Type Third-party question type
Set Author : Hon Wai Lau
Downloads Formulas question type
Issues Tracker issues
Discussion See below.
Maintainer(s) Jean-Michel Védrine
Line 45: Line 45:
Jean-Michel Védrine
Jean-Michel Védrine


=The '''Formulas''' question type is for you!=
==Moodle versions==
The '''Formulas''' question type is a plugin for Moodle with random values and multiple answer fields. The answer fields can be placed anywhere in the question so that you can create questions involving various answer structures such as coordinate, polynomial, matrix, etc. Other features such as unit checking and multiple subquestions are also available. These functionalities can simplify the creation of questions in many fields related to mathematics, numbers and units, such as physics and engineering.
2012062500 (Moodle 2.3) or newer
 
If you are dealing with problems such as those described below, then the Formulas question type is for you! Take, for example, a problem in structural engineering that may involve several parameters with a number of specific values such as:
 
<pre style="font-size:113%;width: 97%;">
Parameter:                      Possible values:
Bolt diameter (mm)              16, 20, 22, 24, 27, 30, 36
Plate thickness (mm)            16, 20, 25, 35, 40, 50
Steel strength (MPa)            300, 345, 350, 380
Concrete strength (MPa)        20, 25, 30
Reinforcing bar diameter (mm)  9.5, 12.7, 15.9, 19.1, 22.2, 25.4
</pre>
 
A question that involves the five parameters, each with their possible values, has 7 x 6 x 4 x 3 x 6 = 3024 permutations (assuming here that they are all valid), much more than the limit of 100 in the Calculated question.
 
Even a simple question in basic mathematics can have a large number of permutations. The following one has 5 x 5 x 8 = 200 permutations:
 
<pre style="font-size:113%;width: 97%;">
Find the value of x = a*(b + c)
where
  • a is an odd number between and including 1 and 9
  • b is an even number between and including 2 and 10
  • c is an integer value between and including 1 to 3 or 7 to 11
</pre>
 
This kind of question can be easily created using the '''Formulas question'''. To create the question, you would enter the sets of numbers in the '''Random variables''' field as follows:
 
<pre style="font-size:113%;width: 97%;">
Variables
  Random variables    a = {1:10:2};
                      b = {2:11:2};
                      c = {1, 2, 3, 7:12};
</pre>
 
Note that sets of numbers can be in the format <span style="font-family:monospace;font-size:113%;">{start:stop:interval}</span>, for example <span style="font-family:monospace;font-size:113%;">{1:10:2}</span> and <span style="font-family:monospace;font-size:113%;">{2:11:2}</span>. (The stop value is not included in the set and the interval is set to 1 when not specified). Sets of numbers can also be in the format of a list such as <span style="font-family:monospace;font-size:113%;">{1,2,3}</span> for the set of numbers 1, 2 and 3. They can even be in a combination of the two formats, such as <span style="font-family:monospace;font-size:113%;">{1, 2, 3, 7:12}</span>.
 
When an attempt is started, <span style="font-family:monospace;font-size:113%;">a</span>, <span style="font-family:monospace;font-size:113%;">b</span>, and <span style="font-family:monospace;font-size:113%;">c</span> will take a value drawn from the corresponding set at random. If you want, you can define other variables as a function of the random ones in the '''Global variables''' field. For instance, if you need the value of <span style="font-family:monospace;font-size:113%;">a&nbsp;+ 2*b</span> somewhere in your question (that is the main question, subquestions, hints and feedbacks), just define a new variable, say <span style="font-family:monospace;font-size:113%;">d</span>, in the '''Global variables''' field:
 
<pre style="font-size:113%;width: 97%;">
Variables
  Global variables    d = a + 2*b;
</pre>
 
Once you have defined your variables, you can display them by putting them in curly braces, i.e. <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>, <span style="font-family:monospace;font-size:113%;">{d}</span>, anywhere in the question.
 
Another advantage of the '''Formulas question''' type is that a Formulas question can have several subquestions, called '''parts''', that can share the same variables. The '''Formulas question''' also has a complete system of units that is quite useful for physics and engineering.
 
The '''Formulas question''' type is very powerful and permits the making of a wide range of questions. Although mastering all its possibilities require some practice, the basics can be learned quickly.
 
<div style="background-color:#d3ffd3;
            border:1px solid #abdaac;
            border-radius:4px;
            color:#4f691a;
            padding:5px 15px 5px;
            margin: 15px 0 0;
            ">
Once you begin to master the '''Formulas question''' type, you will realize how easy it is to use, and how effective and complete it is.
</div>


=Acknowledgments=
=Acknowledgments=

Revision as of 01:09, 1 February 2018

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.




As there is no or little difference in the Formulas question type plugin for recent versions of Moodle (2.0 and above), the documentation for the Formulas question type has been moved to one location (the present page).

The documentation herein applies to all recent versions of Moodle including the current Moodle 3.4.


Usage

You would enter your 'sets' (called 'lists' in formulas questions) in the 'Random variables' field when creating question as:

a = {100, 125, 150, 175, 200};
b = {1, 2, 3, 4, 5};
c = {10, 12, 14, 16, 18};

When an attempt is started a, b, and c will take a value drawn from the corresponding list at random.

You can then define other variables depending of these ones in the 'Global variables' field if you want. For instance if you need the value of a+2*b somewhere in your question text or Combined or general feedback, just define

d=a+2*b; in 'Global variables'

Once you have defined your variables, you can use them in all the question's texts putting them in curly braces (for instance {a}, {b} or {d}). This is true not only for the Question text but also for all feedbacks and hints when you use interactive behaviour (The author thinks that the fact that variables can't be used in calculated question's feedback is a serious problem to give students an appropriate feedback using the values they saw in their attempt)

Other advantages

  • Another big advantage of formulas questions is that a question can have several 'parts' and all parts using the same variables; and even more, the answer to each part can not only be a number but a vector if you want.
  • Last thing, formulas questions has a complete unit system that is quite useful for engineering

Author

Jean-Michel Védrine

Moodle versions

2012062500 (Moodle 2.3) or newer

Acknowledgments

The Formulas question was written by Hon Wai Lau in about one year during 2009 and 2010, after his Master studies in Physics at the Hong Kong University of Science and Technology. In 2012, Hon Wai Lau was invited by the Complexity Science Group, Department of Physics and Astronomy, University of Calgary, Alberta, Canada. He has obtained his Ph.D. degree in 2017.

Hon Wai Lau's Formulas question original project can be found on Google Code Archive. Note that the initial name 'Coordinate question ' was later changed to 'Formulas question'. Hon Wai Lau's original Formulas question is compatible with Moodle 1.9 and 2.0.

The Formulas question was upgraded to the new question engine, introduced in Moodle 2.1, by Jean-Michel Védrine, professor of Statistics and Computing at the Institut Universitaire de Technologie in Saint-Étienne, France. The upgraded version of the Formulas question is compatible with Moodle 2.3 and later versions, currently up to Moodle 3.4.

Maintainer(s)

Jean-Michel Védrine has maintained the Formulas question type plugin until 2017. He is now back in force for 2018.

Installation

The Formulas question is a Moodle plugin, so you or your Administrator must install it.

Prior to installing the Formulas question though, you need to install install another plugin, that is Tim Hunt's adaptive multipart behaviour, adaptivemultipart available from GitHub or adaptivemultipart from the Moodle Plugins directory. Note that you need version 3.3 or newer of this behaviour, because the Formulas question will not work with previous versions.

You can then install the Formulas question either from the Moodle Plugins directory, from GitHub or from a zip file:

Installing from the Moodle Plugins directory

The Formulas question is available from the Moodle Plugins directory. Install the Formulas question as any other Moodle question type plugin.

Installing from GitHub

The Formulas question is available at the author's Github repository. To install the question, type the following commands in the root of your Moodle install:

git clone git://github.com/jmvedrine/moodle-qtype_formulas.git question/type/formulas echo '/question/type/formulas/' >> .git/info/exclude

Installing from a zip file

Download the zip file from GitHub. Unzip the file in the 'question/type' folder and then rename the new folder to 'formulas'.

Moodle Tracker

Date Author Title and link
2010-08-27 Hon Wai Lau New question type: Formulas
2015-12-17 Tikva Formulas question type does not support expressions calculation
2016-06-14 Renaat Debleu Formulas question type does not support local number formatting

Forum discussions

Date Author Title and link
2010-08-15 Hon Wai Lau New question type: coordinates
2010-11-30 Hon Wai Lau Formulas question type
2011-07-12 Jean-Michel Védrine Formulas question type for Moodle 2.0
Formulas page 24
2015-05-31 George Franz Multiple fill-in-the-blanks graded together
2015-11-26 Bernat Martinez An experience on training teachers...
2016-06-03 Bernat Martinez A CHECK button for each part (for multipart question & adaptive behaviour)
2016-06-13 Peter Halverson Formulas questions errors after 2.9 to 3.1 upgrade
2016-07-12 Alessandro Bucca quiz Formulas plugin
2016-07-14 Matthias Giger Formulas: Using gcd()
2016-07-27 Dominique Bauer Where is the "Check" button in the code?
2016-07-30 Bernat Martinez Format check initialization fail
2016-09-21 florian tobé Create units conversion exercises
2016-10-23 Jarrod McCombie Lab Quiz
2016-11-24 Godfrey Sovis Algebra and Formulas qtypes
2016-12-01 Bernat Martinez PHP error in Formulas question
2017-01-02 Kalyan Chatterjea Formulas Question Type
2017-01-05 Bernat Martinez Grading criteria checkbox not displayed in Boost theme
2017-02-11 Dominique Bauer Suggestion to improve the input format for units
2017-05-09 Miro Iliaš Algebra expression validator for calculated questions
2017-07-10 Jonas Ceponis Text as an answer to calculated questions
2017-07-26 shahin k Dependent answers in two-part questions
2017-08-09 lucia liljegren Formulas question: size of entry box
2017-10-04 Maurício Reis Formulas Type Question Maintenance
2017-12-11 lucia liljegren Formula Question: Mixing text and numbers in answer
2017-12-12 François Lizotte Feedback in Formulas question type
2018-01-21 Dominique Bauer Follow up on "Grading criteria checkbox not displayed in Boost theme"
2018-01-26 Dominique Bauer Trial mark sequence (Formulas question)

Translations available

The Formulas question plugin is available in the following langages:

  • English
  • French
  • Spanish (Mexican)


Back to top of page

In other languages

Español
Français