Partial Credit in Algebraic Formulas (Moodle Formulas type) ?

Re: Partial Credit in Algebraic Formulas (Moodle Formulas type) ?

by Dominique Bauer -
Number of replies: 0
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Ton,

First of all, congratulations on your excellent work. You have raised a few questions and I'll try to answer them as best I can.

(1) Letters of the alphabet are defined as variables in order to avoid a score of 0 if the student enters an incorrect variable name consisting of a letter of the alphabet, for example x instead of a. Note that a score of 0 is given for the part if the student enters any other incorrect variable name, for example x1. This last point can be considered as a bug that will be corrected at a future date, but which does not prevent the use of the grading variables and criterion.

In other words, if a student enters x rather than a or b, he/she will get 0 for the question, unless you have previously defined x as a variable. This is just a precaution that partially covers entering an incorrect variable name.

(2) To my knowledge, d=diff(["x"],["x^2"],1); does not appear anywhere in the question. If it did, it's an error and you can erase it.

About x={-100:100}; if you set it as a global variable, you can use it in all the parts. If you define a local variable, you can only use it in the part where it is defined. If you only have one part, you can define a variable globally or locally, it doesn't matter. There is still a small difference when you regrade the quiz (only if necessary). See https://moodle.org/mod/forum/discuss.php?d=414912#p1672566 ↗.

(3) _r is a grading variable. Grading variables have always been defined in the documentation at https://moodleformulas.org/course/view.php?id=22&section=22#tdm_20200320_2355 ↗.

(4) d[0] is the first and only element of d because the first two arguments of the diff function are lists that themselves have only one element.

When the first two arguments are functions, diff is a measure of the difference between those two functions. diff is a statistical function, but I think other simpler functions could have done the trick just as well. Still, this is the function Hon Wai Lau, the author of Formulas question, chose to evaluate the Algebraic formula answer. Between you and me, in most cases I think evaluating the correctness of a function over a hundred points and calculating the value of diff with a hundred operations is somewhat of an overkill. Indeed, in most cases, that is to say for simple algebraic formulas like a or b, a few evaluation points, even only one, and a value N = 1 are sufficient to verify the correctness of the answer.

So I am not sure why for partial credit with multiple parts we are using this d=diff(["f(x)"],["g(x)"],N) function instead.
This is because you want to rate each of the answers separately and not consider all of the answers as one answer.


Thank you for your interest in the Formulas question. It is thanks to people like you that we are all advancing in the best use of this type of question that Hon Wai Lau bequeathed to us and that Jean-Michel Védrine has been able to upgrade and maintain for 10 years.