Skip to content

Test 46659: Add Org-Unit Filter to Manual Scoring - #11508

Open
matheuszych wants to merge 1 commit into
ILIAS-eLearning:release_11from
matheuszych:ta/46659
Open

Test 46659: Add Org-Unit Filter to Manual Scoring#11508
matheuszych wants to merge 1 commit into
ILIAS-eLearning:release_11from
matheuszych:ta/46659

Conversation

@matheuszych

Copy link
Copy Markdown
Contributor

See: https://mantis.ilias.de/view.php?id=46659

When org unit position access is active for a test, the manual scoring view listed all participants. PositionsFactory now injects ilAccess and filters the participant set to users the current grader may score via ilOrgUnitOperation::OP_SCORE_PARTICIPANTS. Participant queries in ilObjTest also use a stable ORDER BY (lastname, firstname, active_id).

/cc @thojou

@dsstrassner dsstrassner added bugfix php Pull requests that update Php code labels Apr 30, 2026
@dsstrassner

Copy link
Copy Markdown
Contributor

@kergomard please review!

@kergomard

Copy link
Copy Markdown
Contributor

Thank you very much for the PR @matheuszych

I don't think this is right: As I understand it, this would filter the participants when org-units are enabled, even if the scorer has the permission to score everybody.

The logic has to be another one:

  • If a scorer has the permissions to manage test results or to score anonymously all users need to be accessible (once with and the other time without names).
  • If a scorer only has the permission to mange test results through org-units than the user is only allowed to score the participants she has access to through the org-units.
  • If a scorer has the permission to score anonymously AND the permission to manage test results through org-units than the list must contain ALL users, but only the names of the participants coming from org-units should be shown, while the others should be pseudonymous.

There should be a similar logic in the participants overview. There might be synergies.

Thanks again and best,
@kergomard

@matheuszych

Copy link
Copy Markdown
Contributor Author

Hello @kergomard ,

Thank you for your feedback!

I adjusted the code to conform to the three cases you mentioned.

Best regards
@matheuszych

@kergomard kergomard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @matheuszych !

So, I think we are getting there. There are still a few things though:

  • Please do not cast to int here. The function does always return an int.
  • We should not retrieve $this->object->getAnonOnlyParticipantIds() here. I think that we can safely assume that we are going to need this and just load it in the constructor.
  • The function PositionsFactory::filterParticipantsByScoreAccess() is not well named, as the name suggest that we are looking for participants that have something that is called "ScoreAccess" (no idea what that should be). We should call it PositionsFactory::filterParticipantsByAccessOfCurrentUser().

Ok, I do only look at the code and now I think it does the right thing. I assume you thoroughly checked that it works in the interface and that you will do so a final time now.

Best,
@kergomard

See: https://mantis.ilias.de/view.php?id=46659

When org unit position access is active for a test, the manual scoring view listed all participants. PositionsFactory now injects ilAccess and filters the participant set to users the current grader may score via ilOrgUnitOperation::OP_SCORE_PARTICIPANTS. Participant queries in ilObjTest also use a stable ORDER BY (lastname, firstname, active_id).
@matheuszych

Copy link
Copy Markdown
Contributor Author

Hello @kergomard ,
thank you for your feedback.

I adjusted the mentioned things, rebased the branch, squashed the commits and tested it again.

Best regards
@matheuszych

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.

4 participants