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
aed1ea80
Commit
aed1ea80
authored
Oct 07, 2016
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix attribute access
parent
256223d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
common/lib/xmodule/xmodule/capa_base.py
+3
-4
common/lib/xmodule/xmodule/tests/test_capa_module.py
+7
-0
No files found.
common/lib/xmodule/xmodule/capa_base.py
View file @
aed1ea80
...
...
@@ -1354,17 +1354,16 @@ class CapaMixin(CapaFields):
if
is_correct
is
None
:
is_correct
=
''
response_data
=
getattr
(
answer_input
,
'response_data'
,
{})
input_metadata
[
input_id
]
=
{
'question'
:
answer_input
.
response_data
.
get
(
'label'
,
''
),
'question'
:
response_data
.
get
(
'label'
,
''
),
'answer'
:
user_visible_answer
,
'response_type'
:
getattr
(
getattr
(
answer_response
,
'xml'
,
None
),
'tag'
,
''
),
'input_type'
:
getattr
(
answer_input
,
'tag'
,
''
),
'correct'
:
is_correct
,
'variant'
:
variant
,
'group_label'
:
response_data
.
get
(
'group_label'
,
''
),
}
# Add group_label in event data only if the responsetype contains multiple inputtypes
if
answer_input
.
response_data
.
get
(
'group_label'
):
input_metadata
[
input_id
][
'group_label'
]
=
answer_input
.
response_data
.
get
(
'group_label'
)
return
input_metadata
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
aed1ea80
...
...
@@ -2539,6 +2539,7 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'optionresponse'
,
'input_type'
:
'optioninput'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
3
):
{
...
...
@@ -2547,6 +2548,7 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'multiplechoiceresponse'
,
'input_type'
:
'choicegroup'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
4
):
{
...
...
@@ -2555,6 +2557,7 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'choiceresponse'
,
'input_type'
:
'checkboxgroup'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
})
...
...
@@ -2595,6 +2598,7 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
}
})
...
...
@@ -2726,6 +2730,7 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
module
.
seed
,
}
})
...
...
@@ -2758,11 +2763,13 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'coderesponse'
,
'input_type'
:
'filesubmission'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
3
):
{
'answer'
:
'None'
,
'correct'
:
True
,
'group_label'
:
''
,
'question'
:
''
,
'response_type'
:
'customresponse'
,
'input_type'
:
'textline'
,
...
...
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