Let admins see answers of problems at any time

This commit is contained in:
kimth
2012-08-31 07:09:54 -04:00
parent a27ba692a8
commit a98dcd958e
2 changed files with 5 additions and 0 deletions

View File

@@ -347,6 +347,10 @@ class CapaModule(XModule):
if self.show_answer == "never":
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':
return self.attempts > 0

View File

@@ -765,6 +765,7 @@ class ModuleSystem(object):
self.replace_urls = replace_urls
self.node_path = node_path
self.anonymous_student_id = anonymous_student_id
self.user_is_staff = user.is_staff
def get(self, attr):
''' provide uniform access to attributes (like etree).'''