You could create a subcategory and change the category total to a custom calculation that looks at the second, and takes that score unless it's empty.
Mark
Hi Mark,
I have exactly the same problem as Miki, but I am not sure which exam I should take into a subcategory.
I have a main grade category which wears the name of the course and I use natural aggregation in it. I have two subcategories such as exams and homeworks. The exams subcategory involves two items, the main exam and the second exam.
So my question is which item (exam and/or the second exam) I should take into a new subcategory? Should I use a custom calculation in exams subcategrory which is directed to the second exam item? In this case, does the moodle take only into account the second exam item if the point is filled out?
Thank you in advance for your answer.
Best regards,
Zoltán
Re: Tárgy: Re: How to calculate late exam in the gradebook
Both exams should go in the subcategory and then the calculation should be written at the category level. Something to the effect of If Exam B is not null, Exam B total ...else Exam A total (that is not correctly formatted - just entered to give you an idea)
Tárgy: Re: Tárgy: Re: How to calculate late exam in the gradebook
Dear Emma,
Thank you for your answer, but I do not know how I could write such a formul, since there is no if-else logical structure in the custom calculation.
My category structure is the following:
category named 'Exames' [subcategory named '1.exam' [ item named 'MainExam' (ID: Ex1), item named 'SecondExam' (ID: Ex2),] ]
The subcategory total is calculated by natural aggregation, while the category total is calculated by custom calculation with the following formula: '=[[Ex2] ]' (the space between ] ] is intentional here.)
However this solution is not working correctly. Could you tell me where is the fault?
Best regards,
Zoltán
Re: Tárgy: Re: Tárgy: Re: How to calculate late exam in the gradebook
Because your calculation is telling the category to use the value of exam 2 for the total, regardless of whether there is a value in there or not.
You might look at this post - I think maybe it could help to achieve what you are looking for.
https://moodle.org/mod/forum/discuss.php?d=171508
Re: Tárgy: Re: Tárgy: Re: How to calculate late exam in the gradebook
Or you might use the max argument. That would pull the higher of the two scores - would that not achieve the result you are looking for?
Tárgy: Re: Tárgy: Re: Tárgy: Re: How to calculate late exam in the gradebook
Thank you again your answer.
I have written the following custom formula which works correctly as Miki wrote:
= floor( (Ex2+1)/(Ex2+1)*Ex2 + Ex1*(1-Ex2/(Ex2+0.01)))
Best regards,
Zoltán
Re: Tárgy: Re: Tárgy: Re: Tárgy: Re: How to calculate late exam in the gradebook
Glad you were able to figure it out and thanks for sharing the answer.