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

T&A: Ghost Attempts & correct detection of unfinished test passes #8825

Open
wants to merge 1 commit into
base: release_9
Choose a base branch
from

Conversation

lukas-heinrich
Copy link
Contributor

Hi everyone,

with this PR, I propose a change to correctly recognize unfinished test attempts. Originally this is a fix for 28447, but I was able to find some other places that should be fixed with this change:

Reproduction

To reproduce the behavior, make sure that the test has at least the following settings:

  • Overview of Answers Given: checked
  • Set Time Limit for Completing Test > Maximum Time Available: e.g. 1 min
  • Set Time Limit for Completing Test > Reset Time Limit for All Test Attempts: checked

Cause of the behavior

  • The fundamental problem is that when resetting the Processing Time, the pass is incremented by one (\ilObjTest::isExecutable)
  • This is why self::_getPass($active_id) returns a pass that doesn't exist
  • When finishing the attempt via the button or cron job, the pass is incremented again (see \ilTestPassFinishTasks::performFinishTasks)

Tests

To verify this change, I tested the following scenarios and checked whether the number of passes and the unfinished passes are shown as expected.

  • Attempt completed
  • Attempt not completed
  • First attempt completed, second attempt completed
  • First attempt completed, second attempt not completed

I ran these four cases both for a test without a time limit and for a test with a limit, both with and without a reset. I also checked the database to see if there are any ghost passes.

I am looking forward to your feedback and comments. This PR was internally reviewed by @thojou .
Best,
@lukas-heinrich

@thojou thojou requested a review from kergomard January 10, 2025 14:08
@thojou thojou added bugfix php Pull requests that update Php code labels Jan 10, 2025
@lukas-heinrich lukas-heinrich changed the title T&A: Ghost Attempts & correct detection of unfinished test passes Draft: T&A: Ghost Attempts & correct detection of unfinished test passes Jan 10, 2025
The fact that the pass is also increased after the test is completed by the test author (\ilTestPassFinishTasks::performFinishTasks) leads to a number of problems. See: 42856, 27077, 28447, as well as empty test results in the results and evaluation view
@lukas-heinrich lukas-heinrich changed the title Draft: T&A: Ghost Attempts & correct detection of unfinished test passes T&A: Ghost Attempts & correct detection of unfinished test passes Jan 10, 2025
@lukas-heinrich
Copy link
Contributor Author

The branch is now updated and works for the release_9 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants