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
162c74e9
Commit
162c74e9
authored
Apr 28, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the bug
parent
13e52786
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
problem_builder/mentoring.py
+13
-5
No files found.
problem_builder/mentoring.py
View file @
162c74e9
...
@@ -376,15 +376,24 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
...
@@ -376,15 +376,24 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
return
{
'result'
:
'ok'
}
return
{
'result'
:
'ok'
}
def
get_message
(
self
,
completed
):
def
get_message
(
self
,
completed
):
if
self
.
max_attempts_reached
:
"""
return
self
.
get_message_html
(
'max_attempts_reached'
)
Get the message to display to a student following a submission in normal mode.
elif
completed
:
"""
if
completed
:
# Student has achieved a perfect score
return
self
.
get_message_html
(
'completed'
)
return
self
.
get_message_html
(
'completed'
)
elif
self
.
max_attempts_reached
:
# Student has not achieved a perfect score and cannot try again
return
self
.
get_message_html
(
'max_attempts_reached'
)
else
:
else
:
# Student did not achieve a perfect score but can try again:
return
self
.
get_message_html
(
'incomplete'
)
return
self
.
get_message_html
(
'incomplete'
)
@property
@property
def
assessment_message
(
self
):
def
assessment_message
(
self
):
"""
Get the message to display to a student following a submission in assessment mode.
"""
if
not
self
.
max_attempts_reached
:
if
not
self
.
max_attempts_reached
:
return
self
.
get_message_html
(
'on-assessment-review'
)
return
self
.
get_message_html
(
'on-assessment-review'
)
else
:
else
:
...
@@ -475,8 +484,6 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
...
@@ -475,8 +484,6 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
child
.
save
()
child
.
save
()
completed
=
completed
and
(
child_result
[
'status'
]
==
'correct'
)
completed
=
completed
and
(
child_result
[
'status'
]
==
'correct'
)
message
=
self
.
get_message
(
completed
)
# Once it has been completed once, keep completion even if user changes values
# Once it has been completed once, keep completion even if user changes values
if
self
.
completed
:
if
self
.
completed
:
completed
=
True
completed
=
True
...
@@ -509,6 +516,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
...
@@ -509,6 +516,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
self
.
completed
=
completed
is
True
self
.
completed
=
completed
is
True
message
=
self
.
get_message
(
completed
)
raw_score
=
self
.
score
.
raw
raw_score
=
self
.
score
.
raw
self
.
runtime
.
publish
(
self
,
'xblock.problem_builder.submitted'
,
{
self
.
runtime
.
publish
(
self
,
'xblock.problem_builder.submitted'
,
{
...
...
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