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

UI: Replace legacy modals in ilTestPlayerAbstractGUI #8211

Conversation

lukas-heinrich
Copy link
Contributor

These changes are part of the Legacy-UI refactoring. This PR revises and brings together #7983 and #7984.

@matheuszych and I replaced the legacy ilModalGUI with the newer Kitchen Sink interruptive and roundtrip Modal. The control of the modal via DOM elements in JavaScript has been replaced by using signals. Class ilTestPlayerConfirmationModal and associated template files have been removed as they are no longer needed.

In addition, the commit cf00c9d was reverted to fix lObject::read(): Object with obj_id: -1 (tst) not found!. The behavior described in the corresponding Mantis ticket has not reappeared here.

Copy link
Contributor

@kergomard kergomard left a comment

Choose a reason for hiding this comment

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

Thank you very much for the PR @lukas-heinrich !

First:

  • I was completely unable to get the FeedbackModal to show, when testing.

The code is mostly ok and I've just three small requests:

  • Please rename the variable here to snake_case.
  • Please do not revert my commit for this line here, but explain precisely when you run into the issue that the obj_id is -1. For the moment, I believe that my solution is actually the right one and we need to figure out, how we can get here without having a valid test (and then wanting a test). Please create an issue, if necessary.
  • Please fix the coding style.

Finally (this nothing you introduced here, but as you are working on this):

  • Could you please have a look at why the buttons below the question do not work.

Thanks again and best,
@kergomard

@kergomard kergomard closed this Oct 22, 2024
@kergomard kergomard reopened this Oct 22, 2024
@kergomard
Copy link
Contributor

Sorry @lukas-heinrich ! Didn't want to do that: Neither the comment nor closing the PR!

@lukas-heinrich
Copy link
Contributor Author

Hi @kergomard !

Thank you very much for the feedback. I will implement the suggestions and update them in the PR.

I also tried to find out why the buttons in the bottom navigation bar are not working. This seems to be due to the browser placing them in the wrong place in the DOM. I was able to trace the behavior back to the fact that modals are rendered in the player's form, which themselves contain other forms. This leads to incorrect behavior because HTML forms are not allowed to have other HTML forms.
I have adjusted my relevant parts, but unfortunately I could not fix the issue completely. The modal .il-copg-mob-fullscreen is still in the form element and I have currently found no way to render it outside the form. I created a Mantis ticket for this specific modal: https://mantis.ilias.de/view.php?id=42364

Best regards,
@lukas-heinrich

@lukas-heinrich lukas-heinrich force-pushed the lui-refactoring/ilTestPlayerConfirmationModal branch from 01ee1a3 to 2638afb Compare October 23, 2024 13:47
@lukas-heinrich
Copy link
Contributor Author

Hi @kergomard !

I renamed the variable and moved the modals out of the form as described.

With regard to this line of code, I can't tell which solution is the right one. I get the problem that $this->test_id is -1 when I delete an already answered question. After I click on the confirm button in the modal, the script exits with an error. Unfortunately, I can't tell how the program should behave correctly at this point. If desired, I can undo the revert and open a Mantis ticket for the issue.

I have also noticed that the pipeline has failed again. I don't really understand why, any hints are welcome.

Best,
@lukas-heinrich

@kergomard
Copy link
Contributor

Thank you very much @lukas-heinrich !

Now it does work. There is one last thing: The answer feedback modal has a funky background-color.

And: Yes, please revert the change and add an issue. I will look into that.

After these two changes, I will merge.

Best,
@kergomard

grafik

@lukas-heinrich lukas-heinrich force-pushed the lui-refactoring/ilTestPlayerConfirmationModal branch from 2638afb to 2832f8f Compare October 24, 2024 10:52
@lukas-heinrich
Copy link
Contributor Author

Hi @kergomard !

Thank you for your support. I removed the changes and opened a ticket for the issue.

The formatting seems to be due to the fact that the feedback modal is an interruptive modal. If I interpret the documentation correctly, you can also use a roundtrip modal here and the modal is displayed in a better way (see screenshot).
I have this the change in a separate commit so that you can ignore it while merging if you do not want to modify the feedback modal.

image

@kergomard
Copy link
Contributor

Thank you very much @lukas-heinrich .

The idea with the roundtrip modal was the right one, as the text in the interruptive modal is always wrapped in an info-box and this box will have a yellow background. ...but there are more issues here:

  • With the interruptive modal, the "continue" action, doesn't do what it should, i.e. it does not continue.
  • Additionally, right now, if you set the question to be locked when navigating, this doesn't actually happen.
  • What is more, you have some feedback info in the question, that part should have a colored background, and this doesn't happen in the interruptive modal either. For this to work we need to change some CSS and this we need to do through a clean PR for Timon, the maintainer, to review.

