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
af21bbcf
Commit
af21bbcf
authored
Feb 26, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MCQ showing empty tip box even if no tips exist
parent
349b58bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
mentoring/components/mcq.py
+5
-6
mentoring/components/mrq.py
+0
-2
No files found.
mentoring/components/mcq.py
View file @
af21bbcf
...
@@ -74,17 +74,16 @@ class MCQBlock(QuestionnaireAbstractBlock):
...
@@ -74,17 +74,16 @@ class MCQBlock(QuestionnaireAbstractBlock):
if
submission
in
tip
.
values
:
if
submission
in
tip
.
values
:
tips_html
.
append
(
tip
.
render
(
'mentoring_view'
)
.
content
)
tips_html
.
append
(
tip
.
render
(
'mentoring_view'
)
.
content
)
formatted_tips
=
ResourceLoader
(
__name__
)
.
render_template
(
'templates/html/tip_choice_group.html'
,
{
if
tips_html
:
'self'
:
self
,
formatted_tips
=
ResourceLoader
(
__name__
)
.
render_template
(
'templates/html/tip_choice_group.html'
,
{
'tips_html'
:
tips_html
,
'tips_html'
:
tips_html
,
'completed'
:
correct
,
})
})
self
.
student_choice
=
submission
self
.
student_choice
=
submission
result
=
{
result
=
{
'submission'
:
submission
,
'submission'
:
submission
,
'status'
:
'correct'
if
correct
else
'incorrect'
,
'status'
:
'correct'
if
correct
else
'incorrect'
,
'tips'
:
formatted_tips
,
'tips'
:
formatted_tips
if
tips_html
else
None
,
'weight'
:
self
.
weight
,
'weight'
:
self
.
weight
,
'score'
:
1
if
correct
else
0
,
'score'
:
1
if
correct
else
0
,
}
}
...
...
mentoring/components/mrq.py
View file @
af21bbcf
...
@@ -103,9 +103,7 @@ class MRQBlock(QuestionnaireAbstractBlock):
...
@@ -103,9 +103,7 @@ class MRQBlock(QuestionnaireAbstractBlock):
loader
=
ResourceLoader
(
__name__
)
loader
=
ResourceLoader
(
__name__
)
choice_result
[
'completed'
]
=
choice_completed
choice_result
[
'completed'
]
=
choice_completed
choice_result
[
'tips'
]
=
loader
.
render_template
(
'templates/html/tip_choice_group.html'
,
{
choice_result
[
'tips'
]
=
loader
.
render_template
(
'templates/html/tip_choice_group.html'
,
{
'self'
:
self
,
'tips_html'
:
choice_tips_html
,
'tips_html'
:
choice_tips_html
,
'completed'
:
choice_completed
,
})
})
results
.
append
(
choice_result
)
results
.
append
(
choice_result
)
...
...
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