Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-jsme
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
OpenEdx
edx-jsme
Commits
6a54595c
Commit
6a54595c
authored
Aug 08, 2014
by
Chris Rossi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i18n
parent
1ace35da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
edx_jsme/__init__.py
+5
-3
No files found.
edx_jsme/__init__.py
View file @
6a54595c
...
...
@@ -6,6 +6,7 @@ import re
from
capa
import
inputtypes
,
responsetypes
from
capa.correctmap
import
CorrectMap
from
django.utils.translation
import
ugettext
as
_
@inputtypes.registry.register
...
...
@@ -38,7 +39,7 @@ class JSMEInput(inputtypes.InputTypeBase):
dirty
=
True
if
not
answer
:
raise
ValueError
(
"Must provide an answer."
)
raise
ValueError
(
_
(
"Must provide an answer."
)
)
if
dirty
:
self
.
value
=
json
.
dumps
(
...
...
@@ -80,8 +81,9 @@ class JSMEResponse(responsetypes.LoncapaResponse):
def
get_answers
(
self
):
elements
=
self
.
xml
.
xpath
(
"./answer"
)
answer
=
elements
[
0
]
.
text
.
strip
()
return
{
self
.
answer_id
:
answer
}
if
elements
:
answer
=
elements
[
0
]
.
text
.
strip
()
return
{
self
.
answer_id
:
answer
}
def
get_score
(
self
,
student_answers
):
graded_answer
=
json
.
loads
(
...
...
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