Hi, I am trying to get the subscores from a quiz that I setup in Moodle. I have the followed the steps outlined here Quiz Subscores but still not getting accurate results in students grade book. I have a total of 60 questions with 6 sections. See pictures attached. What could I be doing wrong?

### Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Number of replies: 21### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Mishael,

If you use the **Quiz Subscores** method, you must consider the following:

- If you use base-10 calculations, you can have a maximum of 9 questions per section. Otherwise, you can not tell the difference between 10 correct answers at 1 point each and 1 correct answer at 10 points each.

- If you want to have 10 questions per section, you must use at least base-11 calculations. That is, the mark for the questions in the first group is 1, the mark for the questions in the second group is 11, third group 121, fourth group 1331, etc. For section 1 the calculation is =mod(floor(Pretest/1),11), for section 2 the calculation is =mod(floor(Pretest/11),11), for section 3 the calculation is =mod(floor(Pretest/121),11), etc.

- You are limited by the maximum
**Total of marks**for a quiz which seems to be 99 999, and by the**Maximum grade**for a quiz which seems to be 90 909 (as seen on the**Editing quiz:**page).

So, with 10 questions per section and base-11 calculations, you can only have a maximum of 4 sections before reaching the limits for **Total of marks** and **Maximum grade**.

With 9 questions per section and base-10 calculations, you can have a maximum of also 4 sections before reaching the limit for **Maximum grade**.

With 8 questions per section and base-9 calculations, you can have a maximum of 5 sections.

With 6 sections, the maximum number of questions per section is 5 (base-6 calculations). With 7 sections, the maximum number of questions per section is 4 (base-5 calculations).

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Of course, use the double brackets in the formulas as follows:

`=mod(floor([[Pretest]]/1),11)`

, etc.

(do not copy-paste the above formula)

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Thank you very much. It worked. I got around the limits for Total Marks and Maximum grade by adjusting the datatype for "sumgrades", "maxmark", "grade", "finalgrade", "rawgrademax" and "rawgrade" in the Moodle database to allow for a higher grade number.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Dear Mishael,

could you identify which tables in the database you have changed ?

Thanks.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Hello Dominique,

I am having hard time to apply the subscore concept,

I have a quiz of 40 questions divided into 4 sections (each section contains 10 question and each question is 1 point). so the whole quiz is 40 points therefore each section is 10 points.

So I am trying to create four items but seems to be giving me another result and something does not make sense,

Let me show you what I did,

1. I created 4 items:

- S1 = mod(floor([ [ TA ] ]/1),11)
- S2 = mod(floor([ [ TA ] ]/11),11)
- S3 = mod(floor([ [ TA ] ]/121),11)
- S4 = mod(floor([ [ TA ] ]/1331),11)

2. I answered correctly all the questions and here what the results looks like

Could you help me identify what did I do wrong ?

Many thanks

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Hello Mario,

On the "Editing quiz" page, set the Maximum mark to 1 for questions 1 to 10, 11 for questions 11 to 20, 121 for questions 21 to 30 and 1331 for questions 31 to 40, and set the Maximum grade for the quiz to 14640 (equal to 10x1 + 10x11 + 10x121 + 10x1331). In the gradebook, you may want to display the results only as percentages.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Thanks for your reply, however still didn't work out

I did what you told me to do

1. I set the maximum marks as you told me and set the Maximum grade for the quiz to 14640

2. In the gradebook, I displayed the results as percentages

But still didn't work out still getting the same result

The same student got the same result as before

Another student who attempt the quiz got this result !!!

Please HELP !!!

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

You will find a detailed example at https://moodleformulas.org/course/view.php?id=49§ion=16.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Hi Dominique,

Do you have a username/password for that Moodlesite?

Thanks.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Username: student

Password: Moodle2018#

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Thanks Dominique,

I applied the instructions and it is working fine,

However, I would like to ask two more questions in order to advance the use of this technique:

