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
db9bed59
Commit
db9bed59
authored
Aug 31, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return message instead of template from get_message.
parent
cd2304e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
problem_builder/mentoring.py
+6
-8
No files found.
problem_builder/mentoring.py
View file @
db9bed59
...
...
@@ -407,13 +407,13 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
"""
if
completed
:
# Student has achieved a perfect score
return
self
.
get_message_
html
(
'completed'
)
return
self
.
get_message_
content
(
'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'
)
return
self
.
get_message_
content
(
'max_attempts_reached'
)
else
:
# Student did not achieve a perfect score but can try again:
return
self
.
get_message_
html
(
'incomplete'
)
return
self
.
get_message_
content
(
'incomplete'
)
@property
def
assessment_message
(
self
):
...
...
@@ -421,7 +421,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
Get the message to display to a student following a submission in assessment mode.
"""
if
not
self
.
max_attempts_reached
:
return
self
.
get_message_
html
(
'on-assessment-review'
)
return
self
.
get_message_
content
(
'on-assessment-review'
)
else
:
return
None
...
...
@@ -689,13 +689,11 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
def
max_attempts_reached
(
self
):
return
self
.
max_attempts
>
0
and
self
.
num_attempts
>=
self
.
max_attempts
def
get_message_html
(
self
,
message_type
):
html
=
u""
def
get_message_content
(
self
,
message_type
):
for
child_id
in
self
.
children
:
child
=
self
.
runtime
.
get_block
(
child_id
)
if
isinstance
(
child
,
MentoringMessageBlock
)
and
child
.
type
==
message_type
:
html
+=
child
.
render
(
'mentoring_view'
,
{})
.
content
# TODO: frament_text_rewriting ?
return
html
return
child
.
content
def
validate
(
self
):
"""
...
...
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