Commit 2856971b by Chris Dodge

update templates to include attemps and weight values. Also update…

update templates to include attemps and weight values. Also update capa_module.py to accept empty strings ('') to mean 'default value'
parent 2ed5fdf7
...@@ -116,9 +116,11 @@ class CapaModule(XModule): ...@@ -116,9 +116,11 @@ class CapaModule(XModule):
self.grace_period = None self.grace_period = None
self.close_date = self.display_due_date self.close_date = self.display_due_date
self.max_attempts = self.metadata.get('attempts', None) max_attempts = self.metadata.get('attempts', None)
if self.max_attempts is not None: if max_attempts:
self.max_attempts = int(self.max_attempts) self.max_attempts = int(max_attempts)
else:
self.max_attempts = None
self.show_answer = self.metadata.get('showanswer', 'closed') self.show_answer = self.metadata.get('showanswer', 'closed')
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Circuit Schematic display_name: Circuit Schematic
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
data: | data: |
<problem > <problem >
Please make a voltage divider that splits the provided voltage evenly. Please make a voltage divider that splits the provided voltage evenly.
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Custom Grader display_name: Custom Grader
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
data: | data: |
<problem> <problem>
<p> <p>
......
...@@ -4,6 +4,8 @@ metadata: ...@@ -4,6 +4,8 @@ metadata:
rerandomize: never rerandomize: never
showanswer: always showanswer: always
markdown: "" markdown: ""
weight: ""
attempts: ""
data: | data: |
<problem> <problem>
</problem> </problem>
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Formula Response display_name: Formula Response
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
data: | data: |
<problem> <problem>
<p> <p>
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Image Response display_name: Image Response
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
data: | data: |
<problem> <problem>
<p> <p>
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Multiple Choice display_name: Multiple Choice
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
markdown: markdown:
"A multiple choice problem presents radio buttons for student input. Students can only select a single "A multiple choice problem presents radio buttons for student input. Students can only select a single
option presented. Multiple Choice questions have been the subject of many areas of research due to the early option presented. Multiple Choice questions have been the subject of many areas of research due to the early
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Numerical Response display_name: Numerical Response
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
markdown: markdown:
"A numerical response problem accepts a line of text input from the "A numerical response problem accepts a line of text input from the
student, and evaluates the input for correctness based on its student, and evaluates the input for correctness based on its
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: Option Response display_name: Option Response
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
markdown: markdown:
"OptionResponse gives a limited set of options for students to respond with, and presents those options "OptionResponse gives a limited set of options for students to respond with, and presents those options
in a format that encourages them to search for a specific answer rather than being immediately presented in a format that encourages them to search for a specific answer rather than being immediately presented
......
...@@ -3,6 +3,8 @@ metadata: ...@@ -3,6 +3,8 @@ metadata:
display_name: String Response display_name: String Response
rerandomize: never rerandomize: never
showanswer: always showanswer: always
weight: ""
attempts: ""
# Note, the extra newlines are needed to make the yaml parser add blank lines instead of folding # Note, the extra newlines are needed to make the yaml parser add blank lines instead of folding
markdown: markdown:
"A string response problem accepts a line of text input from the "A string response problem accepts a line of text input from the
......
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