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

Book hidden chapters are not shown on WS

XMLWordPrintable

    • MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-65653-master
    • 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

      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.

            jleyva Juan Leyva
            pferre22 Pau Ferrer
            Dani Palou Dani Palou
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.