ModernLMS / moodle-availability_othercompleted

This plugin allow to restrict access of activities and resources in your course based on other course completion.
6 stars 12 forks source link

Existing availability condition is broken after duplicating an activity #22

Open abias opened 2 years ago

abias commented 2 years ago

Hi,

I encountered a problem with this problem when duplicating an activity with this availability condition.

Prerequisites:

Steps to reproduce:

Expected result:

Actual result:

Analysis

I expect that this problem happens because the update_after_restore function on https://github.com/MUDOTMY/moodle-availability_othercompleted/blob/master/classes/condition.php#L168-L187 is a full copy of availabilty_completion and is not adapted to handling the reference to a completed courses instead of a completed activity.