codecombat/app/templates/courses/teacher-class-view.jade

307 lines
11 KiB
Text
Raw Normal View History

2016-03-30 16:57:19 -04:00
extends /templates/base-flat
block page_nav
include ./teacher-dashboard-nav.jade
block content
- var classroom = view.classroom
if !me.isTeacher()
.alert.alert-danger.text-center
.container
// DNT: Temporary
h3 ATTENTION: Please upgrade your account to a Teacher Account.
p
| We are transitioning to a new improved classroom management system for instructors.
| Please convert your account to ensure you retain access to your classrooms.
a.btn.btn-primary.btn-lg(href="/teachers/update-account") Upgrade to teacher account
2016-03-30 16:57:19 -04:00
if classroom.loaded
.container
+breadcrumbs
h3.m-t-2= classroom.get('name')
2016-03-30 16:57:19 -04:00
a.label.edit-classroom(data-classroom-id=classroom.id)
span(data-i18n='teacher.edit_class_settings')
h4= classroom.get('description')
.classroom-info-row.row.m-t-5
2016-03-30 16:57:19 -04:00
.classroom-details.col-md-3
- var stats = view.classStats()
h4.m-b-2(data-i18n='teacher.class_overview')
2016-03-30 16:57:19 -04:00
.language.small-details
span(data-i18n='teacher.language')
span.spr :
span= classroom.capitalLanguage
.student-count.small-details
span(data-i18n='teacher.students')
span.spr :
span= classroom.get('members').length
.average-playtime.small-details
span(data-i18n='teacher.avg_playtime')
span.spr :
span= stats.averagePlaytime
.total-playtime.small-details
span(data-i18n='teacher.total_playtime')
span.spr :
span= stats.totalPlaytime
.average-complete.small-details
span(data-i18n='teacher.avg_completed')
span.spr :
span= stats.averageLevelsComplete
.total-complete.small-details
span(data-i18n='teacher.total_completed')
span.spr :
span= stats.totalLevelsComplete
.total-complete.small-details
span(data-i18n='teacher.created')
span.spr :
span= moment(classroom.created()).format('ll')
2016-03-30 16:57:19 -04:00
//- .concepts.small-details
//- if view.progressData
//- div
//- span(data-i18n='teacher.concepts_covered')
//- span :
//- - console.log('concepts', view.conceptData)
//- - concepts = view.conceptData
//- each state, name in view.conceptData[view.classroom.id]
//- if state.started
//- b.concept(class=state.completed ? 'forest' : 'gold')
//- span(data-i18n='concepts.'+name)
.completeness-info.col-md-4
h4.m-b-2
 
