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
b542f0c5
Commit
b542f0c5
authored
Oct 22, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Refreshing the page during a second step builder attempt will display previous answers
parent
318d8c04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
+9
-4
problem_builder/mentoring.py
+2
-0
problem_builder/templates/html/mcqblock.html
+1
-1
problem_builder/templates/html/mrqblock.html
+1
-1
problem_builder/templates/html/ratingblock.html
+2
-2
problem_builder/tests/integration/test_step_builder.py
+3
-0
No files found.
problem_builder/mentoring.py
View file @
b542f0c5
...
...
@@ -958,6 +958,8 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
fragment
=
Fragment
()
children_contents
=
[]
context
=
context
or
{}
context
[
'hide_prev_answer'
]
=
True
# For Step Builder, we don't show the users' old answers when they try again
for
child_id
in
self
.
children
:
child
=
self
.
runtime
.
get_block
(
child_id
)
if
child
is
None
:
# child should not be None but it can happen due to bugs or permission issues
...
...
problem_builder/templates/html/mcqblock.html
View file @
b542f0c5
...
...
@@ -10,7 +10,7 @@
<div
class=
"choice-selector"
>
<input
id=
"choice-{{ self.html_id }}-{{ forloop.counter }}"
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
self
.
student_choice =
=
choice
.
value
%}
checked
{%
endif
%}
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
endif
%}
/>
</div>
<label
class=
"choice-label"
for=
"choice-{{ self.html_id }}-{{ forloop.counter }}"
>
...
...
problem_builder/templates/html/mrqblock.html
View file @
b542f0c5
...
...
@@ -10,7 +10,7 @@
<div
class=
"choice-selector"
>
<input
id=
"choice-{{ self.html_id }}-{{ forloop.counter }}"
type=
"checkbox"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
choice
.
value
in
self
.
student_choices
%}
checked
{%
endif
%}
{%
if
choice
.
value
in
self
.
student_choices
and
not
hide_prev_answer
%}
checked
{%
endif
%}
/>
</div>
<label
class=
"choice-label"
for=
"choice-{{ self.html_id }}-{{ forloop.counter }}"
>
...
...
problem_builder/templates/html/ratingblock.html
View file @
b542f0c5
...
...
@@ -10,7 +10,7 @@
<div
class=
"choice-selector"
>
<input
id=
"choice-{{ self.html_id }}-{{i}}"
type=
"radio"
name=
"{{ self.name }}"
value=
"{{i}}"
{%
if
self
.
student_choice =
=
i
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
{%
if
self
.
student_choice =
=
i
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
/>
</div>
<label
class=
"choice-label"
for=
"choice-{{ self.html_id }}-{{i}}"
>
...
...
@@ -30,7 +30,7 @@
<div
class=
"choice-selector"
>
<input
id=
"choice-{{ self.html_id }}-custom{{ forloop.counter }}"
type=
"radio"
name=
"{{ self.name }}"
value=
"{{ choice.value }}"
{%
if
self
.
student_choice =
=
choice
.
value
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
{%
if
self
.
student_choice =
=
choice
.
value
and
not
hide_prev_answer
%}
checked
{%
else
%}
data-student-choice=
'{{self.student_choice}}'
{%
endif
%}
/>
</div>
<label
class=
"choice-label"
for=
"choice-{{ self.html_id }}-custom{{ forloop.counter }}"
>
...
...
problem_builder/tests/integration/test_step_builder.py
View file @
b542f0c5
...
...
@@ -425,6 +425,9 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
None
,
step_builder
,
controls
,
'This is a different answer'
,
CORRECT
,
saved_value
=
'This is the answer'
)
# Step 2
# Reload the page, which should have no effect
self
.
browser
.
execute_script
(
"$(document).html(' ');"
)
step_builder
,
controls
=
self
.
go_to_assessment
()
# Submit MCQ, go to next step
self
.
single_choice_question
(
None
,
step_builder
,
controls
,
'Yes'
,
CORRECT
)
# Step 3
...
...
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