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

mod_glossary_get_glossaries_by_courses

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9, 3.1
    • Fix Version/s: 3.1
    • Component/s: Glossary, Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create 3 courses and enrol student1 to the first and second course
      2. Add a few glossaries to the first course
        • One visible
        • One hidden
        • One hidden by availability restriction
      3. Add a glossary to the second course
      4. Add a glossary to the third course
      5. As student1 query the WS without passing a course:

        curl http://MOODLE/webservice/rest/server.php \
        -d wsfunction=mod_glossary_get_glossaries_by_courses \
        -d wstoken=TOKEN \
        -d moodlewsrestformat=json \
        -d moodlewssettingfilter=1 | python -m json.tool
        

      6. Make sure ALL the visible/accessible glossaries are returned (should be 2)
      7. Still as student1, query the WS only passing the course ID of the first course:

        curl http://MOODLE/webservice/rest/server.php \
        -d wsfunction=mod_glossary_get_glossaries_by_courses \
        -d wstoken=TOKEN \
        -d moodlewsrestformat=json \
        -d 'courseids[]=COURSEID' \
        -d moodlewssettingfilter=1 | python -m json.tool
        

      8. Make sure only the first glossary from course 1 is returned
      9. Repeat those queries as admin, and confirm that:
        • The first query returns ALL the glossaries
        • The second query returns ALL 3 glossaries of course 1
      Show
      Create 3 courses and enrol student1 to the first and second course Add a few glossaries to the first course One visible One hidden One hidden by availability restriction Add a glossary to the second course Add a glossary to the third course As student1 query the WS without passing a course: curl http://MOODLE/webservice/rest/server.php \ -d wsfunction=mod_glossary_get_glossaries_by_courses \ -d wstoken=TOKEN \ -d moodlewsrestformat=json \ -d moodlewssettingfilter=1 | python -m json.tool Make sure ALL the visible/accessible glossaries are returned (should be 2) Still as student1, query the WS only passing the course ID of the first course: curl http://MOODLE/webservice/rest/server.php \ -d wsfunction=mod_glossary_get_glossaries_by_courses \ -d wstoken=TOKEN \ -d moodlewsrestformat=json \ -d 'courseids[]=COURSEID' \ -d moodlewssettingfilter=1 | python -m json.tool Make sure only the first glossary from course 1 is returned Repeat those queries as admin, and confirm that: The first query returns ALL the glossaries The second query returns ALL 3 glossaries of course 1
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50540-master

      Description

      Retrieve a list of glossaries from several courses

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16