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
c78663b4
Commit
c78663b4
authored
Oct 20, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix review comments
parent
b30ab46b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
problem_builder/questionnaire.py
+1
-1
problem_builder/slider.py
+3
-3
problem_builder/tests/integration/test_slider.py
+2
-3
problem_builder/tests/integration/xml_templates/slider_step.xml
+1
-1
No files found.
problem_builder/questionnaire.py
View file @
c78663b4
...
...
@@ -24,7 +24,7 @@ from django.utils.safestring import mark_safe
from
lazy
import
lazy
import
uuid
from
xblock.core
import
XBlock
from
xblock.fields
import
Scope
,
String
,
Float
from
xblock.fields
import
Scope
,
String
from
xblock.fragment
import
Fragment
from
xblock.validation
import
ValidationMessage
from
xblockutils.helpers
import
child_isinstance
...
...
problem_builder/slider.py
View file @
c78663b4
...
...
@@ -26,7 +26,6 @@ import uuid
from
xblock.core
import
XBlock
from
xblock.fields
import
Scope
,
String
,
Float
from
xblock.fragment
import
Fragment
from
xblock.validation
import
ValidationMessage
from
xblockutils.studio_editable
import
StudioEditableXBlockMixin
from
xblockutils.resources
import
ResourceLoader
...
...
@@ -52,7 +51,8 @@ class SliderBlock(
SubmittingXBlockMixin
,
QuestionMixin
,
StudioEditableXBlockMixin
,
XBlockWithTranslationServiceMixin
,
XBlock
,
):
"""
An XBlock used to ask multiple-choice questions
An XBlock used by students to indicate a numeric value on a sliding scale.
The student's answer is always considered "correct".
"""
CATEGORY
=
'pb-slider'
STUDIO_LABEL
=
_
(
u"Ranged Value Slider"
)
...
...
@@ -145,7 +145,7 @@ 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'
:
value
})
result
=
self
.
get_last_result
()
log
.
debug
(
u'Slider submission result:
%
s'
,
result
)
return
result
...
...
problem_builder/tests/integration/test_slider.py
View file @
c78663b4
...
...
@@ -20,7 +20,7 @@
# Imports ###########################################################
from
.base_test
import
ProblemBuilderBaseTest
,
MentoringAssessmentBaseTest
,
CORRECT
,
GetChoices
from
.base_test
import
ProblemBuilderBaseTest
,
MentoringAssessmentBaseTest
,
GetChoices
# Classes ###########################################################
...
...
@@ -81,8 +81,7 @@ class SliderBlockTest(SliderBlockTestMixins, ProblemBuilderBaseTest):
self
.
assertEqual
(
self
.
get_slider_value
(),
15
)
self
.
assertFalse
(
self
.
submit_button
.
is_enabled
())
# Choose a choice:
mcq_choices
=
pb_wrapper
.
find_elements_by_css_selector
(
'.choices .choice input'
)
mcq_choices
[
0
]
.
click
()
GetChoices
(
pb_wrapper
)
.
select
(
'Yes'
)
self
.
assertTrue
(
self
.
submit_button
.
is_enabled
())
self
.
click_submit
(
pb_wrapper
)
# Now, we expect submit to be disabled and the checkmark to be visible:
...
...
problem_builder/tests/integration/xml_templates/slider_step.xml
View file @
c78663b4
<step-builder
display_name=
"Step Builder"
max_attempts=
"90"
>
<step-builder
display_name=
"Step Builder"
>
<sb-step
display_name=
"Slider step"
>
<pb-slider
name=
"slider_1"
display_name=
"Information Reliability"
question=
"How reliable is this information?"
min_label=
"0%"
max_label=
"100%"
/>
...
...
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