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

Ajax to search and populate the "Link course" element in the Meta enrollment method.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test 1: (Javascript enabled)
      1 - Make sure meta link enrollment is enabled.
      2 - Create a set of courses and note down their full name, short name, and id number.
      3 - Open one of the created courses and from the Administration block go to Users > Enrolment methods.
      4 - Select add method "Course meta link"
      5 - A textfield must be visible with the label "Search". Use this textfield to search for the courses created in step 2.
      6 - As you type, a multi select box must appear, below the search textfield, populated with the search result.
      7 - The current course must not be found in the multi select box.
      8 - User must be able select more than one course as "Link Courses".
      9 - When clicking the add method button without selecting a course from the multi select box, it must display an error message "the field is required".
      10 - Selecting more than one course and clicking the add method button must create enrolment record for each of the selected courses.

      Test 2: (Javascript disabled)
      1 - Repeat the same steps from 1-5 in Test 1
      2 - A button with label "Go" must be visible to the right of the search textfield.
      3 - Enter some keywords to search for the courses created in step 2 (Test 1), and then click the button "Go".
      4 - The page must reload and populate the multi select box with the search result.
      5 - Everything must behave as in Test 1, with exception that the page reloads to populate the multi select box.
      6 - On the page refresh the form must not be submitted.

      Show
      Test 1: (Javascript enabled) 1 - Make sure meta link enrollment is enabled. 2 - Create a set of courses and note down their full name, short name, and id number. 3 - Open one of the created courses and from the Administration block go to Users > Enrolment methods. 4 - Select add method "Course meta link" 5 - A textfield must be visible with the label "Search". Use this textfield to search for the courses created in step 2. 6 - As you type, a multi select box must appear, below the search textfield, populated with the search result. 7 - The current course must not be found in the multi select box. 8 - User must be able select more than one course as "Link Courses". 9 - When clicking the add method button without selecting a course from the multi select box, it must display an error message "the field is required". 10 - Selecting more than one course and clicking the add method button must create enrolment record for each of the selected courses. Test 2: (Javascript disabled) 1 - Repeat the same steps from 1-5 in Test 1 2 - A button with label "Go" must be visible to the right of the search textfield. 3 - Enter some keywords to search for the courses created in step 2 (Test 1), and then click the button "Go". 4 - The page must reload and populate the multi select box with the search result. 5 - Everything must behave as in Test 1, with exception that the page reloads to populate the multi select box. 6 - On the page refresh the form must not be submitted.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-40270-master
    • Sprint:
      Team A Sprint 1, Team '; drop tables Sprint 2, Team ';drop tables Sprint 3
    • Issue size:
      Large

      Description

      This is an improvement to the add instance form for the meta link enrolment plugin.
      I have created a new form element called "ajaxselector". It can be used to create a form element similar to the existing element "searchableselector", with exception that it uses ajax request to search and populate the select element.
      This element also works if Javascript is disabled.

        Attachments

        1. adding the same course.png
          adding the same course.png
          39 kB
        2. RLT.png
          RLT.png
          36 kB
        3. unspecified error.png
          unspecified error.png
          37 kB

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: