Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in Automark functionality after changing default status in attendance module #747

Open
jumabgz opened this issue Apr 16, 2024 · 1 comment

Comments

@jumabgz
Copy link

jumabgz commented Apr 16, 2024

Hi,

I found that if a global default status is set and then removed in mod/attendance/defaultstatus.php, then, the automatic marking configuration remains available in all attendance activities, including new activities that do not have a default status configured.

After installing the plugin, when adding an attendance activity and a session, automatic marking is not configurable due to the lack of a default status at activity level. It is ok, because it depends on having a default state configured. From here:

  1. Set "Absent" as the global default status ("Automatically set when not marked") in mod/attendance/defaultstatus.php and save.
  2. Delete the default status (accepting data deletion) from mod/attendance/defaultstatus.php and recreate it without setting it as default.
  3. Create a new attendance activity, and verify that no default status is included at activity level status set.
  4. Bug: Add a new session, and notice that automatic marking can be configured, even though there is no default status at the activity level. Save the configuration with automark to "set unmarked at end of session", and an error message should appear "The status set in use does not have a status to use when not marked.". At this point, the option to configure automark should not be available at all because there is no default status at the activity level. Save it with "automark" set to "disabled".
  5. Re-set "Absent" as the global default status ("Automatically set when not marked") in mod/attendance/defaultstatus.php and save.
  6. Bug: In the same activity from step 3, create a new session that ends in the current minute, and notice that automatic marking can still be configured, even though there is no default status at the activity level. Save the configuration with automark enabled to "set unmarked at end of session" (now allows the automark to be saved).
  7. Bug: the original session of 4. now allows to be modified and set automark enabled (e.g. "set unmarked at end of session"). It should not since the activity does not have a set of states with a default state.
  8. Run \mod_attendance\task\auto_mark and review de "warnings":
Execute scheduled task: Check for attendance sessions that require auto marking (mod_attendance\task\auto_mark)
... started 12:33:52. Current memory use 2.3 MB.
No unmarked status is configured for this session (id:3), to fix this update the <a href="https://xxx/mod/attendance/preferences.php?id=11">Status set</a>
No unmarked status is configured for this session (id:2), to fix this update the <a href="https://xxx/mod/attendance/preferences.php?id=11">Status set</a>
... used 10 dbqueries
... used 0.014538049697876 seconds
Scheduled task complete: Check for attendance sessions that require auto marking (mod_attendance\task\auto_mark)

In summary, after setting and removing a global default status, the automark functionality behaves unexpectedly.

Moodle 4.1.9+ (Build: 20240313)
Attendance 2023020107

Thank you,
Regards

@jumabgz jumabgz changed the title Inconsistency in Automark Functionality After Changing Default Status in Attendance Module Inconsistency in Automark functionality after changing default status in attendance module Apr 16, 2024
@danmarsden
Copy link
Owner

thanks for the suggestion - I agree it makes sense to warn the teacher a bit better when this mis-configuration is in place when they create a session - if you have internal development capabilities, feel free to help further by submitting a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants