Commit 2415e8de by kimth

Let admins see answers of problems at any time

parent a30f9bfd
...@@ -347,6 +347,10 @@ class CapaModule(XModule): ...@@ -347,6 +347,10 @@ class CapaModule(XModule):
if self.show_answer == "never": if self.show_answer == "never":
return False return False
# Admins can see the answer, unless the problem explicitly prevents it
if self.system.user_is_staff:
return True
if self.show_answer == 'attempted': if self.show_answer == 'attempted':
return self.attempts > 0 return self.attempts > 0
......
...@@ -765,6 +765,7 @@ class ModuleSystem(object): ...@@ -765,6 +765,7 @@ class ModuleSystem(object):
self.replace_urls = replace_urls self.replace_urls = replace_urls
self.node_path = node_path self.node_path = node_path
self.anonymous_student_id = anonymous_student_id self.anonymous_student_id = anonymous_student_id
self.user_is_staff = user.is_staff
def get(self, attr): def get(self, attr):
''' provide uniform access to attributes (like etree).''' ''' provide uniform access to attributes (like etree).'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment