add option for users to make posts/replies that are only visible to instructors#36
Open
pebble-fish wants to merge 6 commits into
Open
add option for users to make posts/replies that are only visible to instructors#36pebble-fish wants to merge 6 commits into
pebble-fish wants to merge 6 commits into
Conversation
- Introduced visibilityMode and anonymous fields in post creation, editing, and retrieval processes. - Updated topic creation and retrieval to include visibility settings. - Implemented visibility checks to enforce access control based on user roles and visibility settings. - Enhanced API and frontend components to support visibility mode selection and display.
- Introduced 'anonymous' field with a default value of 'false' in the PostObject schema. - This update enhances the post creation and editing processes by allowing the specification of anonymity for posts.
- Simplified the logic for handling deleted posts by removing the selfPost check for non-admin users. - Ensured that only admin or moderator privileges can bypass visibility restrictions for deleted posts.
568cats
requested changes
Feb 27, 2026
568cats
left a comment
There was a problem hiding this comment.
Could you add a description of the feature/changes made as well as a way to test the feature in the body of the PR?
- Added a hidden checkbox for anonymous posting in the quick reply component. - Updated JavaScript logic to synchronize the checkbox state with the visibility selection. - Enhanced visibility mode handling to account for anonymous posts in various components, ensuring consistent behavior across the application.
This was
linked to
issues
Feb 28, 2026
Open
Open
Author
updated, i will add the info on how to test later |
** This was written by Amy, I'm committing it for internet/device reasons
sliang-code
approved these changes
Mar 1, 2026
sliang-code
left a comment
There was a problem hiding this comment.
All code are good and it might be better with some additional comments especially in new file like visibility.js.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
##User Story##
Students may want to ask questions about a course to instructors, but need to show instructors parts of their buggy code. For many CS classes, it is not allowed to show any part of your code to other students, even if unintentionally. Without the option to make posts visible only to instructors, they risk an AIV or their question going unanswered.
##Summary of PR Additions##
a. The dropdown has three options: Post Publicly (default), Post Anonymously, and Post to Instructors.
b. These changes were applied in QUick Reply and New Topic.
c. the selection is stored in variable
visibilityModepublic | anonymous | instructors), and the previousanonymousvariable (to ensure the backend stuff still works from previous edits).a. instructor only visibility is restricted to: post/topic author or admins
##Post##
Recording.2026-02-27.193434.mp4
##Quick Reply##
Recording.2026-02-27.193434.mp4
##Errors Encountered##
sendmail-not-found
unsupported test image format warning
##Testing##
./nodebb buildand./nodebb restart