Attendance and scales

Attendance and scales

by Kathrin Osswald -
Number of replies: 4

Hi,

one of our users asked how the attendance entries are mapped to his indivdual scale? In the tab „Status set“ you can set points for each option.

But where does the mapping of the points received to a selected scale happens? 

Our user has a own scale: „Competent, Not yet competent“ and he said some students with 70% of attendance get a „Not yet competent“ grade and others with 75% of attendance get a “Competent“ grade.

I did not find any setting where to define this threshold and the mapping from attendance percentage of points to the individual scale items.

Do I oversee something?  Or is the plugin maybe not intended to work with scales?

Best, Kathrin

Average of ratings: -
In reply to Kathrin Osswald

Re: Attendance and scales

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

It is supposed to handle scales, but it's definitely possible there is a bug in there somewhere.

the important stuff all happens in the function "attendance_update_users_grade" here:
https://github.com/danmarsden/moodle-mod_attendance/blob/master/locallib.php#L224

Probably needs someone to spend some time looking at that function and make sure it's working correctly when the scales are in use.

thanks,

In reply to Dan Marsden

Re: Attendance and scales

by Kathrin Osswald -

Hi Dan, 


thank you for your answer and naming of the corresponding function.

Alex and I did some testing and research and we think that the calculation is indeed buggy respectively needs an addition.


You are using this formula to calculate the grades:

$usersummary->takensessionspercentage * $attendancegrade

(https://github.com/danmarsden/moodle-mod_attendance/blob/master/locallib.php#L256)


Let's have a look at an example:

The teacher uses the Scale "Not yet competent, Competent". So, $attendancegrade will be 2 ($attendancegrade = count($scalearray)).

He also has 2 attendance status: "Attended (A)" and "Not attended (N)" graded with 2 (A) and 1 points (N).


  •  Now assuming a participant has a "takensessionspercentage" of 70% (0.7). Your formula then calcuates: 0.7 * 2 = 1.4.

This solution will be mapped to the Scale that lies between 1 and 2 in our example. So 1.4 will be rounded down to 1 and that means that the user will get a "Not competent" grade.

  •  Now assuming a participant has a "takensessionspercentage" of 76% (0.76). Your formula then calcuates: 0.76 * 2 = 1.52.

This solution will be mapped to the Scale that lies between 1 and 2 in our example. So 1.52 will be rounded up to 2 and that means that the user will get a "Competent" grade.


With a scale of two items, the breakpoint should be at 50% attendance (in my understanding).

If you would change your formula to the following, the result should be correct then:

0.5 + ($usersummary->takensessionspercentage * $attendancegrade)
  • Attendance percentage 0.7

=> 0.5 + (0.7 * 2) = 1.9

This will be rounded up to 2 and therefore the user will now get the correct grade "Competent".

  • Attendance percentage 0.76

=> 0.5 + (0.76 * 2) = 2.02

This will be rounded down to 2 and therefore the user will still get the correct grade "Competent".

  • Attendance percentage 0.49

=> 0.5 + (0.49 * 2) = 1.48

This will be rounded down to 1 and therefore the user will get the correct grade "Not competent".


Best, Kathrin

In reply to Kathrin Osswald

Re: Attendance and scales

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Thanks Kathrin,

Looks like that code mainly dates back to this:
https://github.com/danmarsden/moodle-mod_attendance/issues/51

Which came from a community patch that I didn't spend much time on testing myself - I haven't spent much time looking into how scales are supposed to work either.

Feel free to file a pull request to improve it!

thanks!