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

mod_label_get_labels_by_courses

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 3.3
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a couple of labels resources (including images in the description). Hide one of the labels.
      2. Enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one teacher and one student enrolled in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a couple of CURL REST call simulating a WS client with the teacher and the student user .
        • You need to replace the wstoken, courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids[0]=4&wsfunction=mod_label_get_labels_by_courses&wstoken=12a2a65aeea2a177055e233f9e303218'

          Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output

      5. Confirm that
        • As student you only see the visible label activity and all the settings fields
        • As a teacher you see all the label resources
        • In both cases you retrieve successfully the images included in the label contents (introfiles field)
      Show
      Create a couple of labels resources (including images in the description). Hide one of the labels. Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one teacher and one student enrolled in the course: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the teacher and the student user . You need to replace the wstoken, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids [0] =4&wsfunction=mod_label_get_labels_by_courses&wstoken=12a2a65aeea2a177055e233f9e303218' Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output Confirm that As student you only see the visible label activity and all the settings fields As a teacher you see all the label resources In both cases you retrieve successfully the images included in the label contents (introfiles field)
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50542-master

      Description

      Retrieve a list of labels from several courses

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              ccito Costantino Cito
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              Dan Poltawski
              Tester:
              Marina Glancy
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17