Add Recommendation Handling

This commit is contained in:
ryang217 2016-09-23 08:06:54 -07:00
parent 38e4262f80
commit 088dcea34f
2 changed files with 41 additions and 36 deletions

View file

@ -48,45 +48,49 @@ block content
span(data-i18n="TODO") Our Recommendation span(data-i18n="TODO") Our Recommendation
.recommendation(style="width:100%") .recommendation(style="width:100%")
// get view.courseComparisonMap - var warn = []
// warn = [] -- push course name when -2 - var great = []
// great = []-- push course name when +2 - var good = []
// good = [] -- push course name when +/- 1 each course in view.courseComparisonMap || []
// for all courses in courseComparisonMap if (Math.abs(course.performance)) == 1
// get perf, push course to one of the three arrays based on value - good.push(course.courseName)
else if (course.performance) >= 2
- great.push(course.courseName)
else if (course.performance) <= -2
- warn.push(course.courseName)
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 students level playtimes for these courses indicate that they might need some help with new concepts that are introduced.
// only display if warn.length > 0 if great.length > 0
div(class="glyphicon glyphicon-exclamation-sign") div(class="glyphicon glyphicon-star", style="")
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" ) div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
strong strong
span.spr= view.user.get('name') span.spr= view.user.get('name')
span(data-i18n="TODO") might need some help in the following courses: span(data-i18n="TODO") is doing great in the following courses:
// stringfy course names from warn[] .great
.warn Computer Science 1, Web Development 1 span= great.join(', ')
.status .status
span(data-i18n="TODO") This students level playtimes for these courses indicate that they might need some help with new concepts that are introduced. span(data-i18n="TODO") This students level playtimes for these courses indicate that they might be a good candidate to help other students in this class.
// only display if great.length > 0 if good.length > 0
div(class="glyphicon glyphicon-star", style="") div(class="glyphicon glyphicon-thumbs-up")
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" ) div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
strong strong
span.spr= view.user.get('name') span.spr= view.user.get('name')
span(data-i18n="TODO") is exceeding expectations in the following courses: span(data-i18n="TODO") is doing well!
// stringfy course names from great[] .status
.great Computer Science 1, Web Development 1 span(data-i18n="TODO") This students level playtimes indicate that they are keeping pace with this classs average playtimes for the following courses:
.status .good
span(data-i18n="TODO") This students level playtimes for these courses indicate that they might be a good candidate to help other students in this class. span= good.join(', ')
// 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 students level playtimes indicate that they are keeping pace with this classs average playtimes for each course.
.playtime-charts .playtime-charts
h4(data-i18n="teacher.playtime_detail") h4(data-i18n="teacher.playtime_detail")

View file

@ -119,6 +119,7 @@ module.exports = class TeacherStudentView extends RootView
@courseComparisonMap.push { @courseComparisonMap.push {
courseID: course.get('_id') courseID: course.get('_id')
courseName: course.get('name')
studentCourseTotal: studentCourseTotal studentCourseTotal: studentCourseTotal
standardDev: StandardDev standardDev: StandardDev
mean: mean mean: mean