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
771348e6
Commit
771348e6
authored
Mar 31, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: never color a row when there's no answer submitted
parent
9a795674
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
mentoring/dashboard.py
+5
-2
No files found.
mentoring/dashboard.py
View file @
771348e6
...
...
@@ -301,10 +301,13 @@ class DashboardBlock(StudioEditableXBlockMixin, XBlock):
block
[
'mcqs'
]
.
append
({
"display_name"
:
mcq_block
.
question
,
"value"
:
value
,
"color"
:
self
.
color_for_value
(
value
),
"color"
:
self
.
color_for_value
(
value
)
if
value
is
not
None
else
None
,
})
# If the values are numeric, display an average:
numeric_values
=
[
float
(
mcq
[
'value'
])
for
mcq
in
block
[
'mcqs'
]
if
mcq
[
'value'
]
and
mcq
[
'value'
]
.
isnumeric
()]
numeric_values
=
[
float
(
mcq
[
'value'
])
for
mcq
in
block
[
'mcqs'
]
if
mcq
[
'value'
]
is
not
None
and
mcq
[
'value'
]
.
isnumeric
()
]
if
numeric_values
:
average_value
=
sum
(
numeric_values
)
/
len
(
numeric_values
)
block
[
'average'
]
=
average_value
...
...
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