Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
7aa493ec
Commit
7aa493ec
authored
Mar 01, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A start on getting these tests to run again.
parent
283fc47a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
+25
-1
common/lib/capa/capa/tests/response_xml_factory.py
+21
-0
common/lib/capa/capa/tests/test_responsetypes.py
+4
-1
No files found.
common/lib/capa/capa/tests/response_xml_factory.py
View file @
7aa493ec
...
@@ -241,6 +241,27 @@ class CustomResponseXMLFactory(ResponseXMLFactory):
...
@@ -241,6 +241,27 @@ class CustomResponseXMLFactory(ResponseXMLFactory):
return
ResponseXMLFactory
.
textline_input_xml
(
**
kwargs
)
return
ResponseXMLFactory
.
textline_input_xml
(
**
kwargs
)
class
SymbolicResponseXMLFactory
(
ResponseXMLFactory
):
""" Factory for creating <symbolicresponse> XML trees """
def
create_response_element
(
self
,
**
kwargs
):
cfn
=
kwargs
.
get
(
'cfn'
,
None
)
answer
=
kwargs
.
get
(
'answer'
,
None
)
options
=
kwargs
.
get
(
'options'
,
None
)
response_element
=
etree
.
Element
(
"symbolicresponse"
)
if
cfn
:
response_element
.
set
(
'cfn'
,
str
(
cfn
))
if
answer
:
response_element
.
set
(
'answer'
,
str
(
answer
))
if
options
:
response_element
.
set
(
'options'
,
str
(
options
))
return
response_element
def
create_input_element
(
self
,
**
kwargs
):
return
ResponseXMLFactory
.
textline_input_xml
(
**
kwargs
)
class
SchematicResponseXMLFactory
(
ResponseXMLFactory
):
class
SchematicResponseXMLFactory
(
ResponseXMLFactory
):
""" Factory for creating <schematicresponse> XML trees """
""" Factory for creating <schematicresponse> XML trees """
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
7aa493ec
...
@@ -186,7 +186,10 @@ class ImageResponseTest(ResponseTest):
...
@@ -186,7 +186,10 @@ class ImageResponseTest(ResponseTest):
class
SymbolicResponseTest
(
unittest
.
TestCase
):
class
SymbolicResponseTest
(
unittest
.
TestCase
):
def
test_sr_grade
(
self
):
from
response_xml_factory
import
SymbolicResponseXMLFactory
xml_factory_class
=
SymbolicResponseXMLFactory
def
test_symbolic_response_grade
(
self
):
symbolicresponse_file
=
os
.
path
.
dirname
(
__file__
)
+
"/test_files/symbolicresponse.xml"
symbolicresponse_file
=
os
.
path
.
dirname
(
__file__
)
+
"/test_files/symbolicresponse.xml"
test_lcp
=
lcp
.
LoncapaProblem
(
open
(
symbolicresponse_file
)
.
read
(),
'1'
,
system
=
test_system
)
test_lcp
=
lcp
.
LoncapaProblem
(
open
(
symbolicresponse_file
)
.
read
(),
'1'
,
system
=
test_system
)
correct_answers
=
{
'1_2_1'
:
'cos(theta)*[[1,0],[0,1]] + i*sin(theta)*[[0,1],[1,0]]'
,
correct_answers
=
{
'1_2_1'
:
'cos(theta)*[[1,0],[0,1]] + i*sin(theta)*[[0,1],[1,0]]'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment