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

mod_glossary_get_glossaries_by_courses

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-50540-master
    • 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

      Retrieve a list of glossaries from several courses

            fred Frédéric Massart
            ccito Costantino Cito
            Juan Leyva Juan Leyva
            David Monllaó David Monllaó
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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