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

If only one import format option is available, skip the selection step for the user

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.9
    • Fix Version/s: None
    • Component/s: Other
    • Testing Instructions:
      Hide

      Prerequisites:

      1. Create a course, enrol a teacher and make sure there are at least 2 sections.
      2. The test client is installed at site root (https://github.com/moodle/moodle/compare/master...snake:moodlenet_test_client)
      3. Set the 'DEFAULTSITE', 'DEFAULTCOURSE' and 'DEFAULTSECTION' params in the test client script (at the top). DEFAULTCOURSE should be set to the id of the course you created. DEFAULTSECTION should be set to 1.

      Testing (no course and section)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example with no course and section provided and select 'Link' from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a course selection view
      10. Select a course
      11. Confirm you are presented with a format select view with options to add as a link
      12. Confirm that the following is checked "Create a URL"
      13. Press "Continue"
      14. Confirm the following:
        • You're redirected to course home
        • A URL resource has been created in section 0
        • The name of the URL matches the name on the test client

      Testing (with course and section)

      1. Make sure you're not logged in to Moodle
      2. Visit the test client (YORUSITE/testclient.php)
      3. Find the Cat example including course and section and click the 'Link' option from the select menu
      4. Now click the 'Send to Moodle' button
      5. Confirm you're asked to log in to Moodle
      6. Log in to Moodle as a teacher in a course
      7. Confirm you are presented with a confirmation
      8. Click confirm
      9. Confirm you are presented with a format select view with options to add as a link
      10. Confirm that the following is checked "Create a URL"
      11. Press "Continue"
      12. Confirm the following:
        • You're redirected to course home
        • A URL resource has been created in section 1
        • The name of the URL matches the name on the test client
      Show
      Prerequisites: Create a course, enrol a teacher and make sure there are at least 2 sections. The test client is installed at site root ( https://github.com/moodle/moodle/compare/master...snake:moodlenet_test_client ) Set the 'DEFAULTSITE', 'DEFAULTCOURSE' and 'DEFAULTSECTION' params in the test client script (at the top). DEFAULTCOURSE should be set to the id of the course you created. DEFAULTSECTION should be set to 1. Testing (no course and section) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example with no course and section provided and select 'Link' from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a course selection view Select a course Confirm you are presented with a format select view with options to add as a link Confirm that the following is checked "Create a URL" Press "Continue" Confirm the following: You're redirected to course home A URL resource has been created in section 0 The name of the URL matches the name on the test client Testing (with course and section) Make sure you're not logged in to Moodle Visit the test client (YORUSITE/testclient.php) Find the Cat example including course and section and click the 'Link' option from the select menu Now click the 'Send to Moodle' button Confirm you're asked to log in to Moodle Log in to Moodle as a teacher in a course Confirm you are presented with a confirmation Click confirm Confirm you are presented with a format select view with options to add as a link Confirm that the following is checked "Create a URL" Press "Continue" Confirm the following: You're redirected to course home A URL resource has been created in section 1 The name of the URL matches the name on the test client
    • Affected Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
    • Story Points:
      7
    • Sprint:
      Path to glory

      Description

      This is driven by the link import case, in which there is only one handler - mod_url. In cases like this, rather than have the user select that single option (when there really is no choice to make), we should just skip this step and proceed with the import.

      Currently, the options.php page handles self posts to create/import the resource. This assumes the user submit a form with sesskey on that page.

      The options.php page however, can be reached via either the course select page (select.php - via a link) or the confirmation page (index.php - via a redirect), depending on whether or not the course has been provided. We shouldn't make state changes on these GET requests, though, so we can't just start an import on page load.

      I think we'll need to decide where we want to check the handler count (i.e. where we make the decision about whether to auto-import or not) and how we plan to post to the options.php page from the other two pages.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mathewmay Mathew May
              Reporter:
              jaked Jake Dallimore
              Peer reviewer:
              Peter Dias
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 37 minutes
                  2d 37m