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
755ba357
Commit
755ba357
authored
Nov 02, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix extended review
parent
cf68d838
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
29 deletions
+27
-29
problem_builder/mentoring.py
+21
-20
problem_builder/public/js/mentoring_with_steps.js
+2
-6
problem_builder/step_review.py
+1
-0
problem_builder/templates/html/sb-review-score.html
+3
-3
No files found.
problem_builder/mentoring.py
View file @
755ba357
...
@@ -175,22 +175,6 @@ class BaseMentoringBlock(
...
@@ -175,22 +175,6 @@ class BaseMentoringBlock(
for
theme_file
in
theme_files
:
for
theme_file
in
theme_files
:
fragment
.
add_css
(
ResourceLoader
(
theme_package
)
.
load_unicode
(
theme_file
))
fragment
.
add_css
(
ResourceLoader
(
theme_package
)
.
load_unicode
(
theme_file
))
def
feedback_dispatch
(
self
,
target_data
,
stringify
):
if
self
.
show_extended_feedback
():
if
stringify
:
return
json
.
dumps
(
target_data
)
else
:
return
target_data
def
correct_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
correct
,
stringify
)
def
incorrect_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
incorrect
,
stringify
)
def
partial_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
partially_correct
,
stringify
)
@XBlock.json_handler
@XBlock.json_handler
def
view
(
self
,
data
,
suffix
=
''
):
def
view
(
self
,
data
,
suffix
=
''
):
"""
"""
...
@@ -675,6 +659,22 @@ class MentoringBlock(BaseMentoringBlock, StudioContainerXBlockMixin, StepParentM
...
@@ -675,6 +659,22 @@ class MentoringBlock(BaseMentoringBlock, StudioContainerXBlockMixin, StepParentM
'num_attempts'
:
self
.
num_attempts
,
'num_attempts'
:
self
.
num_attempts
,
}
}
def
feedback_dispatch
(
self
,
target_data
,
stringify
):
if
self
.
show_extended_feedback
():
if
stringify
:
return
json
.
dumps
(
target_data
)
else
:
return
target_data
def
correct_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
correct
,
stringify
)
def
incorrect_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
incorrect
,
stringify
)
def
partial_json
(
self
,
stringify
=
True
):
return
self
.
feedback_dispatch
(
self
.
score
.
partially_correct
,
stringify
)
def
handle_assessment_submit
(
self
,
submissions
,
suffix
):
def
handle_assessment_submit
(
self
,
submissions
,
suffix
):
completed
=
False
completed
=
False
current_child
=
None
current_child
=
None
...
@@ -979,7 +979,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
...
@@ -979,7 +979,7 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
return
review_tips
return
review_tips
def
show_extended_feedback
(
self
):
def
show_extended_feedback
(
self
):
return
self
.
extended_feedback
return
self
.
extended_feedback
and
self
.
max_attempts_reached
def
student_view
(
self
,
context
):
def
student_view
(
self
,
context
):
fragment
=
Fragment
()
fragment
=
Fragment
()
...
@@ -1087,11 +1087,12 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
...
@@ -1087,11 +1087,12 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
'correct_answers'
:
len
(
score
.
correct
),
'correct_answers'
:
len
(
score
.
correct
),
'incorrect_answers'
:
len
(
score
.
incorrect
),
'incorrect_answers'
:
len
(
score
.
incorrect
),
'partially_correct_answers'
:
len
(
score
.
partially_correct
),
'partially_correct_answers'
:
len
(
score
.
partially_correct
),
'correct'
:
s
elf
.
correct_json
(
stringify
=
False
)
,
'correct'
:
s
core
.
correct
,
'incorrect'
:
s
elf
.
incorrect_json
(
stringify
=
False
)
,
'incorrect'
:
s
core
.
incorrect
,
'partial'
:
s
elf
.
partial_json
(
stringify
=
False
)
,
'partial'
:
s
core
.
partially_correct
,
'complete'
:
self
.
complete
,
'complete'
:
self
.
complete
,
'max_attempts_reached'
:
self
.
max_attempts_reached
,
'max_attempts_reached'
:
self
.
max_attempts_reached
,
'show_extended_review'
:
self
.
show_extended_feedback
(),
'review_tips'
:
self
.
review_tips
,
'review_tips'
:
self
.
review_tips
,
}
}
...
...
problem_builder/public/js/mentoring_with_steps.js
View file @
755ba357
function
MentoringWithStepsBlock
(
runtime
,
element
,
params
)
{
function
MentoringWithStepsBlock
(
runtime
,
element
)
{
// Set up gettext in case it isn't available in the client runtime:
// Set up gettext in case it isn't available in the client runtime:
if
(
typeof
gettext
==
"undefined"
)
{
if
(
typeof
gettext
==
"undefined"
)
{
...
@@ -41,10 +41,6 @@ function MentoringWithStepsBlock(runtime, element, params) {
...
@@ -41,10 +41,6 @@ function MentoringWithStepsBlock(runtime, element, params) {
return
(
data
.
num_attempts
<
data
.
max_attempts
);
return
(
data
.
num_attempts
<
data
.
max_attempts
);
}
}
function
extendedFeedbackEnabled
()
{
return
!!
(
params
.
extended_feedback
);
// Show extended feedback when all attempts are used up?
}
function
showFeedback
(
response
)
{
function
showFeedback
(
response
)
{
if
(
response
.
step_status
===
'correct'
)
{
if
(
response
.
step_status
===
'correct'
)
{
checkmark
.
addClass
(
'checkmark-correct icon-ok fa-check'
);
checkmark
.
addClass
(
'checkmark-correct icon-ok fa-check'
);
...
@@ -419,7 +415,7 @@ function MentoringWithStepsBlock(runtime, element, params) {
...
@@ -419,7 +415,7 @@ function MentoringWithStepsBlock(runtime, element, params) {
reviewLinkDOM
.
on
(
'click'
,
showGrade
);
reviewLinkDOM
.
on
(
'click'
,
showGrade
);
// Add click handler that takes care of links to steps on the extended review:
// Add click handler that takes care of links to steps on the extended review:
$
(
'a.step-link'
,
element
).
on
(
'clic
k'
,
getStepToReview
);
$
(
element
).
on
(
'click'
,
'a.step-lin
k'
,
getStepToReview
);
// Initialize individual steps
// Initialize individual steps
// (sets up click handlers for questions and makes sure answer data is up-to-date)
// (sets up click handlers for questions and makes sure answer data is up-to-date)
...
...
problem_builder/step_review.py
View file @
755ba357
...
@@ -166,6 +166,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
...
@@ -166,6 +166,7 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
'partial'
:
[],
'partial'
:
[],
'complete'
:
True
,
'complete'
:
True
,
'max_attempts_reached'
:
False
,
'max_attempts_reached'
:
False
,
'show_extended_review'
:
False
,
'is_example'
:
True
,
'is_example'
:
True
,
}
}
...
...
problem_builder/templates/html/sb-review-score.html
View file @
755ba357
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
{% for question in correct %}
{% for question in correct %}
<li>
<li>
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
%}Question {{question.
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and correct|length > 2 %},{%endif%}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
with number=question.number %}Question {{
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and correct|length > 2 %},{%endif%}
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
{% for question in partial %}
{% for question in partial %}
<li>
<li>
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
%}Question {{question.
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and partial|length > 2 %},{%endif%}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
with number=question.number %}Question {{
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and partial|length > 2 %},{%endif%}
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
{% for question in incorrect %}
{% for question in incorrect %}
<li>
<li>
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
{% if forloop.last and not forloop.first %} {% trans "and" %} {% endif %}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
%}Question {{question.
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and incorrect|length > 2 %},{%endif%}
<a
href=
"#"
class=
"step-link"
data-step=
"{{ question.step }}"
>
{% blocktrans
with number=question.number %}Question {{
number}}{% endblocktrans %}
</a>
{% if forloop.revcounter > 1 and incorrect|length > 2 %},{%endif%}
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
...
...
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