Merge pull request #598 from MITx/kimth/solutions

Let admins see answers of problems at any time
This commit is contained in:
Calen Pennington
2012-09-05 08:24:45 -07:00
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

@@ -771,6 +771,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).'''