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

Return more fields for students in mod_data_get_databases_by_courses

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create two database activities. One with the default settings, another one with the default settings but not visible.
      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%5B0%5D=20&wsfunction=mod_data_get_databases_by_courses&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      5. Confirm that
        • As student you don't see the non-visible database but you see the other one. You can see the all the activity fields defined in mod/data/db/install.xml (table data) except: 'scale', 'assessed', 'assesstimestart', 'assesstimefinish', 'editany', 'notification','timemodified'
        • As a teacher you see all the databases including all the fields that you couldn't see as student.
      Show
      Create two database activities. One with the default settings, another one with the default settings but not visible. 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%5B0%5D=20&wsfunction=mod_data_get_databases_by_courses&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that As student you don't see the non-visible database but you see the other one. You can see the all the activity fields defined in mod/data/db/install.xml (table data) except: 'scale', 'assessed', 'assesstimestart', 'assesstimefinish', 'editany', 'notification','timemodified' As a teacher you see all the databases including all the fields that you couldn't see as student.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57914-master

      Description

      Right now only a very limited number of fields is returned for users, we should return more viewable fields like the template.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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