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
dfec4fa7
Commit
dfec4fa7
authored
Nov 02, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address initial review comments, fix bug with perfect_score
parent
cc9498cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
problem_builder/public/js/mentoring_with_steps.js
+1
-1
problem_builder/step_review.py
+7
-4
problem_builder/templates/html/sb-review-per-question-feedback.html
+1
-1
No files found.
problem_builder/public/js/mentoring_with_steps.js
View file @
dfec4fa7
...
...
@@ -22,7 +22,7 @@ function MentoringWithStepsBlock(runtime, element, params) {
var
message
=
$
(
'.sb-step-message'
,
element
);
var
checkmark
,
submitDOM
,
nextDOM
,
reviewButtonDOM
,
tryAgainDOM
,
gradeDOM
,
attemptsDOM
,
reviewLinkDOM
,
submitXHR
;
var
reviewStepDOM
=
$
(
"[data-block-type=sb-review-step]"
,
element
);
var
reviewStepDOM
=
$
(
"
div.xblock[data-block-type=sb-review-step], div.xblock-v1
[data-block-type=sb-review-step]"
,
element
);
var
hasAReviewStep
=
reviewStepDOM
.
length
==
1
;
function
isLastStep
()
{
...
...
problem_builder/step_review.py
View file @
dfec4fa7
...
...
@@ -100,7 +100,7 @@ class ConditionalMessageBlock(
):
return
False
perfect_score
=
(
score_summary
[
'incorrect
'
]
==
0
and
score_summary
[
'partial
'
]
==
0
)
perfect_score
=
(
score_summary
[
'incorrect
_answers'
]
==
0
and
score_summary
[
'partially_correct_answers
'
]
==
0
)
if
(
(
self
.
score_condition
==
self
.
SCORE_PERFECT
and
not
perfect_score
)
or
(
self
.
score_condition
==
self
.
SCORE_IMPERFECT
and
perfect_score
)
...
...
@@ -109,7 +109,7 @@ class ConditionalMessageBlock(
return
True
def
student_view
(
self
,
context
=
None
):
def
student_view
(
self
,
_
context
=
None
):
""" Render this message. """
html
=
u'<div class="review-conditional-message">{content}</div>'
.
format
(
content
=
self
.
content
...
...
@@ -136,7 +136,7 @@ class ConditionalMessageBlock(
@XBlock.needs
(
"i18n"
)
class
ScoreSummaryBlock
(
XBlockWithTranslationServiceMixin
,
XBlockWithPreviewMixin
,
XBlock
):
"""
Summar
y
ize the score that the student earned.
Summarize the score that the student earned.
"""
CATEGORY
=
'sb-review-score'
STUDIO_LABEL
=
_
(
"Score Summary"
)
...
...
@@ -148,12 +148,14 @@ class ScoreSummaryBlock(XBlockWithTranslationServiceMixin, XBlockWithPreviewMixi
def
student_view
(
self
,
context
=
None
):
""" Render the score summary message. """
context
=
context
or
{}
html
=
loader
.
render_template
(
"templates/html/sb-review-score.html"
,
context
.
get
(
"score_summary"
,
{}))
return
Fragment
(
html
)
mentoring_view
=
student_view
# Same as student_view but Studio won't wrap it with the editing header/buttons
def
author_view
(
self
,
context
=
None
):
context
=
context
or
{}
if
not
context
.
get
(
"score_summary"
):
context
[
"score_summary"
]
=
{
'score'
:
75
,
...
...
@@ -199,6 +201,7 @@ class PerQuestionFeedbackBlock(XBlockWithTranslationServiceMixin, XBlockWithPrev
def
author_view
(
self
,
context
=
None
):
""" Show example content in Studio """
context
=
context
or
{}
if
not
context
.
get
(
"per_question_review_tips"
):
example
=
self
.
_
(
"(Example tip:) Since you got Question 1 wrong, review Chapter 12 of your textbook."
)
context
[
"score_summary"
]
=
{
"review_tips"
:
[
example
]}
...
...
@@ -270,7 +273,7 @@ class ReviewStepBlock(
mentoring_view
=
student_view
def
studio_view
(
self
,
context
=
None
):
def
studio_view
(
self
,
_
context
=
None
):
""" Studio View """
return
Fragment
(
u'<p>{}</p>'
.
format
(
self
.
_
(
"This XBlock does not have any settings."
)))
...
...
problem_builder/templates/html/sb-review-per-question-feedback.html
View file @
dfec4fa7
{% load i18n %}
<!-- Tips about specific questions the student got wrong. From pb-message[type=on-assessment-review-question] blocks -->
{# Tips about specific questions the student got wrong. From pb-message[type=on-assessment-review-question] blocks #}
<p
class=
"review-tips-intro"
>
{% trans "You might consider reviewing the following items before your next assessment attempt:" %}
</p>
<ul
class=
"review-tips-list"
>
{% for tip in tips %}
...
...
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