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
1db52e84
Commit
1db52e84
authored
Dec 23, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #93 from open-craft/explain-review-links
Step Builder: Explain review links to users
parents
67d75634
71016a47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
problem_builder/templates/html/sb-review-score.html
+5
-0
problem_builder/tests/integration/test_step_builder.py
+15
-4
No files found.
problem_builder/templates/html/sb-review-score.html
View file @
1db52e84
...
...
@@ -3,6 +3,11 @@
<div
class=
"sb-review-score"
>
<div
class=
"grade-result"
>
<h2>
{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %}
</h2>
{% if show_extended_review %}
<p
class=
"review-links-explanation"
>
{% trans "Click a question to review feedback on your response." %}
</p>
{% endif %}
{% if is_example %}
<p><em>
{% trans "Note: This is an example score, to show how the review step will look." %}
</em></p>
{% endif %}
...
...
problem_builder/tests/integration/test_step_builder.py
View file @
1db52e84
from
mock
import
patch
from
ddt
import
ddt
,
data
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.webdriver.support.ui
import
WebDriverWait
from
workbench.runtime
import
WorkbenchRuntime
...
...
@@ -242,27 +243,37 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
self
.
assertIn
(
"You answered {incorrect} questions incorrectly."
.
format
(
**
expected
),
step_builder
.
text
)
# Check presence of review links
# - If unlimited attempts: no review links
# - If unlimited attempts: no review links
, no explanation
# - If limited attempts:
# - If not max attempts reached: no review links
# - If not max attempts reached: no review links
, no explanation
# - If max attempts reached:
# - If extended feedback: review links
available
# - If not extended feedback:
review links
# - If extended feedback: review links
, explanation
# - If not extended feedback:
no review links, no explanation
review_list
=
step_builder
.
find_elements_by_css_selector
(
'.review-list'
)
try
:
step_builder
.
find_element_by_css_selector
(
'.review-links-explanation'
)
except
NoSuchElementException
:
review_links_explained
=
False
else
:
review_links_explained
=
True
if
expected
[
"max_attempts"
]
==
0
:
self
.
assertFalse
(
review_list
)
self
.
assertFalse
(
review_links_explained
)
else
:
if
expected
[
"num_attempts"
]
<
expected
[
"max_attempts"
]:
self
.
assertFalse
(
review_list
)
self
.
assertFalse
(
review_links_explained
)
elif
expected
[
"num_attempts"
]
==
expected
[
"max_attempts"
]:
if
extended_feedback
:
for
correctness
in
[
'correct'
,
'incorrect'
,
'partial'
]:
review_items
=
step_builder
.
find_elements_by_css_selector
(
'.
%
s-list li'
%
correctness
)
self
.
assertEqual
(
len
(
review_items
),
expected
[
correctness
])
self
.
assertTrue
(
review_links_explained
)
else
:
self
.
assertFalse
(
review_list
)
self
.
assertFalse
(
review_links_explained
)
# Check if info about number of attempts used is correct
if
expected
[
"max_attempts"
]
==
1
:
...
...
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