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
ff0f2161
Commit
ff0f2161
authored
Dec 26, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started tests and add graders to capa_problem
parent
f9169613
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
common/lib/capa/capa/capa_problem.py
+4
-1
common/lib/capa/capa/graders/tests.py
+10
-3
No files found.
common/lib/capa/capa/capa_problem.py
View file @
ff0f2161
...
@@ -34,6 +34,8 @@ import chem
...
@@ -34,6 +34,8 @@ import chem
import
chem.chemcalc
import
chem.chemcalc
import
chem.chemtools
import
chem.chemtools
import
chem.miller
import
chem.miller
import
graders
import
graders.draganddrop
import
calc
import
calc
from
correctmap
import
CorrectMap
from
correctmap
import
CorrectMap
...
@@ -69,7 +71,8 @@ global_context = {'random': random,
...
@@ -69,7 +71,8 @@ global_context = {'random': random,
'eia'
:
eia
,
'eia'
:
eia
,
'chemcalc'
:
chem
.
chemcalc
,
'chemcalc'
:
chem
.
chemcalc
,
'chemtools'
:
chem
.
chemtools
,
'chemtools'
:
chem
.
chemtools
,
'miller'
:
chem
.
miller
}
'miller'
:
chem
.
miller
,
'draganddrop'
:
graders
.
draganddrop
}
# These should be removed from HTML output, including all subelements
# These should be removed from HTML output, including all subelements
html_problem_semantics
=
[
"codeparam"
,
"responseparam"
,
"answer"
,
"script"
,
"hintgroup"
,
"openendedparam"
,
"openendedrubric"
]
html_problem_semantics
=
[
"codeparam"
,
"responseparam"
,
"answer"
,
"script"
,
"hintgroup"
,
"openendedparam"
,
"openendedrubric"
]
...
...
common/lib/capa/capa/graders/tests.py
View file @
ff0f2161
...
@@ -5,9 +5,16 @@ import draganddrop
...
@@ -5,9 +5,16 @@ import draganddrop
class
Test_DragAndDrop
(
unittest
.
TestCase
):
class
Test_DragAndDrop
(
unittest
.
TestCase
):
def
test_1
(
self
):
def
test_targets_true
(
self
):
user_input
=
'{"laice": "bcc", "points": [["0.00", "1.00", "0.00"], ["1.00", "1.00", "0.00"], ["0.00", "0.00", "1.00"]]}'
user_input
=
'{"use_targets": "true", "draggables":
\
correct_answer
=
{}
["1": "t1", "name_with_icon": "t2"]}'
correct_answer
=
{
'1'
:
't1'
,
'name_with_icon'
:
't2'
}
self
.
assertTrue
(
draganddrop
.
grade
(
user_input
,
correct_answer
))
def
test_targets_true
(
self
):
user_input
=
'{"use_targets": "true", "draggables":
\
["1": "t1", "name_with_icon": "t2"]}'
correct_answer
=
{
'1'
:
't1'
,
'name_with_icon'
:
't2'
}
self
.
assertTrue
(
draganddrop
.
grade
(
user_input
,
correct_answer
))
self
.
assertTrue
(
draganddrop
.
grade
(
user_input
,
correct_answer
))
...
...
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