Formulas - Answer like ax²+bx+c

Formulas - Answer like ax²+bx+c

by Éric Bugnet -
Number of replies: 3
Picture of Documentation writers Picture of Plugin developers Picture of Translators

Hi,

I want to use a formulas question type where I need to check the student answer like f(x) = ax²+bx+c.

I means : a, b and c are variables or number already finded by the student before, and I need him to put his answer like : 3x^2-4x+7

For now, I use a numerical anwser for each variable like that :


It's not the better way I'm sure, but didn't know how to do it with algebrica answer type.

Can someone help me ?

Thanks,

Éric


Average of ratings: -
In reply to Éric Bugnet

Re: Formulas - Answer like ax²+bx+c

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Éric,

In the following example, we want students to type in the expression \(a x^2 + b x + c\), but where \(a\), \(b\) and \(c\) are numeric constants, for example \(7 x^2 + 4 x + 6\) where \(7\), \(4\) and \(6\) are, say, calculated in previous steps.

We don't want students to be able to enter \(a x^2 + b x + c\). We therefore carry out a change of variables locally in the parts, for example we define a_zkd = a where a_zkd is a name made up of "\(a\)" followed by random characters so that students cannot guess and use this name, then we define locally, i.e. temporarily, a, b and c to incorrect values. This way the only correct answers are 7 x^2 + 4 x + 6 and a_zkd x^2 + b_asq x + c_mch. Obviously, the only correct answer students could give is the first one.

The following question consists of two parts which use the global variables \(a\), \(b\) and \(c\), in order to demonstrate that the redefinition of these variables in the parts is indeed local and therefore that it does not affect the global values.

Note that a regular space can replace the multiplication sign. Students can therefore enter 7*x^2 + 4*x + 6 or 7 x^2 + 4 x + 6, the second way being probably easier.

https://moodleformulas.org/course/view.php?id=95&section=13 ↗


In reply to Dominique Bauer

Re: Formulas - Answer like ax²+bx+c

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Equations can also be displayed in AsciiMath format, which is similar to LaTeX, as students type them. See for example https://moodleformulas.org/course/view.php?id=78&section=50 ↗ and https://moodleformulas.org/course/view.php?id=78&section=51 ↗.


In reply to Dominique Bauer

Re: Formulas - Answer like ax²+bx+c

by Éric Bugnet -
Picture of Documentation writers Picture of Plugin developers Picture of Translators
Hi dominique,
Thanks for your answer : I'll look at it soon !
Éric