Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2800

Course using a custom format plugin can show the core format instead

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.6.0
    • Component/s: Course formats
    • Labels:
    • Testing Instructions:
      Hide
      1. Install the attached format_topics2 and format_topics3 course formats. format_topics2 contains a mobile plugin where the init function waits for 20 seconds before returning successfully. format_topics3 contains one where the init function waits for 60 seconds. These are contrived examples, but they are designed to simulate slow responses from the server or network.  When loaded successfully each of these formats displays a simple message on its course page, and nothing else.
      2. Create a course called "Topics test" using format_topics as the course format
      3. Create a course called "Topics 2 test" using format_topics2 as the course format
      4. Create a course called "Topics 3 test" using format_topics3 as the course format
      5. Enrol a user on all 3 courses. Ensure the start and end dates for the courses put them in the present.
      6. Log in to the app
      7. As soon as the list of courses loads, click on "Topics 3 test"
        • You should see a loading spinner
      8. Wait for 30 seconds
        • The request should time out, and you will see an error message: "The plugins required by this course could not be loaded correctly. Please restart the app to try again."
      9. Close the error message
      10. Click on "Topics test"
        • The course should load as normal
      11. Go back to the course list
      12. Click on "Topics 2 test"
        • The course should load as normal
      13. Go back to the course list
      14. Click on "Topics 3 test"
        • The error message should be displayed immediately
      15. Restart the app
      16. As soon as the list of courses loads, click on "Topics 2 test"
        • You should see a loading spinner
      17. Wait for 30 seconds
        • The spinner should disappear and the course page should be displayed
      18. Go back to the course list
      19. Click on "Topics test"
        • The course should load as normal
      20. Go back to the course list
      21. Click on "Topics 2 test"
        • The course should load immediately
      22. Go back to the course list
      23. Click on "Topics 3 test"
        • The error message should be displayed immediately
      24. Repeat steps 6-23, but instead of using the links on the main Courses tab, use the list found at Site Home > Available courses
      Show
      Install the attached format_topics2 and format_topics3 course formats. format_topics2 contains a mobile plugin where the init function waits for 20 seconds before returning successfully. format_topics3 contains one where the init function waits for 60 seconds. These are contrived examples, but they are designed to simulate slow responses from the server or network.  When loaded successfully each of these formats displays a simple message on its course page, and nothing else. Create a course called "Topics test" using format_topics as the course format Create a course called "Topics 2 test" using format_topics2 as the course format Create a course called "Topics 3 test" using format_topics3 as the course format Enrol a user on all 3 courses. Ensure the start and end dates for the courses put them in the present. Log in to the app As soon as the list of courses loads, click on "Topics 3 test" You should see a loading spinner Wait for 30 seconds The request should time out, and you will see an error message: "The plugins required by this course could not be loaded correctly. Please restart the app to try again." Close the error message Click on "Topics test" The course should load as normal Go back to the course list Click on "Topics 2 test" The course should load as normal Go back to the course list Click on "Topics 3 test" The error message should be displayed immediately Restart the app As soon as the list of courses loads, click on "Topics 2 test" You should see a loading spinner Wait for 30 seconds The spinner should disappear and the course page should be displayed Go back to the course list Click on "Topics test" The course should load as normal Go back to the course list Click on "Topics 2 test" The course should load immediately Go back to the course list Click on "Topics 3 test" The error message should be displayed immediately Repeat steps 6-23, but instead of using the links on the main Courses tab, use the list found at Site Home > Available courses
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull Master Branch:
      MOBILE-2800_master

      Description

      When doing some testing of the Moodle app with our plugins installed, we found that there were occasions where opening a course using our course format plugin was displaying the course page using the default course format instead. Tracking this down, it appears to be the case that if the web service request for the handler's init function is still in progress, the user can still open the course, but it wont use the correct format. We've seen this frequently on our test environments, but also saw it on a live environment during a period of degraded server performance, so it's definitely a real-world scenario.

      This is a big problem for us; since our custom format is signifiantly different from the core format, if users are able to view our courses using the default format it will be confusing and may expose content the users aren't meant to see.

      Given that the app knows the course's format at this stage (from core_course_get_courses), and that there is a custom handler for this format (from tool_mobile_get_plugins_supporting_mobile), we would like to prevent the user being able to access the course until the format has been initialised.

      Steps to reproduce:

      1. Install the attached format_topics2 course format plugin. This has a very basic mobile delegate that displays "This is a course in Topics 2 format!" in place of the course page. It also has an init function that is artifically delayed to simulate degraded performance.
      2. Create a course in topics2 format, and enrol a user
      3. Log in to the app as the user
      4. As soon as the course list is loaded, click on the course
      5. You will see the default course format

        Attachments

        1. topics2.zip
          14 kB
        2. topics3.zip
          14 kB

          Issue Links

            Activity

              People

              • Assignee:
                marxjohnson Mark Johnson
                Reporter:
                marxjohnson Mark Johnson
                Peer reviewer:
                Dani Palou
                Integrator:
                Juan Leyva
                Tester:
                Dani Palou
                Participants:
                Component watchers:
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jan/19