2016-09-14 13:32:11 -04:00
|
|
|
extends /templates/base-flat
|
|
|
|
|
|
|
|
block page_nav
|
|
|
|
include ../courses/teacher-dashboard-nav.jade
|
|
|
|
|
|
|
|
block content
|
2016-09-15 16:48:26 -04:00
|
|
|
|
|
|
|
if !view.user
|
|
|
|
div Loading
|
|
|
|
else
|
|
|
|
.container
|
|
|
|
+breadcrumbs
|
|
|
|
if !me.isAnonymous() && me.isTeacher()
|
|
|
|
- var isOwner = view.classroom ? view.classroom.get('ownerID') === me.id : false;
|
|
|
|
// - var validStudent = ...
|
|
|
|
// load all students in this class
|
|
|
|
// check if this student is in the class
|
|
|
|
|
|
|
|
if isOwner
|
|
|
|
// also check if validStudent
|
|
|
|
h3 Student Profile:
|
|
|
|
span= view.user.get('name')
|
|
|
|
//- - console.log (view.user.get('email'))
|
|
|
|
// this user object doesn't have an email property
|
|
|
|
if (view.user.get('email'))
|
|
|
|
//- - console.log ("User has an email")
|
|
|
|
p Student Email:
|
|
|
|
span= view.user.get('email')
|
|
|
|
else
|
|
|
|
p
|
|
|
|
i Student has no email address set.
|
|
|
|
p Last Level Played:
|
|
|
|
span= view.lastPlayedString
|
|
|
|
|
|
|
|
- var status = view.user.prepaidStatus()
|
|
|
|
span(data-i18n='view.user.status')
|
|
|
|
span.spr License Status:
|
|
|
|
strong(class= status === 'expired' ? 'text-danger' : '')= view.studentStatusString()
|
2016-09-20 19:20:39 -04:00
|
|
|
//-
|
|
|
|
//- svg#visualisation(width="1000", height="520")
|
|
|
|
//-
|
|
|
|
each versionedCourse in view.classroom.get('courses') || []
|
|
|
|
svg(id='visualisation-'+versionedCourse._id, width="1000", height="520")
|
|
|
|
//- svg(id='visualisation', width="1000", height="520")
|
|
|
|
//- - break;
|
|
|
|
//- svg#class(width="1000", height="520")
|
|
|
|
//- svg#student(width="1000", height="520")
|
|
|
|
|
2016-09-16 19:56:13 -04:00
|
|
|
|
2016-09-19 20:50:08 -04:00
|
|
|
//- - console.log (view.levelData[1].levelIndex)
|
2016-09-15 16:48:26 -04:00
|
|
|
|
2016-09-15 17:23:05 -04:00
|
|
|
//- h4 Actions:
|
2016-09-15 16:48:26 -04:00
|
|
|
// Assign courses from dropdown
|
|
|
|
// Export CSV
|
|
|
|
// Apply License
|
|
|
|
// Edit password
|
|
|
|
// Remove Student
|
2016-09-16 19:56:13 -04:00
|
|
|
//- .student-chart
|
|
|
|
//- div.student-levels-progress
|
|
|
|
//- //- if view.allLevelSessionMap
|
|
|
|
//- //- - console.log (view.allLevelSessionMap)
|
|
|
|
//- each versionedCourse in view.classroom.get('courses') || []
|
|
|
|
//- - var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
|
|
|
//- if !course
|
|
|
|
//- - continue;
|
|
|
|
//- - var instance = view.courseInstances.findWhere({ courseID: course.id, classroomID: view.classroom.id })
|
|
|
|
//- - if (instance && instance.hasMember(view.user))
|
|
|
|
//- if course
|
|
|
|
//- div.course-row.alternating-background
|
|
|
|
//- strong
|
|
|
|
//- div.course-info= course.get('name')
|
|
|
|
//- - var coursePlaytime = 0
|
|
|
|
//- - var levels = view.classroom.getLevels({courseID: course.id}).models
|
|
|
|
//- each level, index in levels
|
|
|
|
//- - var levelNumber = view.classroom.getLevelNumber(level.get('original'), index + 1)
|
|
|
|
//- //- - console.log (level)
|
|
|
|
//- - var levelProgress = view.levelProgressMap[level.get('original')]
|
|
|
|
//- if view.levelSessionMap && view.levelSessionMap[level.get('original')]
|
|
|
|
//- - var session = view.levelSessionMap[level.get('original')];
|
|
|
|
//- - coursePlaytime += session.get('playtime')
|
|
|
|
//- //- - var levelAverage = view.allLevelSessionMap[level.get('original')]
|
|
|
|
//- p= levelNumber + ". " + level.get('name') + ": " + session.get('playtime') + " (average: " + ")"
|
|
|
|
//- p= coursePlaytime
|
2016-09-14 22:15:08 -04:00
|
|
|
|
2016-09-15 16:48:26 -04:00
|
|
|
.student-levels
|
2016-09-15 17:23:05 -04:00
|
|
|
h4
|
|
|
|
strong Course Progress
|
2016-09-15 16:48:26 -04:00
|
|
|
div.student-levels-progress
|
|
|
|
each versionedCourse in view.classroom.get('courses') || []
|
2016-09-15 17:23:05 -04:00
|
|
|
- var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
|
|
|
if !course
|
|
|
|
- continue;
|
|
|
|
- var instance = view.courseInstances.findWhere({ courseID: course.id, classroomID: view.classroom.id })
|
|
|
|
- if (instance && instance.hasMember(view.user))
|
|
|
|
if course
|
|
|
|
div.course-row.alternating-background
|
|
|
|
strong
|
|
|
|
div.course-info= course.get('name')
|
|
|
|
- var levels = view.classroom.getLevels({courseID: course.id}).models
|
|
|
|
each level, index in levels
|
|
|
|
- var levelNumber = view.classroom.getLevelNumber(level.get('original'), index + 1)
|
|
|
|
//- - console.log (level)
|
|
|
|
- var levelProgress = view.levelProgressMap[level.get('original')]
|
|
|
|
//- p= levelNumber + ". " + level.name + " Progress: " + view.levelProgressMap[level.original]
|
|
|
|
//- - console.log(level)
|
|
|
|
+studentLevelProgressDot(levelProgress, level, levelNumber, course)
|
2016-09-14 22:15:08 -04:00
|
|
|
|
2016-09-15 16:48:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
if status == 'enrolled'
|
|
|
|
div Student isn't in the following courses!
|
|
|
|
each versionedCourse in view.classroom.get('courses') || []
|
|
|
|
- var course = _.find(view.courses.models, function(c) {return c.id === versionedCourse._id;});
|
|
|
|
if !course
|
|
|
|
- continue;
|
|
|
|
- var instance = view.courseInstances.findWhere({ courseID: course.id, classroomID: view.classroom.id })
|
|
|
|
- if (!(instance && instance.hasMember(view.user)))
|
|
|
|
div= course.get('name')
|
|
|
|
// add a button to assign this course
|
|
|
|
|
|
|
|
//- else
|
|
|
|
//- p Apply a license to this student to assign additional courses!
|
|
|
|
//- button.enroll-student-button.btn.btn-navy(data-i18n="teacher.apply_license", data-user-id=view.user.id, data-event-action="Teachers Class Enrollment Enroll Student")
|
|
|
|
//- // this button doesn't work yet
|
|
|
|
|
2016-09-14 22:15:08 -04:00
|
|
|
|
2016-09-15 16:48:26 -04:00
|
|
|
mixin studentLevelProgressDot(levelProgress, level, levelNumber, course)
|
|
|
|
//- TODO: Refactor with TeacherClassesView jade
|
|
|
|
- dotClass = levelProgress == 'complete' ? 'forest' : (levelProgress == 'started' ? 'gold' : '');
|
|
|
|
- levelName = level.get('name')
|
|
|
|
- var context = { levelName: levelName, levelNumber: levelNumber, moment: moment , started: levelProgress == 'started', completed: levelProgress == 'complete'};
|
|
|
|
if view.levelSessionMap && view.levelSessionMap[level.get('original')]
|
|
|
|
- context.session = view.levelSessionMap[level.get('original')];
|
2016-09-16 13:27:09 -04:00
|
|
|
//- - console.log(view.levelSessionMap[level.get('original')])
|
2016-09-15 16:48:26 -04:00
|
|
|
- link = null;
|
|
|
|
- labelText = levelNumber;
|
|
|
|
if level.isLadder()
|
|
|
|
- var courseInstance = view.courseInstances.findWhere({ courseID: course.id, classroomID: view.classroom.id });
|
|
|
|
if courseInstance
|
|
|
|
- link = view.urls.courseArenaLadder({level: level, courseInstance: courseInstance});
|
|
|
|
- labelText = translate('courses.arena');
|
|
|
|
else
|
|
|
|
- labelText = translate('courses.arena');
|
|
|
|
- dotClass += ' progress-dot-lg';
|
|
|
|
else if level.isProject()
|
|
|
|
if levelProgress == 'started' || levelProgress == 'complete'
|
|
|
|
if view.levelSessionMap && view.levelSessionMap[level.get('original')]
|
|
|
|
- link = view.urls.playDevLevel({level: level, session: view.levelSessionMap[level.get('original')], course: course});
|
|
|
|
- labelText = translate('teacher.view_student_project');
|
|
|
|
- dotClass = 'navy';
|
|
|
|
else
|
|
|
|
- labelText = translate('teacher.project');
|
|
|
|
- dotClass += ' progress-dot-lg';
|
|
|
|
.progress-dot.level-progress-dot(class=dotClass, data-html='true', data-title=view.singleStudentLevelProgressDotTemplate(context))
|
|
|
|
if link
|
|
|
|
a(href=link)
|
|
|
|
+progressDotLabel(labelText)
|
|
|
|
else
|
|
|
|
+progressDotLabel(labelText)
|
|
|
|
|
|
|
|
mixin progressDotLabel(label)
|
|
|
|
.dot-label.text-center
|
|
|
|
.dot-label-inner
|
|
|
|
= label
|
|
|
|
|
2016-09-14 22:15:08 -04:00
|
|
|
mixin breadcrumbs
|
|
|
|
.breadcrumbs
|
|
|
|
a(data-i18n='teacher.my_classes' href='/teachers/classes')
|
|
|
|
span.spl.spr >
|
|
|
|
//- TODO: Use .glyphicon-menu-right when we update bootstrap
|
|
|
|
a(href='/teachers/classes/'+view.classroom.id)
|
|
|
|
span= view.classroom.get('name')
|
|
|
|
span.spl.spr >
|
|
|
|
span= view.user.get('name')
|