Commit graph

25 commits

Author SHA1 Message Date
33f55824d8
fix: ensure conditional loading of jQuery & Bootstrap
Enhanced global.js and script.js to conditionally load jQuery and Bootstrap only if they are not already present. This change improves loading efficiency and reduces redundant script execution.

Additionally, fixed a bug in renderer.php by removing duplicate Bootstrap loading, which also reduces external dependency.

A new .gitignore file was added to ignore backup files with a .bak extension, helping to keep the repository clean.

Ensured error logging only displays error messages for better clarity.
2024-08-05 12:10:33 +02:00
f61fc7b852
fix: remove redundant URL parameter from embedded script
Removed the redundant 'v=3' parameter from the script URL to ensure compatibility and potentially improve load performance. The parameter was unnecessary for the script versioning in this context.
2024-07-08 14:19:55 +02:00
ad89a284fc
refactor(script.js): remove unused modal resize code
Eliminated unnecessary code handling modal content resizing. This cleanup simplifies the modal setup and avoids redundant calculations, improving code maintainability.
2024-07-08 12:57:59 +02:00
51c0f2e058
fix: remove redundant require_login call in view_content.php
Removed an unnecessary require_login call from the view_content.php file. The user is already authenticated earlier in the workflow, ensuring there is no duplicate authentication process. This change streamlines the code and improves efficiency by avoiding redundant checks.
2024-07-08 12:52:42 +02:00
85c509e567
refactor(modal): extract iframe URL setting to reusable function
Created openUrlInQuizModal function to centralize and reuse the logic
for setting the iframe's src attribute and displaying the modal.
This change improves code maintainability by reducing redundancy.
2024-07-08 10:28:46 +02:00
762edec903
refactor: remove deprecated event observers and modal HTML
Cleanup of obsolete event observer functions and modal HTML code. This streamlines the codebase by eliminating unused PHP event observer definitions and redundant embedded modal HTML in JS file. Enhances maintainability and reduces potential overhead. No functionality should be directly impacted.
2024-07-05 12:44:26 +02:00
b58487ebb8
fix: always load JS for exp360 events
Simplified the event observer function to always inject the exp360 global JavaScript on relevant pages, removing the conditional check for exp360 instances within the course. This ensures consistent loading behavior and reduces database queries.
2024-07-05 12:36:55 +02:00
07632fa961
fix(renderer): remove accidental characters before PHP tag
Removed extraneous 'sws' characters before the opening PHP tag in the renderer file. This resolves potential syntax errors and ensures proper PHP code execution.
2024-07-05 12:32:43 +02:00
5b4a28b00d
fix: adjust script order and import Bootstrap
Reordered modal and script content to ensure proper functionality and added Bootstrap's JS bundle for enhanced UI components. Updated URL to use a CDN for better performance and integrity checks.
2024-07-05 12:31:26 +02:00
d41c70e50e
feat(assets): add new icon images in GIF and PNG formats
Added new icon images to the project to enhance visual representation. The addition includes both GIF and PNG formats to cater to different use cases and compatibility requirements.
2024-07-05 12:25:07 +02:00
131f84f5ef
feat: add renderer for dynamic modal and activity scripts
Introduced a new renderer class to manage the rendering of activity scripts
and modals in the exp360 module. Renderer ensures modals are loaded only
once, enhancing performance. Modified lib.php to utilize the new renderer
for appending necessary scripts and modal content to the course module info.
2024-07-05 12:18:34 +02:00
b4c651b771
chore: bump version to 2024070504
Incremented the module version to 2024070504 to signal new updates or improvements. Ensures compatibility and proper version tracking.
2024-07-05 12:03:35 +02:00
321c470a23
feat: add event observer for course viewing
Introduces an event observer to inject JavaScript into courses containing the exp360 activity when the course is viewed.

The newly created `db/events.php` initializes event observers, while updates to `lib.php` define the event observer callback and the observer list. Enhancements to `global.js` include modal handling logic for improved UI interaction.

This aids in dynamically loading required scripts, enhancing user experience in courses with exp360 activities.
2024-07-05 12:02:11 +02:00
3a08f0e564
feat: Add dynamic script integration for exp360 module
Introduced a dynamic content management function to enhance the exp360 module's capabilities. This function injects necessary scripts dynamically, improving the modularity and maintainability of the exp360 activities. By adding Bootstrap dependencies and specific scripts directly into the content management info, the changes ensure that the module leverages required resources efficiently.
2024-07-05 11:58:14 +02:00
3247092e59
feat: add intro fields to exp360 module
Added 'intro' and 'introformat' fields to the exp360 module for enhanced activity descriptions. Updated database schema and upgrade script to accommodate new fields. Modified add and update instance functions and the form to manage intro fields. Bumped module version to 2024070503.
2024-07-05 11:38:10 +02:00
688e44ef2b
feat(lang): add new language strings for EXP360 activity
Added 'Activity Name' and 'Content ID' strings to improve clarity and usability for users configuring EXP360 activities. Updated plugin version to ensure the changes are recognized. This enhances the user interface and ensures the correct version tracking.
2024-07-05 11:33:09 +02:00
87e610d313
feat: add basic structure for exp360 module
Introduced the foundational elements for the exp360 module, including:
- Added access control capabilities
- Implemented index page for course instances
- Created add, update, and delete functions for instances
- Updated plugin version

These changes establish the module's core functionality and prepare it for further development and integration.
2024-07-05 11:30:55 +02:00
3e5b36bc14
feat(db): add comments to exp360 table
Added comments to the exp360 table definition in install.xml
to clarify the purpose of the table and its fields. This
provides better documentation and enhances the maintainability
of the database schema.
2024-07-05 11:25:01 +02:00
5b45d9ea82
feat(exp360): add EXP360 module for embedding 360° content
Introduce the EXP360 activity module to embed interactive 360° content
in Moodle. This update includes:

- Database schema for the exp360 table.
- Language support for the module.
- Frontend form to create exp360 activities.
- Script to handle 360° content embedding within a modal.
- Two new PHP scripts to display and serve 360° content.
- Version and plugin initialization.

These changes allow users to seamlessly integrate and interact with
360° content within Moodle courses.
2024-07-05 11:13:58 +02:00
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