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

Book hidden chapters are not shown on WS

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Log in as Admin.
      2. Create a Course.
      3. Enrol a Student in the Course.
      4. Enrol a Teacher in the Course.
      5. Create a Book activity in the Course.
      6. Go to the Book.
      7. Create several Chapters in the Book.
      8. Set one of the Chapters as hidden.
      9. Enable web services (Site administration > Advanced features).
      10. Create a tokens for the Student and the Teacher which are enrolled in the Book's course (Site administration > Plugins > Web services > Manage tokens).
      11. Call the core_course_get_contents web service as the Student (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=core_course_get_contents&wstoken=XXXX&courseid=COURSEID) through a HTTP client for testing web services (ex. Postman) where:
        wstoken => the token created for the Student; 
        courseid => the course id;
        • make sure the returned data does not include the hidden chapter.
        • make sure "ishidden" attribute is present in the returned data for the Book chapter content ("ishidden" == false for each returned chapter).
      1. Call the core_course_get_contents web service as the Teacher (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=core_course_get_contents&wstoken=XXXX&courseid=COURSEID) through a HTTP client for testing web services (ex. Postman) where:
        wstoken => the token created for the Teacher; 
        courseid => the course id;
        • make sure the returned data does include the hidden chapter.
        • make sure "ishidden" attribute is present in the returned data for the Book chapter content ("ishidden" == true for the hidden returned chapter,  "ishidden" == false for the rest of the returned chapters).
      Show
      Log in as Admin. Create a Course. Enrol a Student in the Course. Enrol a Teacher in the Course. Create a Book activity in the Course. Go to the Book. Create several Chapters in the Book. Set one of the Chapters as hidden. Enable web services (Site administration > Advanced features). Create a tokens for the Student and the Teacher which are enrolled in the Book's course (Site administration > Plugins > Web services > Manage tokens). Call the core_course_get_contents web service as the Student (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=core_course_get_contents&wstoken=XXXX&courseid=COURSEID) through a HTTP client for testing web services (ex. Postman) where: wstoken => the token created for the Student;  courseid => the course id; make sure the returned data does not include the hidden chapter. make sure "ishidden" attribute is present in the returned data for the Book chapter content ("ishidden" == false for each returned chapter). Call the core_course_get_contents web service as the Teacher (MOODLEINSTANCE/webservice/rest/server.php?wsfunction=core_course_get_contents&wstoken=XXXX&courseid=COURSEID) through a HTTP client for testing web services (ex. Postman) where: wstoken => the token created for the Teacher;  courseid => the course id; make sure the returned data does include the hidden chapter. make sure "ishidden" attribute is present in the returned data for the Book chapter content ("ishidden" == true for the hidden returned chapter,   "ishidden" == false for the rest of the returned chapters ).
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65653-master

      Description

      When a teacher uses core_course_get_contents to reach the contents of the book. The structure does not shown the hidden chapters.

      Also we need to know if a chapter is hidden to style it in the app, so it will affect app too.

        Attachments

          Activity

            People

            • Assignee:
              Geshoski Mihail Geshoski
              Reporter:
              pferre22 Pau Ferrer
              Peer reviewer:
              Juan Leyva
              Participants:
              Component watchers:
              David Jones, Adrian Greeve, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h