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 "hidden" attribute is present in the returned data for the Book chapter content (it will be part of the content field of the entry for the file with filename equal to "structure")
      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 (it will be part of the content field of the entry for the file with filename equal to "structure")
      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 "hidden" attribute is present in the returned data for the Book chapter content (it will be part of the content field of the entry for the file with filename equal to "structure") 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 (it will be part of the content field of the entry for the file with filename equal to "structure")
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • 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:
              jleyva Juan Leyva
              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:
              2 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 - 3 hours, 1 minute
                3h 1m