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

Display fake blocks on embedded layout

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • master-MDL-68792_v3
    • Hide

      Installing the environment:

      1. Install two Moodle instances:
        1. The consumer
        2. The provider (this is the instance with the patch that we are testing).

      Setting up activities to be published

      1. Log in as an admin to the provider instance.
      2. Navigate to "Site administration > Plugins > Enrolments > Manage enrol plugins" and enable "Publish as LTI tool" enrolment plugin.
      3. Navigate to "Site administration > Plugins > Authentication > Manage authentication" and enable LTI authentication plugin.
      4. Create a course on the provider site.
      5. Turn editing on.
      6. Add a block and select "Activities"
      7. Configure the Activities block and set "Display on page types" to "Any page" then save the changes.
      8. Go back to the course homepage.
      9. Create a quiz, add some questions to the quiz.
      10. Create a lesson. On its settings, set "Display menu" to Yes.
      11. Create a book, add a couple of chapters to the book.
      12. Go back to the course homepage.
      13. Open the cog menu and click "Published as LTI tools".
      14. Publish the quiz and take note of its "Registration URL".
      15. Publish the lesson and take note of its "Registration URL".
      16. Publish the book and take note of its "Registration URL".

      Setting up external tools in the consumer site.

      1. On the consumer site, log in as an admin.
      2. Go to "Site administration / Plugins / Activity modules / External tool / Manage tools"
      3. On the Tool URL, paste the Registration URL of the quiz. Press "Add Legacy LTI.
      4. Make sure you get "Successful registration". Then press "Continue"
      5. Activate the tool when prompted by pressing "Yes"
      6. Do the same steps for the lesson and book activities from the provider site.

      Testing quizzes published via LTI

      1. Log in as an admin to the consumer instance.
      2. Create a course.
      3. Turn editing on and press "Add an activity or resource"
      4. Add an external tool.
      5. Set an activity name and set "Preconfigured tool" to the published quiz from the provider instance.
      6. Access the quiz LTI activity and confirm that it can be opened.
      7. Confirm that the standard layout is used. You'll see the provider site's navbar, navigation drawer and breadcrumbs.
      8. Preview the quiz.
      9. Confirm that the following blocks are displayed:
        1. The quiz navigation fake block
        2. The activities block.
      10. Edit the quiz LTI activity and set Custom parameters to "force_embed=1".
      11. Access the quiz LTI activity as an admin.
      12. Confirm that the embedded layout is used. The provider's navbar and breadcrumbs won't be displayed. You'll basically only see content related to the quiz.
      13. Confirm that the Activities block is not visible.
      14. Preview the quiz.
      15. Confirm that the Activities block is not visible.
      16. Confirm that Quiz navigation fake block is displayed.
      17. Edit the quiz LTI activity and clear the "Custom parameters" field.
      18. Log in as a student in the course in the consumer site.
      19. Access the quiz LTI activity
      20. Confirm that the embedded layout is used.
      21. Attempt the quiz.
      22. Confirm that Quiz navigation fake block is displayed.
      23. Confirm that the Activities block is not displayed.

      Testing lessons published via LTI

      1. Log in as a teacher or admin to the consumer site. Go to the course that was created in the previous section.
      2. Turn editing on and press "Add an activity or resource"
      3. Add an external tool.
      4. Set an activity name and set "Preconfigured tool" to the published lesson from the provider instance.
      5. Access the lesson LTI activity.
      6. Confirm that it can be opened.
      7. Confirm that the standard layout is used.
      8. Confirm that the following blocks are displayed:
        1. The lesson menu fake block
        2. The activities block.
      9. Log in as a student to the consumer instance.
      10. Access the lesson LTI activity.
      11. Confirm that the embedded layout is used.
      12. Confirm that Lesson menu is displayed.
      13. Confirm that the Activities block is not displayed.

      Testing books published via LTI

      1. Log in as a teacher or admin to the consumer site. Go to the course that was created in the previous section.
      2. Turn editing on and press "Add an activity or resource"
      3. Add an external tool.
      4. Set an activity name and set "Preconfigured tool" to the published book from the provider instance.
      5. Access the book LTI activity.
      6. Confirm that it can be opened.
      7. Confirm that the standard layout is used.
      8. Confirm that the following blocks are displayed:
        1. The "Table of contents" fake block
        2. The Activities block
      9. Log in as a student to the consumer instance.
      10. Access the lesson LTI activity.
      11. Confirm that the embedded layout is used.
      12. Confirm that the "Table of contents" fake block is displayed.
      13. Confirm that the Activities block is not displayed.
      Show
      Installing the environment: Install two Moodle instances: The consumer The provider (this is the instance with the patch that we are testing). Setting up activities to be published Log in as an admin to the provider instance. Navigate to " Site administration > Plugins > Enrolments > Manage enrol plugins " and enable "Publish as LTI tool" enrolment plugin. Navigate to " Site administration > Plugins > Authentication > Manage authentication " and enable LTI authentication plugin. Create a course on the provider site. Turn editing on. Add a block and select " Activities " Configure the Activities block and set " Display on page types " to " Any page " then save the changes. Go back to the course homepage. Create a quiz, add some questions to the quiz. Create a lesson. On its settings, set "Display menu" to Yes. Create a book, add a couple of chapters to the book. Go back to the course homepage. Open the cog menu and click "Published as LTI tools". Publish the quiz and take note of its " Registration URL ". Publish the lesson and take note of its " Registration URL ". Publish the book and take note of its " Registration URL ". Setting up external tools in the consumer site. On the consumer site, log in as an admin. Go to " Site administration / Plugins / Activity modules / External tool / Manage tools " On the Tool URL, paste the Registration URL of the quiz. Press " Add Legacy LTI . Make sure you get " Successful registration ". Then press " Continue " Activate the tool when prompted by pressing " Yes " Do the same steps for the lesson and book activities from the provider site. Testing quizzes published via LTI Log in as an admin to the consumer instance. Create a course. Turn editing on and press " Add an activity or resource " Add an external tool. Set an activity name and set " Preconfigured tool " to the published quiz from the provider instance. Access the quiz LTI activity and confirm that it can be opened. Confirm that the standard layout is used. You'll see the provider site's navbar, navigation drawer and breadcrumbs. Preview the quiz. Confirm that the following blocks are displayed: The quiz navigation fake block The activities block. Edit the quiz LTI activity and set Custom parameters to "force_embed=1". Access the quiz LTI activity as an admin. Confirm that the embedded layout is used. The provider's navbar and breadcrumbs won't be displayed. You'll basically only see content related to the quiz. Confirm that the Activities block is not visible. Preview the quiz. Confirm that the Activities block is not visible. Confirm that Quiz navigation fake block is displayed. Edit the quiz LTI activity and clear the " Custom parameters " field. Log in as a student in the course in the consumer site. Access the quiz LTI activity Confirm that the embedded layout is used. Attempt the quiz. Confirm that Quiz navigation fake block is displayed. Confirm that the Activities block is not displayed. Testing lessons published via LTI Log in as a teacher or admin to the consumer site. Go to the course that was created in the previous section. Turn editing on and press " Add an activity or resource " Add an external tool. Set an activity name and set " Preconfigured tool " to the published lesson from the provider instance. Access the lesson LTI activity. Confirm that it can be opened. Confirm that the standard layout is used. Confirm that the following blocks are displayed: The lesson menu fake block The activities block. Log in as a student to the consumer instance. Access the lesson LTI activity. Confirm that the embedded layout is used. Confirm that Lesson menu is displayed. Confirm that the Activities block is not displayed. Testing books published via LTI Log in as a teacher or admin to the consumer site. Go to the course that was created in the previous section. Turn editing on and press " Add an activity or resource " Add an external tool. Set an activity name and set " Preconfigured tool " to the published book from the provider instance. Access the book LTI activity. Confirm that it can be opened. Confirm that the standard layout is used. Confirm that the following blocks are displayed: The "Table of contents" fake block The Activities block Log in as a student to the consumer instance. Access the lesson LTI activity. Confirm that the embedded layout is used. Confirm that the "Table of contents" fake block is displayed. Confirm that the Activities block is not displayed.

      When LTI is configured to publish a Quiz activity, students attempting external quiz can't see quiz navigations block and timer.

      Forum discussion: https://moodle.org/mod/forum/discuss.php?d=371681

       

      Steps to replicate:

      1. You need two Moodle 3.9 sites.
      2. On SITE A, enable LTI enrolment and authentication.
      3. Create a course, create a quiz.
      4. In course admin click "Published as LTI tools".
      5. Publish the quiz.
      6. Copy Launch URL and Secret.
      7. On SITE B, create a course, enrol a student.
      8. Add an external tool, set Launch URL and Secret.
      9. Login as a student.
      10. Select the external tool.
      11. Confirm, that the page does not include the quiz navigation block.

       

      Page layout is forced to be embedded here
      https://github.com/moodle/moodle/blob/1afe68f3820b2b5996aa313357e3ddd3d5890192/enrol/lti/classes/tool_provider.php#L306-L316
      and here
      https://github.com/moodle/moodle/blob/1afe68f3820b2b5996aa313357e3ddd3d5890192/lib/pagelib.php#L1177-L1183

       

        1. scroll.png
          scroll.png
          904 kB
        2. h5p.png
          h5p.png
          855 kB
        3. image-2020-08-14-17-13-29-907.png
          image-2020-08-14-17-13-29-907.png
          25 kB
        4. image-2020-08-14-17-14-31-633.png
          image-2020-08-14-17-14-31-633.png
          348 kB
        5. image-2020-08-14-17-17-30-110.png
          image-2020-08-14-17-17-30-110.png
          332 kB
        6. Screenshot_5.jpg
          Screenshot_5.jpg
          51 kB
        7. Screenshot_1.jpg
          Screenshot_1.jpg
          41 kB
        8. Screenshot_2.jpg
          Screenshot_2.jpg
          41 kB
        9. Screenshot_3.jpg
          Screenshot_3.jpg
          49 kB
        10. Screenshot_4.jpg
          Screenshot_4.jpg
          43 kB

            mikhailgolenkov Misha Golenkov
            mikhailgolenkov Misha Golenkov
            Bas Brands Bas Brands
            Jun Pataleta Jun Pataleta
            Janelle Barcega Janelle Barcega
            Votes:
            4 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 45 minutes
                1d 45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.