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
70898a06
Commit
70898a06
authored
May 23, 2013
by
Peter Baratta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pep8 fix
parent
db261dc1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
common/lib/capa/capa/tests/test_responsetypes.py
+4
-3
No files found.
common/lib/capa/capa/tests/test_responsetypes.py
View file @
70898a06
...
@@ -223,7 +223,6 @@ class SymbolicResponseTest(ResponseTest):
...
@@ -223,7 +223,6 @@ class SymbolicResponseTest(ResponseTest):
for
(
input_str
,
input_mathml
)
in
incorrect_inputs
:
for
(
input_str
,
input_mathml
)
in
incorrect_inputs
:
self
.
_assert_symbolic_grade
(
problem
,
input_str
,
input_mathml
,
'incorrect'
)
self
.
_assert_symbolic_grade
(
problem
,
input_str
,
input_mathml
,
'incorrect'
)
def
test_complex_number_grade
(
self
):
def
test_complex_number_grade
(
self
):
problem
=
self
.
build_problem
(
math_display
=
True
,
problem
=
self
.
build_problem
(
math_display
=
True
,
expect
=
"[[cos(theta),i*sin(theta)],[i*sin(theta),cos(theta)]]"
,
expect
=
"[[cos(theta),i*sin(theta)],[i*sin(theta),cos(theta)]]"
,
...
@@ -323,7 +322,7 @@ class SymbolicResponseTest(ResponseTest):
...
@@ -323,7 +322,7 @@ class SymbolicResponseTest(ResponseTest):
dynamath_input
,
dynamath_input
,
expected_correctness
):
expected_correctness
):
input_dict
=
{
'1_2_1'
:
str
(
student_input
),
input_dict
=
{
'1_2_1'
:
str
(
student_input
),
'1_2_1_dynamath'
:
str
(
dynamath_input
)
}
'1_2_1_dynamath'
:
str
(
dynamath_input
)}
correct_map
=
problem
.
grade_answers
(
input_dict
)
correct_map
=
problem
.
grade_answers
(
input_dict
)
...
@@ -548,6 +547,7 @@ class FormulaResponseTest(ResponseTest):
...
@@ -548,6 +547,7 @@ class FormulaResponseTest(ResponseTest):
input_dict
=
{
'1_2_1'
:
'1/0'
}
input_dict
=
{
'1_2_1'
:
'1/0'
}
self
.
assertRaises
(
StudentInputError
,
problem
.
grade_answers
,
input_dict
)
self
.
assertRaises
(
StudentInputError
,
problem
.
grade_answers
,
input_dict
)
class
StringResponseTest
(
ResponseTest
):
class
StringResponseTest
(
ResponseTest
):
from
response_xml_factory
import
StringResponseXMLFactory
from
response_xml_factory
import
StringResponseXMLFactory
xml_factory_class
=
StringResponseXMLFactory
xml_factory_class
=
StringResponseXMLFactory
...
@@ -607,7 +607,7 @@ class StringResponseTest(ResponseTest):
...
@@ -607,7 +607,7 @@ class StringResponseTest(ResponseTest):
problem
=
self
.
build_problem
(
problem
=
self
.
build_problem
(
answer
=
"Michigan"
,
answer
=
"Michigan"
,
hintfn
=
"gimme_a_hint"
,
hintfn
=
"gimme_a_hint"
,
script
=
textwrap
.
dedent
(
"""
script
=
textwrap
.
dedent
(
"""
def gimme_a_hint(answer_ids, student_answers, new_cmap, old_cmap):
def gimme_a_hint(answer_ids, student_answers, new_cmap, old_cmap):
aid = answer_ids[0]
aid = answer_ids[0]
answer = student_answers[aid]
answer = student_answers[aid]
...
@@ -921,6 +921,7 @@ class NumericalResponseTest(ResponseTest):
...
@@ -921,6 +921,7 @@ class NumericalResponseTest(ResponseTest):
input_dict
=
{
'1_2_1'
:
'1/0'
}
input_dict
=
{
'1_2_1'
:
'1/0'
}
self
.
assertRaises
(
StudentInputError
,
problem
.
grade_answers
,
input_dict
)
self
.
assertRaises
(
StudentInputError
,
problem
.
grade_answers
,
input_dict
)
class
CustomResponseTest
(
ResponseTest
):
class
CustomResponseTest
(
ResponseTest
):
from
response_xml_factory
import
CustomResponseXMLFactory
from
response_xml_factory
import
CustomResponseXMLFactory
xml_factory_class
=
CustomResponseXMLFactory
xml_factory_class
=
CustomResponseXMLFactory
...
...
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