Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70759

core_h5p: add renderer to let personalize styles (backport of MDL-69087)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      "Testing Instructions" copied from https://tracker.moodle.org/browse/MDL-69087

      Setup

      1. Download the theme h5pmod to your local Moodle instance running the following command from the Moodle root folder: 

       

      1. Login as admin.
      2. Run the upgrade process, to install the h5pmod theme.
      3. Access to "Site administration / Appearance / Themes / Theme selector" and choose "H5PMod" as Default theme.
      4. Go to the Content bank.
      5. Upload the attached H5P files to the content bank (interactive-video.h5p and multiple-choice.h5p).

       

      Testing scenario 1: Interactive video - h5p_alter_styles and h5p_alter_scripts (player and editor)

      1. Open the browser console.
      2. Access to the "Interactive video" H5P entry from the content bank. 
      3. Confirm the H5P slider bar is red.
      4. Confirm the playbackRate control button (near the slider), is now green.
      5. Confirm the following text appears in the JS console: "Hello, this is custom.js!".
      6. Go to the first interactive point ("Multiple choice quiz") and open it.
      7. Confirm the "Check" button background is pink (look at the attached interactive_video_view.png).
      8. Click the "Edit" button, to access to the H5P editor.
      9. Confirm the following text appears in the JS console: "Hello, this is customEditor.js!".
      10. Confirm some of the headings, such as "Title" or "Add a video" has pink background  (look at the attached interactive_video_edit.png).

       

      Testing scenario 2: Multiple choice - h5p_alter_semantics (editor) and h5p_alter_filtered_parameters (player)

      1. Open the browser console.
      2. Access to the "Multiple choice" H5P entry from the content bank. 
      3. Confirm the "Generated at xxxxxxxxxxx"  text is displayed below the statement ("Question 1").  Look at the attached multiple_choice_view.png.
      4. Click the "Edit" button, to access to the H5P editor.
      5. Confirm there is no any "Image" field between the Title and the Question (look at the attached multiple_choice_edit.png).

       

      Testing scenario 3: Boost theme

      1. Access to "Site administration / Appearance / Themes / Theme selector" and choose "Boost" as Default theme.
      2. Go to the Content bank.
      3. Open the browser console.
      4. Access to the "Interactive video" H5P entry from the content bank. 
      5. Confirm the H5P slider bar is not red anymore.
      6. Confirm the playbackRate control button (near the slider), is not green anymore.
      7. Confirm the following text doesn't appear in the JS console: "Hello, this is custom.js!".
      8. Go to the first interactive point ("Multiple choice quiz") and open it.
      9. Confirm the "Check" button background is blue.
      10. Click the "Edit" button, to access to the H5P editor.
      11. Confirm the following text doesn't appear in the JS console: "Hello, this is customEditor.js!".
      12. Confirm the headings, such as "Title" or "Add a video", are not pink anymore.
      13. Access to the "Multiple choice" H5P entry from the content bank. 
      14. Confirm the "Generated at xxxxxxxxxxx"  text is not displayed anymore.
      15. Click the "Edit" button, to access to the H5P editor.
      16. Confirm there is an "Image" field between the Title and the Question in Media section.
      Show
      "Testing Instructions" copied from  https://tracker.moodle.org/browse/MDL-69087 Setup Download the theme h5pmod to your local Moodle instance running the following command from the Moodle root folder:  git clone https://github.com/sarjona/h5pmods-moodle-plugin.git  theme/h5pmod   Login as admin. Run the upgrade process, to install the h5pmod theme. Access to "Site administration / Appearance / Themes / Theme selector" and choose "H5PMod" as Default theme. Go to the Content bank. Upload the attached H5P files to the content bank (interactive-video.h5p and multiple-choice.h5p).   Testing scenario 1: Interactive video - h5p_alter_styles and h5p_alter_scripts (player and editor) Open the browser console. Access to the "Interactive video" H5P entry from the content bank.  Confirm  the H5P slider bar is red. Confirm  the playbackRate control button (near the slider), is now green. Confirm  the following text appears in the JS console: "Hello, this is custom.js!". Go to the first interactive point ("Multiple choice quiz") and open it. Confirm  the "Check" button background is pink (look at the attached interactive_video_view.png). Click the "Edit" button, to access to the H5P editor. Confirm  the following text appears in the JS console: "Hello, this is customEditor.js!". Confirm  some of the headings, such as "Title" or "Add a video" has pink background  (look at the attached interactive_video_edit.png).   Testing scenario 2: Multiple choice - h5p_alter_semantics (editor) and h5p_alter_filtered_parameters (player) Open the browser console. Access to the "Multiple choice" H5P entry from the content bank.  Confirm  the "Generated at xxxxxxxxxxx"  text is displayed below the statement ("Question 1").  Look at the attached multiple_choice_view.png. Click the "Edit" button, to access to the H5P editor. Confirm  there is no any "Image" field between the Title and the Question (look at the attached multiple_choice_edit.png).   Testing scenario 3: Boost theme Access to "Site administration / Appearance / Themes / Theme selector" and choose "Boost" as Default theme. Go to the Content bank. Open the browser console. Access to the "Interactive video" H5P entry from the content bank.  Confirm  the H5P slider bar is not red anymore. Confirm  the playbackRate control button (near the slider), is not green anymore. Confirm  the following text doesn't appear in the JS console: "Hello, this is custom.js!". Go to the first interactive point ("Multiple choice quiz") and open it. Confirm  the "Check" button background is blue. Click the "Edit" button, to access to the H5P editor. Confirm  the following text doesn't appear in the JS console: "Hello, this is customEditor.js!". Confirm  the headings, such as "Title" or "Add a video", are not pink anymore. Access to the "Multiple choice" H5P entry from the content bank.  Confirm  the "Generated at xxxxxxxxxxx"  text is not displayed anymore. Click the "Edit" button, to access to the H5P editor. Confirm  there is an "Image" field between the Title and the Question in Media section.
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.9 Branch:

      Description

      When H5P has been added to Moodle 3.9 it has neglected to include the 'hvp_alter_styles' (https://h5p.org/documentation/for-developers/visual-changes and https://h5p.org/node/285646 and https://h5p.org/moodle-customization) functionality that comes with the contributed module (https://moodle.org/plugins/mod_hvp).

      This makes it impossible (as you can't use - or at least I've tried - JS to inject custom styles into an 'iframe' within an 'iframe'). 

      Therefore a theme cannot override anything i.e. 'mod_hvp's renderer and add additional styles so that its not a mix of Moodle and H5P styles.

      PS: Copied from original MDL-69087.

        Attachments

        1. interactive_video_edit.png
          interactive_video_edit.png
          55 kB
        2. interactive_video_view.png
          interactive_video_view.png
          409 kB
        3. interactive-video.h5p
          2.84 MB
        4. MDL-70759.jpg
          MDL-70759.jpg
          48 kB
        5. MDL-70759 (2).jpg
          MDL-70759 (2).jpg
          53 kB
        6. multiple_choice_edit.png
          multiple_choice_edit.png
          27 kB
        7. multiple_choice_view.png
          multiple_choice_view.png
          20 kB
        8. multiple-choice.h5p
          720 kB

          Issue Links

            Activity

              People

              Assignee:
              pead Adrian Perez
              Reporter:
              pead Adrian Perez
              Peer reviewer:
              Amaia Anabitarte
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Bas Brands
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Mar/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h