From 949f638dd1a7ed60f86e1137757cc705e16450e2 Mon Sep 17 00:00:00 2001
From: Lyla Fischer
Date: Wed, 26 Sep 2012 17:31:33 -0400
Subject: [PATCH] added several problem types
---
common/lib/xmodule/xmodule/capa_module.py | 3 +-
.../templates/problem/circuitschematic.yaml | 14 ++---
.../templates/problem/customgrader.yaml | 12 ++--
.../templates/problem/forumularesponse.yaml | 8 +--
.../templates/problem/imageresponse.yaml | 4 +-
.../templates/problem/multiplechoice.yaml | 4 +-
.../templates/problem/numericalresponse.yaml | 4 +-
.../templates/problem/string_response.yaml | 56 +++++++++----------
8 files changed, 50 insertions(+), 55 deletions(-)
diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py
index ae7ebc3b78..4211434619 100644
--- a/common/lib/xmodule/xmodule/capa_module.py
+++ b/common/lib/xmodule/xmodule/capa_module.py
@@ -638,14 +638,13 @@ class CapaDescriptor(RawDescriptor):
stores_state = True
has_score = True
+ template_dir_name = 'problem'
# Capa modules have some additional metadata:
# TODO (vshnayder): do problems have any other metadata? Do they
# actually use type and points?
metadata_attributes = RawDescriptor.metadata_attributes + ('type', 'points')
- template_dir_name = 'problem'
-
# VS[compat]
# TODO (cpennington): Delete this method once all fall 2012 course are being
# edited in the cms
diff --git a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml
index b07c114e67..224227aa5e 100644
--- a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml
@@ -70,15 +70,15 @@ data: |
# of the diagram and analysis results for the i-th schematic tag
def get_tran(json,signal):
- for element in json:
- if element[0] == 'transient':
- return element[1].get(signal,[])
- return []
+ for element in json:
+ if element[0] == 'transient':
+ return element[1].get(signal,[])
+ return []
def get_value(at,output):
- for (t,v) in output:
- if at == t: return v
- return None
+ for (t,v) in output:
+ if at == t: return v
+ return None
output = get_tran(submission[0],'Z')
okay = True
diff --git a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml
index 837f0669b7..3b1f6599fa 100644
--- a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml
@@ -2,7 +2,7 @@
metadata:
display_name: Custom Grader
data: |
-
+
Example: Custom Response Problem
@@ -12,11 +12,9 @@ data: |
python script embedded within the problem.
-
@@ -29,5 +27,5 @@ data: |
-
+
children: []
diff --git a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml
index d4df020419..398438d953 100644
--- a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml
@@ -2,7 +2,7 @@
metadata:
display_name: Formula Repsonse
data: |
-
+
Example: Formula Response Problem
@@ -21,9 +21,7 @@ data: |
on the problem author to specify the allowed variables in the expression, and the
numerical ranges over which the variables must be sampled to test for correctness.
-
+
@@ -36,5 +34,5 @@ data: |
-
+
children: []
diff --git a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml
index 8ca93d29dd..3469e9c055 100644
--- a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml
@@ -2,7 +2,7 @@
metadata:
display_name: Image Response
data: |
-
+
Example: Image Response Problem
@@ -21,6 +21,6 @@ data: |
-
+
children: []
diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml
index 9d6d9dc5fc..cc2502a855 100644
--- a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml
@@ -2,7 +2,7 @@
metadata:
display_name: Multiple Choice
data: |
-
+
Example: Multiple Choice Response Problem
@@ -23,5 +23,5 @@ data: |
-
+
children: []
diff --git a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml
index 8edc3f61ba..3f4861a01e 100644
--- a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml
@@ -2,7 +2,7 @@
metadata:
display_name: Numerical Response
data: |
-
+
Example: Numerical Response Problem
@@ -24,5 +24,5 @@ data: |
-
+
children: []
diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml
index 28b89cf613..47c5adf1a4 100644
--- a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml
+++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml
@@ -4,37 +4,37 @@ metadata:
data: |
- Example: String Response Problem
-
-
- A string response problem accepts a line of text input from the
- student, and evaluates the input for correctness based on an expected
- answer within each input box.
-
- The answer is correct if it is the expected answer.
-
+ Example: String Response Problem
+
+
+ A string response problem accepts a line of text input from the
+ student, and evaluates the input for correctness based on an expected
+ answer within each input box.
+
+ The answer is correct if it is the expected answer.
+
- Which US state has Lansing as its capital?
-
-
-
-
-
-
-
-
- The state capital of Wisconsin is Madison.
-
-
- The state capital of Minnesota is St. Paul.
-
-
- The state you are looking for is also known as the 'Great Lakes State'
-
-
-
+ Which US state has Lansing as its capital?
+
+
+
+
+
+
+
+
+ The state capital of Wisconsin is Madison.
+
+
+ The state capital of Minnesota is St. Paul.
+
+
+ The state you are looking for is also known as the 'Great Lakes State'
+
+
+