blob: 1b9d86446c190adfb3224a03246bf737b14b945f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
MOODLE ALGEBRA QUESTION TYPE
----------------------------
This implements an *algebraic* question type for moodle. The student enters a formula. For example:
* Suppose the right answer is `½ sin 2θ`. Then `sin(θ) cos(θ)` will be considered equally correct.
* Suppose the right answer is `1/√(1-x^2)`. Then `cosh(asinh(x))`
will be considered equally correct.
This is a huge improvement over multiple choice.
This is a light-weight plugin. It implements its own simple routines
for parsing and evaluating expressions. It takes only a couple
minutes to install and configure, if you already have a working moodle
system.
### Principles of Operation
The plugin tests the answer by evaluating it numerically and comparing
to the desired answer specified by the teacher. The evaluation is
performed at random points within a specified interval.
(The code purports to provide other ways of evaluating formulas, but
these are untested and unsupported.)
There are ways of specifying multiple correct answers, for full or
partial credit, if that's what you want.
If a variable name spells out a Greek letter (e.g. `beta` or `Lambda`)
it will be formatted as the corresponding letter (`β` or `Λ`).
Variable names can have subscripts, e.g. `x_min` or `beta_3`.
#### Input formatting:
Express the inputs the way you would program in a computer language.
Do not try to format or typeset the inputs.
The plugin will show a formatted, typeset version. This is slightly
helpful to confirm that the your input was understood, but mostly it's
just cosmetic. The typeset version plays no role in the evaluations.
### Installation and Setup
#### Install using git:
To install using git:<br>
:; cd $moodle/<br>
:; git clone https://www.av8n.com/cgit/moodle-qtype_algebra/ question/type/algebra<br>
:; echo '/question/type/algebra/' >> .git/info/exclude
Then run the moodle update process. This may require you to install a
bunch of php plugins that you heretofore didn't need. The update page
will guide you through this. It should be visible at:<br> Site
administration > Notifications
For support, consider using the [Moodle quiz
forum](https://moodle.org/mod/forum/view.php?id=737), which covers all
Moodle question types (not just this one):
[https://moodle.org/mod/forum/view.php?id=737](https://moodle.org/mod/forum/view.php?id=737)
#### Requirements:
For the display to work you need to have some way of displaying TeX
expressions activated on your Moodle website: either the TeX filter or
the MathJax filter enabled. Beware that there are thousands of web
sites that give outdated or just plain wrong instructions for
installing MathJax, so you may find it easier to rely on the builtin
Tex filter.
### See Also
There exists a much more heavy-weight solution to the same problem. It uses
a fully-featured computer algebra system as its back end:
[STACK question type](https://docs.moodle.org/311/en/STACK_question_type)
[`https://docs.moodle.org/311/en/STACK_question_type`](https://docs.moodle.org/311/en/STACK_question_type)
### Colophon
* Originally created by by Roger Moore
* Updated to Moodle 2.0 by Stefan Raffeiner
* Updated to Moodle 2.1 by Jean-Michel Védrine
|