Always show solutions for teachers

This commit is contained in:
Ramon Wenger 2021-01-27 17:16:42 +01:00
parent 5eadff662d
commit a47a41d351
1 changed files with 2 additions and 1 deletions

View File

@ -49,7 +49,8 @@ class ContentBlockNode(DjangoObjectType):
def resolve_contents(self, info, **kwargs):
updated_stream_data = []
for content in self.contents.stream_data:
if content['type'] == 'solution' and not are_solutions_enabled_for(info.context.user, self.module):
# only show solutions to teachers and students for whom their teachers have them enabled
if content['type'] == 'solution' and not (are_solutions_enabled_for(info.context.user, self.module) or info.context.user.is_teacher()):
continue
if content['type'] == 'content_list_item':