Commit graph

6 commits

Author SHA1 Message Date
58993cbf51
feat: enhance quiz submit handling and hide back buttons
- Hide all buttons labeled 'Back' on document ready
- Add session key and attempt values logging to assist debugging
- Add AJAX request to finalize quiz attempts upon submission
- Ensure proper navigation or modal closure after quiz submission

These changes improve user experience by providing seamless form submission and debugging support.
2024-07-05 10:10:58 +02:00
b3b9ea55d1
feat(navigation): enhance link handling and fetch redirects
Refactored feedback and quiz link detection to push both types
to the feedbackLinks array. Updated nextContent and openQuizModal
functions to handle "/quiz/" links similarly to "/feedback/" links,
including replacing "view" with "attempt" and ensuring they are
fetched to resolve potential redirects. This async handling ensures
users are directed accurately. Also, consolidated logic for URL manipulation to maintain consistency.
2024-07-04 14:31:27 +02:00
1f00277f60
fix: correct parameter usage for modal detection
Replaced the incorrect parameter check from 'embed' to 'modal' for determining if the quiz is in a modal. This resolves the issue where modals weren't closing as expected when the 'modal' parameter was set in the URL.
2024-07-02 17:58:00 +02:00
ffb3945e19
feat: add embedded quiz modal functionality
Implemented support for triggering and closing an embedded quiz modal based on URL parameters. Refactored the URL parameter retrieval function and added conditional modal handling after AJAX success. Simplified feedback link handling and added modal management functions. This enhancement improves the user experience by enabling embedded quiz handling within modal dialogs
2024-07-02 17:43:06 +02:00
c3dff2394c
fix(url): simplify URL parameter extraction
Refactored URL parameter extraction to use the URL API, enhancing readability and maintainability. Improved reliability by leveraging built-in methods, which are less error-prone than regex-based extraction.
2024-07-02 17:31:28 +02:00
a7368163bf
feat: add scripts for dynamic content loading and embedding
Introduce global.js to streamline script loading and URL parameter parsing, enabling conditional embedding of Moodle elements. When the `embed` parameter is set to `1`, specific interface elements are hidden, and necessary scripts (jQuery and Bootstrap) are loaded to enhance form interactions and AJAX handling.

Add script.js to handle dynamic content presentation within a modal. This includes script loading, modal management, and transition between content items, ensuring seamless navigation and adherence to required fields.

Fosters a clean, embedded viewing experience and improves content presentation and interaction.
2024-07-02 16:20:55 +02:00