Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
problem-builder
Commits
0ff61a29
Commit
0ff61a29
authored
Oct 22, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Make sure plot can retrieve data from scale questions.
parent
f236debd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
problem_builder/plot.py
+11
-4
problem_builder/slider.py
+7
-1
No files found.
problem_builder/plot.py
View file @
0ff61a29
...
...
@@ -175,10 +175,17 @@ class PlotBlock(StudioEditableXBlockMixin, StudioContainerWithNestedXBlocksMixin
claim
,
q1
,
q2
=
line
.
split
(
', '
)
r1
,
r2
=
None
,
None
for
question_id
,
question
in
zip
(
question_ids
,
questions
):
if
question
.
name
==
q1
:
r1
=
response_function
(
question
,
question_id
)
if
question
.
name
==
q2
:
r2
=
response_function
(
question
,
question_id
)
question_type
=
question
.
scope_ids
.
block_type
if
question_type
==
'pb-slider'
:
if
question
.
url_name
==
q1
:
r1
=
response_function
(
question
,
question_id
)
if
question
.
url_name
==
q2
:
r2
=
response_function
(
question
,
question_id
)
else
:
if
question
.
name
==
q1
:
r1
=
response_function
(
question
,
question_id
)
if
question
.
name
==
q2
:
r2
=
response_function
(
question
,
question_id
)
if
r1
is
not
None
and
r2
is
not
None
:
break
claims
.
append
([
claim
,
r1
,
r2
])
...
...
problem_builder/slider.py
View file @
0ff61a29
...
...
@@ -145,11 +145,17 @@ class SliderBlock(
self
.
student_value
=
value
if
sub_api
:
# Also send to the submissions API:
sub_api
.
create_submission
(
self
.
student_item_key
,
{
'value'
:
value
}
)
sub_api
.
create_submission
(
self
.
student_item_key
,
value
)
result
=
self
.
get_last_result
()
log
.
debug
(
u'Slider submission result:
%
s'
,
result
)
return
result
def
get_submission_display
(
self
,
submission
):
"""
Get the human-readable version of a submission value
"""
return
submission
*
100
def
validate_field_data
(
self
,
validation
,
data
):
"""
Validate this block's field data.
...
...
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