Commit f68b5f30 by Calen Pennington

Merge pull request #598 from MITx/kimth/solutions

Let admins see answers of problems at any time
parents b5500176 2415e8de
......@@ -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
......
......@@ -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).'''
......
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