Moodle Formulas [Part Answer Correct]

Moodle Formulas [Part Answer Correct]

by Dipo Adeniyi -
Number of replies: 10

Good evening,

I have 2 answers in part 1 Answer* field of Moodle Formulas as [5, 10]. 

Now 5 is answered correctly, but 10 is answered incorrect. So, both are marked as incorrect or given zero score.

Please is there away to mark one correct and say given 50% scores?

I already know how to use Part 1, Part 2, etc, but I have up to 16 combined answers  so trying to avoid the part1, part 2, part 3, individual answers.

Many thanks.

Dipo. 

Average of ratings: -
In reply to Dipo Adeniyi

Re: Moodle Formulas [Part Answer Correct]

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

Hello Dipo,

Please is there away to mark one correct and say given 50% scores?

Yes, you have to use Grading variables and a grading criterion. See https://moodleformulas.org/course/view.php?id=22&section=22#tdm_20200320_2354 ↗.

In reply to Dominique Bauer

Re: Moodle Formulas [Part Answer Correct]

by Robert Kerep -
Hello,
I am having a problem with partial scoring (in Formulas type) for example in part 4. The total number of points in this part is 1, and there are two answers, so each one should give 0.5. I am using this option: _relerr < 0.03*(_0==H)*0.5 + (_1==S)*0.5 (answers: [H,S]) but it still doesn't score properly.
And of course I must have relative errors of max 3 % 'cause student's answers can be calculated different than mine.

Thank you in advance.
In reply to Robert Kerep

Re: Moodle Formulas [Part Answer Correct]

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

Hello Robert,

What you propose, i.e. _relerr < 0.03*(_0==H)*0.5 + (_1==S)*0.5, is a boolean whose value can only be 0 or 1. You will therefore not be able to obtain a partial score with this formulas. What you need to do is check the two answers separately, proceeding as follows:

Grading variables
      score0 = abs(H - _0)/H <= 0.03;
      score1 = abs(S - _1)/S <= 0.03;

Grading criterion
      0.5*score0 + 0.5*score1

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Moodle Formulas [Part Answer Correct]

by Robert Kerep -
Hello Dominique

First of all, thank you so much for that idea, although I have tried that in your way, but it still didn't show partial score.

Next, I use this combination:
GV: absoluteError0=abs(H-_0);
relativeError0=absoluteError0/H;
criterion0=relativeError0<=0.1;
absoluteError1=abs(S-_1);
relativeError1=absoluteError1/S;
criterion1=relativeError1<=0.1;
GC: 0.5*criterion0 + 0.5*criterion1

and there was no partial scoreing.

I have no ideas what to do anymore.

Thank you in advance for helping.
In reply to Robert Kerep

Re: Moodle Formulas [Part Answer Correct]

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

It should certainly work.

If you attach the XML file of your question, we will be better able to help you. Please mention in which "Question behaviour" you will run the quiz.
In reply to Dominique Bauer

Re: Moodle Formulas [Part Answer Correct]

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

Hello Dipo,

Simply check the two answers separately. Proceed as follows:

Grading variables
      score0 = _0 == 5;
      score1 = _1 == 10;

Grading criterion
      0.5*score0 + 0.5*score1

In reply to Dominique Bauer

Re: Moodle Formulas [Part Answer Correct]

by Dipo Adeniyi -
Hello Dominique,

Thanks for the above. Wondering, is it actually possible to use the two conditions of "answer in any order" and part answer correct, at the same time?

Pls see what I have done below:

Grading variables a2 =_0==a2; a3=_1==a3
Grading criterion* (_0 == a2 && _1 == a3) || (_0 == a3 && _1 == a2) [Takes care of answer in any order] || (0.5*a2+0.5*a3) [ To award part score if one answer is incorrect]. Doing this however is giving scores to both answer if only one is correct.
In reply to Dipo Adeniyi

Re: Moodle Formulas [Part Answer Correct]

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

Hello Dipo,

(I am using a0 and a1 as the target answers.) There are 6 conditions to check, which you can define as grading variables:

c0 = 1.0*(_0 == a0 && _1 == a1);
c1 = 1.0*(_0 == a1 && _1 == a0);
c2 = 0.5*(_0 == a0 && _1 != a1);
c3 = 0.5*(_0 == a1 && _1 != a0);
c4 = 0.5*(_0 != a0 && _1 == a1);
c5 = 0.5*(_0 != a1 && _1 == a0);

The grading criterion is then simply:

c0 + c1+ c2 + c3 + c4 + c5
Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Moodle Formulas [Part Answer Correct]

by Dipo Adeniyi -
Thanks so much Dominique. Deeply appreciate, always!