All this we are not going to fix in a spell and we also don't need to have this done by tomorrow. Could you maybe see with @thojou when you two would have the time, so we can have a look at this together in a call? Maybe @fhelfer and/or @matheuszych would like to join, too? I think this would be the best way to go forward. I would be available tomorrow after around 11ish or then next week.

Thanks again and best,
@kergomard

@kergomard
Copy link
Contributor

kergomard commented Nov 11, 2024

Hi @lukas-heinrich
When trying to figure out the whole functionality with @dsstrassner , I finally understood that the current behavior actually conforms to the specifications (the case I had found, that from where I stand is still not correct, none the less is as specified: If you set the locking to "Lock Answers After Moving to Next Question" and you have the feedback turned on, clicking away the modal will lead to a state that still lets you change your answer. You have to set locking to "Lock Answers After Feedback or Moving to Next Question" and only then the answer will really be locked, when clicking away the Modal). We sadly cannot get rid of the modal right now, as there are too many states that will be unclear to the user. We need to find a solution for this, but we are not going to find it now for ILIAS 10. Sorry, that I didn't grasp the full picture!

Could you please:

  • See if you can find a solution for the display problems.
  • Remove all camelCase names of properties you introduced.
  • Remove the @throws.
  • Rebase (it is trivial, as far as I can see as the only conflict should be in the test-class that is remove anyway).

Thanks and sorry again,
@kergomard

@lukas-heinrich lukas-heinrich force-pushed the lui-refactoring/ilTestPlayerConfirmationModal branch from 2832f8f to a69f4c8 Compare November 12, 2024 09:38
…nd TypeError "Argument must be of type array|bool,SuperGlobalDropInReplacement given"

The two fixes should only be hotfixes, as we have already completely revised the use of the RequestDataCollector and $_POST and will soon provide them as PR.
@lukas-heinrich lukas-heinrich force-pushed the lui-refactoring/ilTestPlayerConfirmationModal branch from 9532c0d to c1d01bb Compare November 12, 2024 11:53
@lukas-heinrich
Copy link
Contributor Author

Hi @kergomard !

Thank you for the feedback! I have visually revised the code and I found a solution for locking the answer while the dialog is already shown. It should now work as expected, I've tried tests with different combinations of with/without feedback and locking modes.

Best,
@lukas-heinrich

@kergomard kergomard merged commit 6dce340 into ILIAS-eLearning:trunk Nov 20, 2024
1 of 3 checks passed
@kergomard
Copy link
Contributor

kergomard commented Nov 20, 2024

Thank you very much @lukas-heinrich !

I merge this and will remove some of the comments myself to not torture you any longer with this. Merged and picked to trunk.

Best,
@kergomard

@lukas-heinrich lukas-heinrich deleted the lui-refactoring/ilTestPlayerConfirmationModal branch November 20, 2024 07:46
kergomard pushed a commit that referenced this pull request Nov 20, 2024
* UI: Replace legacy modals in ilTestPlayerAbstractGUI

* UI: Replace interruptive feedback modal with roundtrip modal to avoid funky formatting

* refactor: fix property naming, remove unused phpdoc comments

* fix: refinery error when trying to submit an empty numeric question and TypeError "Argument must be of type array|bool,SuperGlobalDropInReplacement given"

The two fixes should only be hotfixes, as we have already completely revised the use of the RequestDataCollector and $_POST and will soon provide them as PR.

* fix: lock answer correctly in mode 'Lock Answers After Moving to Next Question'

---------

Co-authored-by: Lukas Eichenauer <[email protected]>
fhelfer pushed a commit to fhelfer/ILIAS that referenced this pull request Nov 20, 2024
…#8211)

* UI: Replace legacy modals in ilTestPlayerAbstractGUI

* UI: Replace interruptive feedback modal with roundtrip modal to avoid funky formatting

* refactor: fix property naming, remove unused phpdoc comments

* fix: refinery error when trying to submit an empty numeric question and TypeError "Argument must be of type array|bool,SuperGlobalDropInReplacement given"

The two fixes should only be hotfixes, as we have already completely revised the use of the RequestDataCollector and $_POST and will soon provide them as PR.

* fix: lock answer correctly in mode 'Lock Answers After Moving to Next Question'

---------

Co-authored-by: Lukas Eichenauer <[email protected]>
chfsx pushed a commit to srsolutionsag/ILIAS that referenced this pull request Dec 3, 2024
…#8211)

* UI: Replace legacy modals in ilTestPlayerAbstractGUI

* UI: Replace interruptive feedback modal with roundtrip modal to avoid funky formatting

* refactor: fix property naming, remove unused phpdoc comments

* fix: refinery error when trying to submit an empty numeric question and TypeError "Argument must be of type array|bool,SuperGlobalDropInReplacement given"

The two fixes should only be hotfixes, as we have already completely revised the use of the RequestDataCollector and $_POST and will soon provide them as PR.

* fix: lock answer correctly in mode 'Lock Answers After Moving to Next Question'

---------

Co-authored-by: Lukas Eichenauer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants