mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
6fb09beb86
The UX team proposal is to display two different notifications, to avoid confusion: 1. When the user is in preview mode: Message: 'You are in preview mode.' Notification Type: Information (blue), with the information permanently visible and not dismissible, ensuring continuous awareness. 2. When activity tracking is disabled: Message: 'Attempt tracking is not enabled for this activity. You can enable it in Settings.' Notification Type: Warning (yellow) with a close icon for dismissal if tracking is intentionally disabled. These notifications should only be visible to teachers and content creators, not students. If a teacher also has a student role, this information should not appear when logged in as a student. That's why the pre-existing is_tracking_enabled() function has been updated to only check if tracking is on for an activity, without considering user capabilities (that's why the $user parameter has been removed from this function too). Besides, a new function called can_submit() has been created to find out if users are allowed to submit an activity.