Partial Credit in Algebraic Formulas (Moodle Formulas type) ?

Partial Credit in Algebraic Formulas (Moodle Formulas type) ?

by Ton Boerkoel -
Number of replies: 4

Is it possible to assign partial credit in Algebraic Formulas?

For example in Calculus if the answer is 

                                     

How do you set up partial credit?  I know I asked this question before and nobody responded, so I included an example that might be more palatable. 

(1)   If it is not possible, can someone confirm that it isn't, 

or 

(2)   if it is possible, can someone direct me to the page of the Moodle documentation where I can find instructions?

Average of ratings: -
In reply to Ton Boerkoel

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

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
The easiest way to give partial credits is to place questions in different parts. However, if the questions are related, it is likely that you want to place them in the same part. You must then use the grading variables and criterion to assign partial credits.

(1) It's possible.
(2) See "Several algebraic formula answers in the same part" at https://moodleformulas.org/course/view.php?id=22&section=23 ↗.
In reply to Dominique Bauer

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

by Ton Boerkoel -

Hi Dominique,

Thanks for the response!  At first I was a little confused about the XML you posted on the website

(1)  It stated in the global variables: # Set all letters of the alphabet as variables  a = 0; b = 0; c = 0; d = 0; ...; X = 0; Y = 0; Z = 0;

I just couldn't figure out why that was important for partial credit, until I realized I could just delete it (It was probably something left-over from another question)

(2)  In the global variables you defined:  x={-100:100};    d=diff(["x"],["x^2"],1);

I didn't understand why that was there either, until I realized I could erase that too, and put the x={-100:100} in the local variables of part 1.

(3)  Then I was stumped by:   d0=diff([_r[0],["x"],100);  in particular the  _r

I can only guess that this must be a placeholder that I had never seen (In your online section on place holders you list  _0   _1 ... and  _u)  I am guessing that  _r  is a place holder for a list (?),  the list of answers (?) (in this case [_0,_1]), and _r[0] is the first entry in that list (?)

(4)  I still don't understand the d=diff(["f(x)"],["g(x)"],N) function. In your online section on the diff(  ) function  you state that d[0] is a random value of a list, whereas d[0] looks like the first entry of the list d.  Not quite sure what the role of the N is either. 

Thanks for the reply though, It took me a while to figure out what it all meant, but I think I can now do the partial credit in the algebraic formula case (even without understanding the use of the diff(  ) function)

In fact I don't really know how the algebraic formulas does the grading:  I always assumed that the Moodle algorithm would compute the answer for a (random) number of points and see if it matches with the given 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.

Again thanks Dominique, much appreciated!

Ton B



In reply to Ton Boerkoel

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

by Ton Boerkoel -

It worked!


graded with partial credit


Thanks Dominique!

In reply to Ton Boerkoel

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

by Dominique Bauer -
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.