mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Display recommendation for latest course
This commit is contained in:
parent
088dcea34f
commit
e89d9697ee
3 changed files with 72 additions and 47 deletions
|
@ -13,16 +13,23 @@
|
|||
|
||||
.performance
|
||||
.recommendation
|
||||
border-radius: 10px
|
||||
background: #F8F8F8
|
||||
padding: 20px
|
||||
// border-radius: 10px
|
||||
// background: #F8F8F8
|
||||
// padding: 20px
|
||||
.small-details
|
||||
line-height: 20px
|
||||
font-weight: 600
|
||||
|
||||
.good
|
||||
font-weight: 600
|
||||
color: #000
|
||||
|
||||
.warn
|
||||
font-weight: bold
|
||||
font-weight: 600
|
||||
color: $navy
|
||||
|
||||
.great
|
||||
font-weight: bold
|
||||
font-weight: 600
|
||||
color: $forest
|
||||
|
||||
.glyphicon
|
||||
|
@ -42,17 +49,9 @@
|
|||
color: $navy
|
||||
font-size: 2em
|
||||
|
||||
|
||||
.status
|
||||
margin-bottom: 20px
|
||||
|
||||
|
||||
|
||||
.small-details
|
||||
line-height: 20px
|
||||
|
||||
strong
|
||||
font-weight: 600
|
||||
font-weight: normal
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -47,12 +47,48 @@ block content
|
|||
h4.student-details
|
||||
span(data-i18n="TODO") Our Recommendation
|
||||
.recommendation(style="width:100%")
|
||||
|
||||
//- - console.log ("here")
|
||||
if view.courseComparisonMap && view.lastPlayedCourse
|
||||
//- - console.log (view.courseComparisonMap)
|
||||
- var lastCoursePerf = _.find(view.courseComparisonMap, { courseID: view.lastPlayedCourse.id })
|
||||
- console.log (lastCoursePerf)
|
||||
if (Math.abs(lastCoursePerf.performance)) <= 1
|
||||
// good
|
||||
div(class="glyphicon glyphicon-thumbs-up")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
.good= view.user.get('name')
|
||||
span.spr
|
||||
span.spr(data-i18n="TODO") is doing well in
|
||||
span= lastCoursePerf.courseName
|
||||
.status(data-i18n="TODO") This student is keeping pace with the class.
|
||||
else if (lastCoursePerf.performance) >= 2
|
||||
// great
|
||||
div(class="glyphicon glyphicon-star", style="")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
.great= view.user.get('name')
|
||||
span.spr
|
||||
span.spr(data-i18n="TODO") is doing great in
|
||||
span= lastCoursePerf.courseName
|
||||
.status(data-i18n="TODO") This student might be a good candidate to help other students working through this course.
|
||||
else if (lastCoursePerf.performance) <= -2
|
||||
// warn
|
||||
div(class="glyphicon glyphicon-exclamation-sign")
|
||||
div(class="small-details", style="padding:0 15px 0 60px; width: 94%" )
|
||||
.warn= view.user.get('name')
|
||||
span.spr
|
||||
span.spr(data-i18n="TODO") might need some help in
|
||||
span= lastCoursePerf.courseName
|
||||
.status(data-i18n="TODO") This student might need some help with new concepts that have been introduced in this course.
|
||||
|
||||
.additional_progress
|
||||
.small-details
|
||||
strong(data-i18n="TODO") Past Performance
|
||||
- var warn = []
|
||||
- var great = []
|
||||
- var good = []
|
||||
- console.log (view.courseComparisonMap)
|
||||
each course in view.courseComparisonMap || []
|
||||
if (Math.abs(course.performance)) == 1
|
||||
if (Math.abs(course.performance)) <= 1
|
||||
- good.push(course.courseName)
|
||||
else if (course.performance) >= 2
|
||||
- great.push(course.courseName)
|
||||
|
@ -60,38 +96,23 @@ block content
|
|||
- 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 student’s level playtimes for these courses indicate that they might need some help with new concepts that are introduced.
|
||||
.small-details
|
||||
span.glyphicon.glyphicon-exclamation-sign
|
||||
span.spr
|
||||
span= warn.join(', ')
|
||||
|
||||
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.
|
||||
.small-details
|
||||
span.glyphicon.glyphicon-star
|
||||
span.spr
|
||||
span= great.join(', ')
|
||||
|
||||
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(', ')
|
||||
|
||||
.small-details
|
||||
span.glyphicon.glyphicon-thumbs-up
|
||||
span.spr
|
||||
span= good.join(', ')
|
||||
|
||||
.playtime-charts
|
||||
h4(data-i18n="teacher.playtime_detail")
|
||||
|
||||
|
@ -100,7 +121,7 @@ block content
|
|||
span :
|
||||
span.spr
|
||||
select#course-dropdown.text-navy
|
||||
each versionedCourse in view.classroom.get('courses') || []
|
||||
each versionedCourse in (view.classroom.get('courses') || [])
|
||||
- var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
||||
if !course
|
||||
// TODO: make sure this doesn't happen when data is loaded.
|
||||
|
@ -123,7 +144,7 @@ block content
|
|||
span(data-i18n="teacher.class_average")
|
||||
|
||||
.graphs
|
||||
each versionedCourse in view.classroom.get('courses') || []
|
||||
each versionedCourse in (view.classroom.get('courses') || [])
|
||||
- var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
||||
if !course
|
||||
- continue;
|
||||
|
@ -142,7 +163,7 @@ block content
|
|||
.student-levels
|
||||
h4(data-i18n="teacher.course_progress")
|
||||
.student-levels-progress
|
||||
each versionedCourse in view.classroom.get('courses') || []
|
||||
each versionedCourse in (view.classroom.get('courses') || [])
|
||||
- var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
||||
if !course
|
||||
- continue;
|
||||
|
|
|
@ -125,6 +125,7 @@ module.exports = class TeacherStudentView extends RootView
|
|||
mean: mean
|
||||
performance: perf
|
||||
}
|
||||
|
||||
# console.log (@courseComparisonMap)
|
||||
|
||||
drawBarGraph: ->
|
||||
|
@ -259,6 +260,10 @@ module.exports = class TeacherStudentView extends RootView
|
|||
@lastPlayedString += ", on " if course or level
|
||||
@lastPlayedString += moment(session.get('changed')).format("LLLL")
|
||||
# console.log (moment(session.get('changed')).format("LLLL"))
|
||||
|
||||
# extra vars for display
|
||||
@lastPlayedCourse = course
|
||||
|
||||
# Rerun template/jade file to display new last played string
|
||||
@render()
|
||||
|
||||
|
|
Loading…
Reference in a new issue