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

Book hidden chapters are not shown on WS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.7.2
    • Component/s: Book, Web Services
    • Labels:
    • 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". The hidden chapter title and hidden status will now be shown.)
      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 "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")

      Additional

      • Doing a curl request may be an easy alternative -

        curl 'MOODLEINSTANCE/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=COURSEID&wsfunction=core_course_get_contents&wstoken=WEBSERVICETOKEN' --compressed
        

      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". The hidden chapter title and hidden status will now be shown.) 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 "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") Additional Doing a curl request may be an easy alternative - curl 'MOODLEINSTANCE/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=COURSEID&wsfunction=core_course_get_contents&wstoken=WEBSERVICETOKEN' --compressed
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed 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

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                pferre22 Pau Ferrer
                Peer reviewer:
                Dani Palou
                Integrator:
                Adrian Greeve
                Tester:
                Janelle Barcega
                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:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/19

                  Time Tracking

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