2016-03-30 16:57:19 -04:00
if view.earliestIncompleteLevel
div.small-details
2016-03-30 16:57:19 -04:00
span(data-i18n='teacher.earliest_incomplete')
span :
+longLevelName(view.earliestIncompleteLevel)
+inlineUserList(view.earliestIncompleteLevel.users)
if view.latestCompleteLevel
div.small-details.m-t-3
2016-03-30 16:57:19 -04:00
span(data-i18n='teacher.latest_complete')
span :
+longLevelName(view.latestCompleteLevel)
+inlineUserList(view.latestCompleteLevel.users)
.adding-students.col-md-5
h4.m-b-2
2016-03-30 16:57:19 -04:00
span(data-i18n='teacher.adding_students')
span :
+copyCodes
+addStudentsButton
ul.nav.nav-tabs.m-t-5(role='tablist')
2016-03-30 16:57:19 -04:00
li.active
a(href='#students-tab' data-toggle='tab')
.small-details.text-center(data-i18n='teacher.students')
.tab-spacer
li
a(href='#course-progress-tab' data-toggle='tab')
.small-details.text-center(data-i18n='teacher.course_progress')
.tab-filler
.tab-content
+studentsTab
+courseProgressTab
mixin breadcrumbs
.breadcrumbs
a(data-i18n='teacher.my_classes' href='/teachers/classes')
span.spl.spr >
//- TODO: Use .glyphicon-menu-right when we update bootstrap
span
= view.classroom.get('name')
mixin longLevelName(data)
if data
div.level-name
span.spr Course
span= data.courseNumber
span.spr , Level
span= data.levelNumber
span.spr :
span= data.levelName
else
div.level-name(data-i18n='teacher.not_applicable')
mixin inlineUserList(users)
if users
ul.inline-student-list.small
each student in users
li
//- a(href='TODO')
Stuff Partially fix ActivateLicensesModal.spec [IN PROGRESS] Don't display deleted users Move userID to classroom.deletedMembers on user delete (not retroactive) Fix PDF links for course guides, remove old PDFs from repo Remove deprecated SalesView Remove underline for not-yet-linked student names Only show class select when there's more than one Ignore case when sorting student names Use student.broadName instead of name for display and sorting Fix initial load not showing progress after joining a course (hacky) Fix text entry for enrollment number input Fix enrollment statistics Fix enrollment stats completely (and add back in per-class unenrolled count) Add deletedMembers to classroom schema More fixes to enrollment stats (don't count nonmember prepaids) Don't use 0 as implicit false for openSpots Update suggested number of credit to buy automatically Fix classroom edit form ignoring cleared values Add alert text when more users selected than enrollments available Alert user when trying to assign course to unenrolled students Alert user when assigning course to nobody Add some tests for TeacherClassView bulk assign alerts Fix TeacherClassView tests failing without demos Use model/collection.fakeRequests :D Remove unused comment Fix handling of improperly sorted deleted users on clientside Add test for moving deleted users to deletedMembers Add script for moving all deleted classroom members to classroom.deletedMembers Completely rewrite tallying up enrollment statistics Fix some tests to not be dependent on logged-in user Address PR comments Fix default number of enrollments to buy Fix i18n for not enough enrollments Use custom error message for classroom name length
2016-04-07 17:55:42 -04:00
//- = student.broadName()
2016-03-30 16:57:19 -04:00
span.inline-student-name
Stuff Partially fix ActivateLicensesModal.spec [IN PROGRESS] Don't display deleted users Move userID to classroom.deletedMembers on user delete (not retroactive) Fix PDF links for course guides, remove old PDFs from repo Remove deprecated SalesView Remove underline for not-yet-linked student names Only show class select when there's more than one Ignore case when sorting student names Use student.broadName instead of name for display and sorting Fix initial load not showing progress after joining a course (hacky) Fix text entry for enrollment number input Fix enrollment statistics Fix enrollment stats completely (and add back in per-class unenrolled count) Add deletedMembers to classroom schema More fixes to enrollment stats (don't count nonmember prepaids) Don't use 0 as implicit false for openSpots Update suggested number of credit to buy automatically Fix classroom edit form ignoring cleared values Add alert text when more users selected than enrollments available Alert user when trying to assign course to unenrolled students Alert user when assigning course to nobody Add some tests for TeacherClassView bulk assign alerts Fix TeacherClassView tests failing without demos Use model/collection.fakeRequests :D Remove unused comment Fix handling of improperly sorted deleted users on clientside Add test for moving deleted users to deletedMembers Add script for moving all deleted classroom members to classroom.deletedMembers Completely rewrite tallying up enrollment statistics Fix some tests to not be dependent on logged-in user Address PR comments Fix default number of enrollments to buy Fix i18n for not enough enrollments Use custom error message for classroom name length
2016-04-07 17:55:42 -04:00
= student.broadName()
2016-03-30 16:57:19 -04:00
mixin addStudentsButton
.add-students.text-center
a.add-students-btn.btn.btn-lg.btn-primary(data-classroom-id=view.classroom.id)
span(data-i18n='teacher.add_students_manually')
mixin studentsTab
#students-tab.tab-pane.active
+bulkAssignControls
table.students-table
thead
th.checkbox-col.select-all
span Select All
.checkbox-flat
input(type='checkbox' id='checkbox-all-students')
label.checkmark(for='checkbox-all-students')
th
+sortButtons
tbody
each student in view.students.models
+studentRow(student)
mixin sortButtons
.sort-buttons.small
span(data-i18n='teacher.sort_by')
span.spr :
button.sort-button.sort-by-name(data-i18n='general.name')
button.sort-button.sort-by-progress(data-i18n='teacher.progress')
mixin studentRow(student)
tr.student-row.alternating-background
td.checkbox-col.student-checkbox
.checkbox-flat
input(type='checkbox' id='checkbox-student-' + student.id, data-student-id=student.id)
label.checkmark(for='checkbox-student-' + student.id)
td.student-info-col
.student-info
if student.get('deleted')
em (deleted)
Stuff Partially fix ActivateLicensesModal.spec [IN PROGRESS] Don't display deleted users Move userID to classroom.deletedMembers on user delete (not retroactive) Fix PDF links for course guides, remove old PDFs from repo Remove deprecated SalesView Remove underline for not-yet-linked student names Only show class select when there's more than one Ignore case when sorting student names Use student.broadName instead of name for display and sorting Fix initial load not showing progress after joining a course (hacky) Fix text entry for enrollment number input Fix enrollment statistics Fix enrollment stats completely (and add back in per-class unenrolled count) Add deletedMembers to classroom schema More fixes to enrollment stats (don't count nonmember prepaids) Don't use 0 as implicit false for openSpots Update suggested number of credit to buy automatically Fix classroom edit form ignoring cleared values Add alert text when more users selected than enrollments available Alert user when trying to assign course to unenrolled students Alert user when assigning course to nobody Add some tests for TeacherClassView bulk assign alerts Fix TeacherClassView tests failing without demos Use model/collection.fakeRequests :D Remove unused comment Fix handling of improperly sorted deleted users on clientside Add test for moving deleted users to deletedMembers Add script for moving all deleted classroom members to classroom.deletedMembers Completely rewrite tallying up enrollment statistics Fix some tests to not be dependent on logged-in user Address PR comments Fix default number of enrollments to buy Fix i18n for not enough enrollments Use custom error message for classroom name length
2016-04-07 17:55:42 -04:00
div.student-name= student.broadName()
2016-03-30 16:57:19 -04:00
div.student-email.small-details= student.get('email')
td.hidden
a.edit-student-button(data-student-id=student.id)
span.glyphicon.glyphicon-edit
span(data-i18n='teacher.edit')
td.latest-level-col.small
div
i
span(data-i18n='teacher.latest_completed')
span :
div
+longLevelName(student.latestCompleteLevel)
td
if view.progressData
each course, index in view.courses.models
- var instance = view.courseInstances.findWhere({ courseID: course.id, classroomID: classroom.id })
if instance && instance.hasMember(student)
- var progress = view.progressData.get({ classroom: view.classroom, course: course, user: student })
+progressDot(progress, 'CS' + (index+1))
unless student.isEnrolled()
+enrollStudentButton(student)
//- td
//- span.view-class-arrow.glyphicon.glyphicon-chevron-right
td
a.remove-student-link.small.center-block.text-center.pull-right.m-r-2(data-student-id=student.id)
div.glyphicon.glyphicon-remove
div(data-i18n='teacher.remove')
2016-03-30 16:57:19 -04:00
mixin enrollStudentButton(student)
a.enroll-student-button.btn.btn-lg.btn-primary(data-classroom-id=view.classroom.id data-user-id=student.id)
span(data-i18n='teacher.enroll_student')
mixin courseProgressTab
#course-progress-tab.tab-pane.m-t-3
if view.courses
.text-center
span(data-i18n='teacher.select_course')
span.spr :
select.course-select
2016-04-13 12:54:24 -04:00
each trimCourse in view.classroom.get('courses')
- var course = view.courses.get(trimCourse._id);
2016-03-30 16:57:19 -04:00
option(value=course.id)
= course.get('name')
if view.progressData
.render-on-course-sync
+courseOverview
.student-levels-table
+sortButtons
each student in view.students.models
+studentLevelsRow(student)
mixin courseOverview
- var course = view.selectedCourse
2016-04-13 12:54:24 -04:00
- var levels = view.classroom.getLevels({courseID: course.id, withoutLadderLevels: true}).models
2016-03-30 16:57:19 -04:00
.course-overview-row
.course-title.student-name
span= course.get('name')
span :
span(data-i18n='teacher.course_overview')
.course-overview-progress
each level, index in levels
- var progress = view.progressData.get({ classroom: view.classroom, course: course, level: level })
+progressDot(progress, index+1)
mixin studentLevelsRow(student)
.student-levels-row.alternating-background
div.student-info
Stuff Partially fix ActivateLicensesModal.spec [IN PROGRESS] Don't display deleted users Move userID to classroom.deletedMembers on user delete (not retroactive) Fix PDF links for course guides, remove old PDFs from repo Remove deprecated SalesView Remove underline for not-yet-linked student names Only show class select when there's more than one Ignore case when sorting student names Use student.broadName instead of name for display and sorting Fix initial load not showing progress after joining a course (hacky) Fix text entry for enrollment number input Fix enrollment statistics Fix enrollment stats completely (and add back in per-class unenrolled count) Add deletedMembers to classroom schema More fixes to enrollment stats (don't count nonmember prepaids) Don't use 0 as implicit false for openSpots Update suggested number of credit to buy automatically Fix classroom edit form ignoring cleared values Add alert text when more users selected than enrollments available Alert user when trying to assign course to unenrolled students Alert user when assigning course to nobody Add some tests for TeacherClassView bulk assign alerts Fix TeacherClassView tests failing without demos Use model/collection.fakeRequests :D Remove unused comment Fix handling of improperly sorted deleted users on clientside Add test for moving deleted users to deletedMembers Add script for moving all deleted classroom members to classroom.deletedMembers Completely rewrite tallying up enrollment statistics Fix some tests to not be dependent on logged-in user Address PR comments Fix default number of enrollments to buy Fix i18n for not enough enrollments Use custom error message for classroom name length
2016-04-07 17:55:42 -04:00
div.student-name= student.broadName()
div.student-email.small-details= student.get('email')
2016-03-30 16:57:19 -04:00
div.student-levels-progress
- var course = view.selectedCourse
2016-04-13 12:54:24 -04:00
- var levels = view.classroom.getLevels({courseID: course.id, withoutLadderLevels: true}).models
2016-03-30 16:57:19 -04:00
each level, index in levels
- var progress = view.progressData.get({ classroom: view.classroom, course: course, level: level, user: student })
+progressDot(progress, index+1)
mixin progressDot(progress, label)
//- TODO: Refactor with TeacherClassesView jade
//- TODO: Give classes abbreviations instead of using index?
//- TODO: inefficient. Cache this in the view?
- dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : '');
.progress-dot(class=dotClass, data-html='true', data-title=view.progressDotTemplate(progressDotContext) data-toggle='tooltip')
+progressDotLabel(label)
mixin progressDotLabel(label)
.dot-label.text-center
.dot-label-inner
= label
mixin copyCodes
div.copy-button-group.form-inline.m-b-3
2016-03-30 16:57:19 -04:00
.form-group
input.text-h4.semibold#join-code-input(value=view.classCode)
button#copy-code-btn.form-control.btn.btn-lg.btn-forest
span(data-i18n='teacher.copy_class_code')
div.text-center.small(data-i18n='teacher.class_code_blurb')
div.copy-button-group.form-inline.m-b-3
2016-03-30 16:57:19 -04:00
.form-group
input.form-control.text-h4.semibold#join-url-input(value=view.joinURL)
button#copy-url-btn.form-control.btn.btn-lg.btn-forest
span(data-i18n='teacher.copy_class_url')
div.text-center.small(data-i18n='teacher.class_join_url_blurb')
mixin bulkAssignControls
.bulk-assign-controls.form-inline
Stuff Partially fix ActivateLicensesModal.spec [IN PROGRESS] Don't display deleted users Move userID to classroom.deletedMembers on user delete (not retroactive) Fix PDF links for course guides, remove old PDFs from repo Remove deprecated SalesView Remove underline for not-yet-linked student names Only show class select when there's more than one Ignore case when sorting student names Use student.broadName instead of name for display and sorting Fix initial load not showing progress after joining a course (hacky) Fix text entry for enrollment number input Fix enrollment statistics Fix enrollment stats completely (and add back in per-class unenrolled count) Add deletedMembers to classroom schema More fixes to enrollment stats (don't count nonmember prepaids) Don't use 0 as implicit false for openSpots Update suggested number of credit to buy automatically Fix classroom edit form ignoring cleared values Add alert text when more users selected than enrollments available Alert user when trying to assign course to unenrolled students Alert user when assigning course to nobody Add some tests for TeacherClassView bulk assign alerts Fix TeacherClassView tests failing without demos Use model/collection.fakeRequests :D Remove unused comment Fix handling of improperly sorted deleted users on clientside Add test for moving deleted users to deletedMembers Add script for moving all deleted classroom members to classroom.deletedMembers Completely rewrite tallying up enrollment statistics Fix some tests to not be dependent on logged-in user Address PR comments Fix default number of enrollments to buy Fix i18n for not enough enrollments Use custom error message for classroom name length
2016-04-07 17:55:42 -04:00
.no-students-selected.small-details(class=view.assigningToNobody ? 'visible' : '')
span(data-i18n='teacher.no_students_selected')
.cant-assign-to-unenrolled.small-details(class=view.assigningToUnenrolled ? 'visible' : '')
span(data-i18n='teacher.cant_assign_to_unenrolled')
2016-03-30 16:57:19 -04:00
span.small
span(data-i18n='teacher.bulk_assign')
span :
select.bulk-course-select.form-control
2016-04-13 12:54:24 -04:00
each trimCourse in view.classroom.get('courses')
- var course = view.courses.get(trimCourse._id)
2016-03-30 16:57:19 -04:00
option(value=course.id)
= course.get('name')
button.btn.btn-primary-alt.assign-to-selected-students
span(data-i18n='teacher.assign_to_selected_students')
button.btn.btn-primary-alt.enroll-selected-students
span(data-i18n='teacher.enroll_selected_students')