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
c555bf5a
Commit
c555bf5a
authored
Jan 03, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix capa to add contextualize_text for optionresponse and multiplechoice
parent
95e7f2f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
common/lib/capa/capa/responsetypes.py
+2
-2
No files found.
common/lib/capa/capa/responsetypes.py
View file @
c555bf5a
...
...
@@ -629,7 +629,7 @@ class MultipleChoiceResponse(LoncapaResponse):
# define correct choices (after calling secondary setup)
xml
=
self
.
xml
cxml
=
xml
.
xpath
(
'//*[@id=$id]//choice[@correct="true"]'
,
id
=
xml
.
get
(
'id'
))
self
.
correct_choices
=
[
c
hoice
.
get
(
'name'
)
for
choice
in
cxml
]
self
.
correct_choices
=
[
c
ontextualize_text
(
choice
.
get
(
'name'
),
self
.
context
)
for
choice
in
cxml
]
def
mc_setup_response
(
self
):
'''
...
...
@@ -723,7 +723,7 @@ class OptionResponse(LoncapaResponse):
return
cmap
def
get_answers
(
self
):
amap
=
dict
([(
af
.
get
(
'id'
),
af
.
get
(
'correct'
))
for
af
in
self
.
answer_fields
])
amap
=
dict
([(
af
.
get
(
'id'
),
contextualize_text
(
af
.
get
(
'correct'
),
self
.
context
))
for
af
in
self
.
answer_fields
])
# log.debug('%s: expected answers=%s' % (unicode(self),amap))
return
amap
...
...
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