feat: expose hide_from_toc field in course blocks - #33955
Conversation
|
Thanks for the pull request, @BryanttV! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
hide_from_toc field in course blockshide_from_toc field in course blocks
60f9b79 to
3a0ef1d
Compare
3a0ef1d to
a3c8e7d
Compare
a3c8e7d to
247909b
Compare
There was a problem hiding this comment.
why is this change necessary?
There was a problem hiding this comment.
If the field is not added to the requested_fields list, the field is returned null
247909b to
7fb8abb
Compare
mariajgrimaldi
left a comment
There was a problem hiding this comment.
I tested this in my local environment, and it's working as you described in the cover letter! Thank you.
|
@BryanttV 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
This PR exposes the
hide_from_tocfield for course blocks (sections, sequences...) so it's visible as part of the course metadata.This change is made to show instructors a message in the course outline for the hidden sections and their children. However, it can be used by any other client to obtain content visibility information.
Supporting information
These changes are part of the effort made to implement Feature Enhancement Proposal: Hide Sections from Course Outline
What Changed?
/api/course_home/outline/{course-id}
This endpoint was updated to return the
hide_from_tocfield in the blocks of the course. The following is an example of the response:{ ... "course_blocks": { "blocks": { "block-v1:eduNEXT+HFT+Demo+type@course+block@course": { "children": [ "block-v1:eduNEXT+HFT+Demo+type@chapter+block@1d110f659c154377b6f764189cc7fa35" ], "complete": true, "description": null, "display_name": "Hide From TOC Course", "due": null, "effort_activities": 0, "effort_time": 1, "icon": null, "id": "block-v1:eduNEXT+HFT+Demo+type@course+block@course", "lms_web_url": "http://local.overhang.io:8000/courses/course-v1:eduNEXT+HFT+Demo/jump_to/block-v1:eduNEXT+HFT+Demo+type@course+block@course", "resume_block": true, "type": "course", "has_scheduled_content": null, "hide_from_toc": false }, "block-v1:eduNEXT+HFT+Demo+type@chapter+block@1d110f659c154377b6f764189cc7fa35": { "children": [ "block-v1:eduNEXT+HFT+Demo+type@sequential+block@4fbfd9bb42284431af028c812cc6bbd5" ], "complete": true, "description": null, "display_name": "Section", "due": null, "effort_activities": 0, "effort_time": 1, "icon": null, "id": "block-v1:eduNEXT+HFT+Demo+type@chapter+block@1d110f659c154377b6f764189cc7fa35", "lms_web_url": "http://local.overhang.io:8000/courses/course-v1:eduNEXT+HFT+Demo/jump_to/block-v1:eduNEXT+HFT+Demo+type@chapter+block@1d110f659c154377b6f764189cc7fa35", "resume_block": true, "type":" chapter", "has_scheduled_content": null, "hide_from_toc": false }, "block-v1:eduNEXT+HFT+Demo+type@sequential+block@4fbfd9bb42284431af028c812cc6bbd5": { "children": [ ], "complete": true, "description": null, "display_name": "Subsection", "due": null, "effort_activities": 0, "effort_time": 1, "icon": null, "id": "block-v1:eduNEXT+HFT+Demo+type@sequential+block@4fbfd9bb42284431af028c812cc6bbd5", "lms_web_url": "http://local.overhang.io:8000/courses/course-v1:eduNEXT+HFT+Demo/jump_to/block-v1:eduNEXT+HFT+Demo+type@sequential+block@4fbfd9bb42284431af028c812cc6bbd5", "resume_block": true, "type": "sequential", "has_scheduled_content": null, "hide_from_toc": false } } } ... }Testing instructions
Move into this branch
Create your course with sections and subsections.
Using CURL you can test the endpoint. Replace the value of the variables with your values as appropriate:
Another option is to go to the course outline in the URL:
{mfe-domain}/learning/course/{course-id}/home. Right-click > Inspect > Network. Select the endpoint request and review the response.In all course blocks the
hide_from_tocfield should be set tofalseDeadline
This effort is part of the Spanish consortium project, so it'd be ideal to merge this before the end of the project.