**Question 1:**If I have different number of questions within each section (for example, section one (12 questions), section two (6 questions) and section three (18 questions). How can I set it ?**Question 2:**If questions within the same section have different mark, does it take it into consideration ?

Many thanks

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Hello Mario,

#### Question 1

You must set the Base according to the largest number of questions per section, that is, in your example, Base = 18 + 1 = 19.

If necessary, you can minimize the value of the "Maximum grade" for the test by assigning the lowest "Maximum mark" to the sections with the most questions. Hence, on the "Editing quiz" page, set the "Maximum mark" to:

- For section one (12 questions): 19 = 19^1
- For section two (6 questions): 361 = 19^2
- For section three (18 questions): 1 = 19^0

In the Gradebook, in accordance with the above, define the Calculation to:

- For Grade item 1 (section 1): =mod(floor([ [Quiz] ]/19),19)
- For Grade item 2 (section 2): =mod(floor([ [Quiz] ]/361),19)
- For Grade item 3 (section 3): =mod(floor([ [Quiz] ]/1),19)

In the Gradebook, set the Maximum grade to:

- For Grade item 1 (section 1): 12
- For Grade item 2 (section 2): 6
- For Grade item 3 (section 3): 18

Question 2

No, all questions must have the same mark.

Taking into account different marks within sections would make the application of the method very complex. In this case, it would be better to consult the available data with Quiz -> Results/ Grades-> Display options/ Marks for each question: Yes/ Show report.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

#### Question 2, cont'd

On reflection, I think on the contrary that it would be quite easy to apply the method to take into account questions with different marks within the same section. To do this, you would simply assign different Maximum marks for each group of questions with the same mark, within all sections, and adjust the calculations of the Grade items.

Note that the Quiz Subscores method is only a workaround. It would be better if a programmer could develop a plugin to get the subscores directly.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Thanks Dominique,

Could you give me an example how it is done ?

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

The use of the method "Quiz subscores" should be discouraged because it is a laborious and often not necessary workaround. It is much simpler to use several quizzes.

For example, if a maths exam has three parts,

- Part 1 Logic
- Part 2 Arithmetic
- Part 3 Geometry

then make three distinct quizzes and present them as follows:

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Mario,

You will find a second example at **https://moodleformulas.org/course/view.php?id=49§ion=16**, which includes topics with different numbers of questions of different values.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

**Question 1:**If I have different number of questions within each section (for example, section one (12 questions), section two (6 questions) and section three (18 questions). How can I set it ?**Question 2:**If questions within the same section have different mark, does it take it into consideration ?

Example 3 in **MoodleFormulas** has different number of questions within each section and questions within the same section have
different mark. Bookkeeping is a bit complex, but the results are pretty nice.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Dear Dominique,

thank you for the detailed example,

I wanted to share with you that I managed as well to find the formula of a quiz with different number of questions within each section and questions within the same section have different mark,

It is the same as your formula, but the base is a bit different,

The base for the calculations is according to the largest total number of __ questions __per group,

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Mario,

Does your method take partial marks into account? For example, if a question is marked out of 3, can your method distinguish between scores of 0, 1, 2 and 3, or only between 0 and 3?

If you wish, I can put your method on **MoodleFormulas.org**.

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Hello Dominique, I didn't really understand your question !

Could you explain more in details

### Re: Moodle Quiz Subscores: Moodle 3.5+ (Build: 20180531)

Mario,

If the calculation base is set to the number of questions, all you can obtain is whether the answer to a question is correct or incorrect. For example, if a question is marked out of 4, the score can only be calculated as 0 or 4. This is suitable for True or False
questions or multiple-choice questions with only one correct answer.

If the calculation base is set to the number of points, you can determine the number of points obtained for the questions. For example, If a question is marked out of 4, the score can be calculated as 0, 1, 2, 3 or 4. This would be suitable for multiple choice questions with more than one correct answer. Note that if you have multiple questions of the same value, you only get the total points for those questions. For example, if you have two questions marked out of 4 and the score is 2 for the first question and 3 for the second question, you can calculate only the average score for these questions, equal to (2 + 3) / (2x4) = 62.5 %.