Commit graph

39 commits

Author SHA1 Message Date
6cbe774d79
feat: add activity completion logic for courses
Introduced a new script to set activity completion for a user in a course. Ensures completion is enabled for the course module before marking activities as completed. This enhancement streamlines tracking of user progress within courses.
2024-09-23 10:02:17 +02:00
6ff596c5e1
fix: correct logic for edit mode check
Reversed the condition checking for edit mode to ensure proper functionality. Previously, the code assumed edit mode when it wasn't, causing unintended behavior. This fix addresses incorrect section handling when the inplace editable class is present.
2024-09-23 09:48:12 +02:00
8c1e8c49eb
fix: conditionally hide sections in edit mode only
Wrapped the logic to hide sections in an edit mode check, ensuring it only runs when the page is in edit mode. This prevents unintended hiding of sections during normal view, improving the user experience.
2024-09-23 09:46:47 +02:00
a1185aba77
fix: correct section class for consistency
Updated class selector from '.section' to '.course-section' to ensure consistency with the rest of the codebase and avoid potential conflicts or mismatches. This change helps in maintaining uniformity and readability in the script.
2024-09-23 09:25:18 +02:00
1abae9bd7a
fix(scripts): avoid redundant visibility settings in loop
Refactored section visibility handling to prevent unnecessary CSS updates by ensuring that only sections after the first matched section are hidden. This improves performance and prevents potential flickering issues.
2024-09-23 09:22:41 +02:00
0b5c85273d
fix: prevent unintended section display during script checks
Introduced a variable to target all ".section" elements before
iterating through them to hide subsequent sections correctly if
they contain certain scripts. This ensures smoother UI operations
by preventing unintended section visibility.
2024-09-23 09:20:08 +02:00
bf9cc7445b
feat: hide subsequent sections based on activity script presence
Enhance the visibility control of sections by adding a check for
'script[data-activity-id]'. If a section contains such a script,
all following sections will be hidden to improve user focus and
interface clarity.
2024-09-23 09:17:45 +02:00
dba761ac70
fix: use formatted course module name in activity script
Updated the rendering logic to use the formatted course module name instead of the plain name when generating the activity script. This ensures consistency in presentation and improves readability.

Fixes issues with name formatting in displayed activities.
2024-09-23 09:08:09 +02:00
a40ffdf41f
feat: Include activity name in rendered script tag
Updated the `render_activity` method to accept an additional parameter for activity name and include it in the script tag data attributes. This allows for more descriptive data handling on the client side. Adjusted calls to this method to provide the necessary activity name. Improved readability of the code by adhering to standard formatting practices.
2024-09-23 09:05:20 +02:00
4ac9f46986
fix(script): properly load jQuery and Bootstrap in sequence
Ensures jQuery is fully loaded before attempting to load Bootstrap, improving the reliability of modal handling and iframe interactions. This change corrects potential race conditions where Bootstrap functions might be accessed before jQuery is available. This improves the stability and predictability of modal displays and iframe content interactions.
2024-09-23 09:00:01 +02:00
110ac67686
feat: add function to navigate to course by ID
Introduce goToCourse function that updates the window location
to navigate to a course view page using a given ID. This function
is now accessible via window.top as goToCourse, improving navigation
throughout the application and promoting code reuse.
2024-09-23 08:50:58 +02:00
17e8bc0c18
feat: add dynamic activity name to content button
Modified script.js to dynamically include the activity name in the content button text using a data attribute. Updated view.php to pass the activity name to the script for better contextual display of the content button.

This enhancement improves the user experience by making the button's label more meaningful and relevant.
2024-09-23 08:43:57 +02:00
476606f22f
feat: handle iframe navigation for course pages
Added an event handler to detect when the iframe loads a course page and redirect the parent window to the course URL. This ensures users are taken directly to course content, enhancing navigation and user experience.
2024-09-23 08:28:35 +02:00
85d50e19b8
refactor: simplify script loading and enhance quiz modal
Removed jQuery and Bootstrap loading logic in favor of directly waiting for Bootstrap, reducing complexity and potential errors. Introduced a flag to manage sequential opening of quiz modals, improving UX by ensuring transitions to subsequent quizzes occur seamlessly.
2024-09-06 11:09:44 +02:00
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