Check availability individually

Check availability individually

by Son TRAN -
Number of replies: 0

Dear All, 

I found that the Moodle  availability feature is a powerful/flexible tool to apply conditions to courses'activities. With the availability API I can retrieve the UNION right of a user on an activity. 

But how can I  check user's right using each condition one after the other? 

For instance I have a user X belonging to Group A AND Group B. If I call 

$cm = $modinfo->get_cm($cmid); and check the flag $cm->uservisible, I will retrieve the availability/right of that user, who is member of Group A AND group B altogether. What I would like to obtain the availability / right for that user with a condition that he is member of  Group A exclusively; then to  obtain the availability / right for that user with a condition that he is member of  Group B only, separately.

To create a fake user belonging to only Group A OR group B and check as the above seems cumbersome.

Thank you for your helps

 
 

Average of ratings: -