def filter_displayed_blocks(block, unused_view, frag, unused_context):
 if getattr(block, 'show_in_read_only_mode', False):
  return frag
 return Fragment(_(u'This type of component cannot be shown while viewing the course as a specific student.'))

def filter_displayed_blocks ( block , unused_view , frag , unused_context ) : if getattr ( block , 'show_in_read_only_mode' , False ) : return frag return Fragment ( _ ( u'This type of component cannot be shown while viewing the course as a specific student.' ) )
a wrapper to only show xblocks that set show_in_read_only_mode when masquerading as a specific user .