mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 00:43:34 -04:00
Add aggregate student progress to course details page
This commit is contained in:
parent
14b4b83148
commit
59c730ef20
3 changed files with 32 additions and 1 deletions
app
styles/courses/mock1
templates/courses/mock1
views/courses/mock1
|
@ -1,5 +1,17 @@
|
||||||
#course-details-view
|
#course-details-view
|
||||||
|
|
||||||
|
.concept-completion-container
|
||||||
|
position: relative
|
||||||
|
.concept-completion-background
|
||||||
|
position: absolute
|
||||||
|
height: 100%
|
||||||
|
left: 0px
|
||||||
|
top: 0px
|
||||||
|
background-color: blue
|
||||||
|
opacity: 0.25
|
||||||
|
.concept-completed-foreground
|
||||||
|
font-size: 12pt
|
||||||
|
|
||||||
#editDescriptionModal .modal-dialog
|
#editDescriptionModal .modal-dialog
|
||||||
background-color: white
|
background-color: white
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ block content
|
||||||
//- DO NOT localize / i18n
|
//- DO NOT localize / i18n
|
||||||
|
|
||||||
div TODO: fix ugly tabs
|
div TODO: fix ugly tabs
|
||||||
div TODO: aggregate student progress
|
|
||||||
div TODO: student level progress popups
|
div TODO: student level progress popups
|
||||||
div
|
div
|
||||||
span *UNDER CONSTRUCTION, send feedback to
|
span *UNDER CONSTRUCTION, send feedback to
|
||||||
|
@ -91,6 +90,18 @@ block content
|
||||||
if !studentMode
|
if !studentMode
|
||||||
.tab-pane.active#progress(role='tabpanel')
|
.tab-pane.active#progress(role='tabpanel')
|
||||||
if instance.students
|
if instance.students
|
||||||
|
h3 % Completed by Class
|
||||||
|
table.table.table-condensed
|
||||||
|
each concept in courseConcepts
|
||||||
|
- var conceptCompletion = Math.round(parseFloat(conceptsCompleted[concept]) / instance.students.length * 100)
|
||||||
|
if isNaN(conceptCompletion)
|
||||||
|
- conceptCompletion = 0
|
||||||
|
tr
|
||||||
|
td.concept-completion-container
|
||||||
|
span.concept-completed-foreground(data-i18n="concepts." + concept)
|
||||||
|
span.spl - #{conceptCompletion}%
|
||||||
|
span.concept-completion-background(style="width:#{conceptCompletion}%;")
|
||||||
|
br
|
||||||
table.table.table-condensed
|
table.table.table-condensed
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
|
|
|
@ -39,6 +39,14 @@ module.exports = class CourseDetailsView extends RootView
|
||||||
context.userLevelStateMap = @userLevelStateMap ? {}
|
context.userLevelStateMap = @userLevelStateMap ? {}
|
||||||
context.showExpandedProgress = @course.levels.length <= 30 or @showExpandedProgress
|
context.showExpandedProgress = @course.levels.length <= 30 or @showExpandedProgress
|
||||||
context.studentMode = @options.studentMode ? false
|
context.studentMode = @options.studentMode ? false
|
||||||
|
|
||||||
|
conceptsCompleted = {}
|
||||||
|
for user of context.userConceptsMap
|
||||||
|
for concept of context.userConceptsMap[user]
|
||||||
|
conceptsCompleted[concept] ?= 0
|
||||||
|
conceptsCompleted[concept]++
|
||||||
|
context.conceptsCompleted = conceptsCompleted
|
||||||
|
|
||||||
context
|
context
|
||||||
|
|
||||||
initData: ->
|
initData: ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue