Course progress bar based on activities weights

Course progress bar based on activities weights

by Albana Celepija -
Number of replies: 0

Hello ,

How can I calculate the percentage of course progress based on activity weight not just counting how many activities are done (count_done / total_activities).

I need to give some weight to each activity. For example:

activity 1: 20 points (done)

activity2: 10 points (done)

activity3: 5 points (still to be done)

activity4: 5 points (still to be done)

Currently, in Moodle, this will output the percentage 50%, which is not correct since the student has done the most important activities with the highest weights. It should output instead (20+10) / (20 + 10 + 5 + 5) = 75%.

Is there any plugin that overwrites the default way of calculating progress?

As a quick solution, I have added one custom field per activity and changed the core of Moodle (completion/classes/progress.php) to calculate in a different way the progress, but I would like to avoid changing the core.

Is there any way to write a local plugin? If yes, what namespace should I use and what class should I extend?

I would appreciate any suggestion since I am new to Moodle.

Thanks in advance

Average of ratings: -