Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent 500 error when staff tries to see discussion as specific student #457

Merged

Conversation

amirtds
Copy link

@amirtds amirtds commented Sep 10, 2019

NYIF is testing view as specific student functionality on units that are a mix of different XBlock. We applied this fix to PDF and Scorm but seems they have discussion unit with other XBlock and to make the whole subsection visible as a specific student we need to a turn on this flag on built-in discussion XBlock.

@amirtds amirtds requested a review from bryanlandia September 10, 2019 23:01
@amirtds
Copy link
Author

amirtds commented Sep 10, 2019

Copy link

@bryanlandia bryanlandia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amirtds It looks to me from lms/djangoapps/courseware/masquerade.py comment:

def filter_displayed_blocks(block, unused_view, frag, unused_context):
    """
    A wrapper to only show XBlocks that set `show_in_read_only_mode` when masquerading as a specific user.

    We don't want to modify the state of the user we are masquerading as, so we can't show XBlocks
    that store information outside of the XBlock fields API.
    """

we have to make sure that data associated with the user and the XBlock instance can't be modified while masquerading as the user. Do you know whether it's possible to change discussion posts as the user while masquerading? It seems possible that some of the user/discussion data is not actually stored using the XBlock fields API in this case.

Also, I wonder if we should look at modifying something in the XBlock package instead so that the default is show_in_read_only_mode = True, instead of changing each type of XBlock? Not sure there.

@amirtds
Copy link
Author

amirtds commented Sep 20, 2019

@bryanlandia
Copy link

@amirtds I am having second thoughts about changing this to True globally. The ideal thing would be to keep this as it is, False, and rely on XBlocks to properly reset this to True unless they are storing data outside of the XBlock/modulestore interface.

A more complex but possibly better approach given that XBlock authors haven't/won't do this, would be to access some kind of registry set in the dB or ENV.json that provides an override. WDYT?

We might even want to run this through a quick tech-design-proposal.

@bryanlandia
Copy link

We might be able to make the smallest change by putting logic in the SettingsMixin from xblock-utils package, for those XBlocks that do use it.

@bryanlandia
Copy link

We decided to just merge this for now but make an Issue/Jira task to follow-up.

Copy link

@bryanlandia bryanlandia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with idea to look later at more universal fix to this issue across multiple XBlocks

@bryanlandia bryanlandia merged commit b0ef5b7 into appsembler/ficus/develop Jan 13, 2020
@amirtds amirtds deleted the amir/enableViewAsSpecificStudent branch January 13, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants