mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Add Recommendation Handling
This commit is contained in:
parent
38e4262f80
commit
088dcea34f
2 changed files with 41 additions and 36 deletions
|
@ -48,45 +48,49 @@ block content
|
|||
span(data-i18n="TODO") Our Recommendation
|
||||
.recommendation(style="width:100%")
|
||||
|
||||
// get view.courseComparisonMap
|
||||
// warn = [] -- push course name when -2
|
||||
// great = []-- push course name when +2
|
||||
// good = [] -- push course name when +/- 1
|
||||
// for all courses in courseComparisonMap
|
||||
// get perf, push course to one of the three arrays based on value
|
||||
- var warn = []
|
||||
- var great = []
|
||||
- var good = []
|
||||
each course in view.courseComparisonMap || []
|
||||
if (Math.abs(course.performance)) == 1
|
||||
- good.push(course.courseName)
|
||||
else if (course.performance) >= 2
|
||||
- great.push(course.courseName)
|
||||
else if (course.performance) <= -2
|
||||
- warn.push(course.courseName)
|
||||
|
||||
|
||||
// only display if warn.length > 0
|
||||
div(class="glyphicon glyphicon-exclamation-sign")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") might need some help in the following courses:
|
||||
// stringfy course names from warn[]
|
||||
.warn Computer Science 1, Web Development 1
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes for these courses indicate that they might need some help with new concepts that are introduced.
|
||||
if warn.length > 0
|
||||
div(class="glyphicon glyphicon-exclamation-sign")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") might need some help in the following courses:
|
||||
.warn
|
||||
span= warn.join(', ')
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes for these courses indicate that they might need some help with new concepts that are introduced.
|
||||
|
||||
// only display if great.length > 0
|
||||
div(class="glyphicon glyphicon-star", style="")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") is exceeding expectations in the following courses:
|
||||
// stringfy course names from great[]
|
||||
.great Computer Science 1, Web Development 1
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes for these courses indicate that they might be a good candidate to help other students in this class.
|
||||
if great.length > 0
|
||||
div(class="glyphicon glyphicon-star", style="")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") is doing great in the following courses:
|
||||
.great
|
||||
span= great.join(', ')
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes for these courses indicate that they might be a good candidate to help other students in this class.
|
||||
|
||||
// only display if good.length > 0
|
||||
div(class="glyphicon glyphicon-thumbs-up")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") is doing great!
|
||||
// also stringfy course names from good[]? not sure.
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes indicate that they are keeping pace with this class’s average playtimes for each course.
|
||||
if good.length > 0
|
||||
div(class="glyphicon glyphicon-thumbs-up")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
strong
|
||||
span.spr= view.user.get('name')
|
||||
span(data-i18n="TODO") is doing well!
|
||||
.status
|
||||
span(data-i18n="TODO") This student’s level playtimes indicate that they are keeping pace with this class’s average playtimes for the following courses:
|
||||
.good
|
||||
span= good.join(', ')
|
||||
|
||||
.playtime-charts
|
||||
h4(data-i18n="teacher.playtime_detail")
|
||||
|
|
|
@ -119,6 +119,7 @@ module.exports = class TeacherStudentView extends RootView
|
|||
|
||||
@courseComparisonMap.push {
|
||||
courseID: course.get('_id')
|
||||
courseName: course.get('name')
|
||||
studentCourseTotal: studentCourseTotal
|
||||
standardDev: StandardDev
|
||||
mean: mean
|
||||
|
|
Loading…
Reference in a new issue