added docs and added is_correct to conditional

This commit is contained in:
Alexander Kryklia
2013-05-16 12:35:58 +03:00
parent 6f95d21ef8
commit 6f964acec5
2 changed files with 18 additions and 2 deletions

View File

@@ -517,8 +517,14 @@ class CapaModule(CapaFields, XModule):
return False
def is_completed(self):
# used by conditional module
# return self.answer_available()
""" Used to decide to show or hide RESET or CHECK buttons.
Actually means that student submitted problem and nothing more.
Problem can be completely wrong.
Pressing RESET button makes this function to return False.
Suggestion: rename it to is_submitted.
# older comment: return self.answer_available()"""
return self.lcp.done
def is_attempted(self):

View File

@@ -70,8 +70,18 @@ class ConditionalModule(ConditionalFields, XModule):
# value: <name of module attribute>
conditions_map = {
'poll_answer': 'poll_answer', # poll_question attr
# problem was submitted (it can be wrong)
# if student will press reset button after that,
# state will be reverted
'completed': 'is_completed', # capa_problem attr
# if student attempted problem
'attempted': 'is_attempted', # capa_problem attr
# if problem is full points
'correct': 'is_correct',
'voted': 'voted' # poll_question attr
}