Merge branch 'master' into production

This commit is contained in:
Matt Lott 2016-08-19 16:11:42 -07:00
commit f3b8c2be37
14 changed files with 104 additions and 55 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -3,3 +3,7 @@ module.exports =
shareURL = "#{window.location.origin}/play/#{level.get('type')}-level/#{level.get('slug')}/#{session.id}" shareURL = "#{window.location.origin}/play/#{level.get('type')}-level/#{level.get('slug')}/#{session.id}"
shareURL += "?course=#{course.id}" if course shareURL += "?course=#{course.id}" if course
return shareURL return shareURL
courseArenaLadder: ({level, courseInstance}) ->
"/play/ladder/#{level.get('slug')}/course/#{courseInstance.id}"

View file

@ -1419,7 +1419,8 @@
archive_class: "archive class" archive_class: "archive class"
unarchive_class: "unarchive class" unarchive_class: "unarchive class"
unarchive_this_class: "Unarchive this class" unarchive_this_class: "Unarchive this class"
no_students_yet: "View class to add students." # {change} no_students_yet: "This class has no students yet."
no_students_yet_view_class: "View class to add students."
try_refreshing: "(You may need to refresh the page)" try_refreshing: "(You may need to refresh the page)"
add_students: "Add Students" add_students: "Add Students"
create_new_class: "Create a New Class" create_new_class: "Create a New Class"
@ -1504,6 +1505,9 @@
status_enrolled: "Expires on {{date}}" status_enrolled: "Expires on {{date}}"
select_all: "Select All" select_all: "Select All"
projects: "Projects" projects: "Projects"
project: "Project"
view_student_project: "View Student Project"
view_arena_ladder: "View Arena Ladder"
sharing: sharing:
game: "Game" game: "Game"

View file

@ -257,13 +257,17 @@
.progress-dot .progress-dot
display: inline-block display: inline-block
margin-right: 6px margin-right: 6px
width: 34px min-width: 34px
height: 34px height: 34px
border-radius: 50% border-radius: 16px
padding: 0 10px
// margin-top: 23px // margin-top: 23px
// margin-bottom: 23px // margin-bottom: 23px
background: $gray-light background: $gray-light
position: relative position: relative
a
text-decoration: none
.dot-label .dot-label
padding-top: 2px padding-top: 2px
.dot-label-inner .dot-label-inner
@ -271,6 +275,9 @@
font-weight: bold font-weight: bold
color: white color: white
.progress-dot-lg .dot-label .dot-label-inner
font-size: 13px
.progress-dot.forest .progress-dot.forest
background: $forest background: $forest
.tooltip-inner .tooltip-inner
@ -287,6 +294,14 @@
.tooltip-arrow .tooltip-arrow
border-top-color: $navy border-top-color: $navy
.progress-dot.navy
background: $navy
.tooltip-inner
color: $navy
border-color: $navy
.tooltip-arrow
border-top-color: $navy
// Code copying buttons // Code copying buttons
.class-code-blurb .class-code-blurb

View file

@ -122,13 +122,6 @@ block content
li(class=(activeTab === "#enrollment-status-tab" ? 'active' : '')) li(class=(activeTab === "#enrollment-status-tab" ? 'active' : ''))
a.course-progress-tab-btn(href='#enrollment-status-tab') a.course-progress-tab-btn(href='#enrollment-status-tab')
.small-details.text-center(data-i18n='teacher.enrollment_status') .small-details.text-center(data-i18n='teacher.enrollment_status')
// TODO: Move projects into course progress tab
//- var courses = view.classroom.get('courses').map(function(c) { return view.courses.get(c._id); });
//if _.find(courses, function(c) { return /dev/.test(c.get('slug')); })
// .tab-spacer
// li(class=(activeTab === "#student-projects-tab" ? 'active' : ''))
// a.course-progress-tab-btn(href='#student-projects-tab')
// .small-details.text-center(data-i18n='teacher.projects')
.tab-filler .tab-filler
.tab-content .tab-content
@ -138,8 +131,6 @@ block content
+courseProgressTab +courseProgressTab
else if activeTab === '#enrollment-status-tab' else if activeTab === '#enrollment-status-tab'
+enrollmentStatusTab +enrollmentStatusTab
else
+studentProjectsTab
else else
.text-center.m-t-5.m-b-5 .text-center.m-t-5.m-b-5
@ -335,6 +326,7 @@ mixin studentLevelsRow(student)
- var levelNumber = view.classroom.getLevelNumber(level.get('original'), index + 1) - var levelNumber = view.classroom.getLevelNumber(level.get('original'), index + 1)
+studentLevelProgressDot(progress, level, levelNumber) +studentLevelProgressDot(progress, level, levelNumber)
mixin studentCourseProgressDot(progress, levelsTotal, level, label) mixin studentCourseProgressDot(progress, levelsTotal, level, label)
//- TODO: Refactor with TeacherClassesView jade //- TODO: Refactor with TeacherClassesView jade
//- TODO: Give classes abbreviations instead of using index? //- TODO: Give classes abbreviations instead of using index?
@ -347,16 +339,59 @@ mixin allStudentsLevelProgressDot(progress, level, levelNumber)
- dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : ''); - dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : '');
- levelName = i18n(level.attributes, 'name') - levelName = i18n(level.attributes, 'name')
- context = _.merge(progress, { levelName: levelName, levelNumber: levelNumber, numStudents: view.students.length }) - context = _.merge(progress, { levelName: levelName, levelNumber: levelNumber, numStudents: view.students.length })
- link = null;
- labelText = levelNumber;
if level.isLadder()
- var course = view.state.get('selectedCourse');
- var courseInstance = course && view.classroom ? view.courseInstances.findWhere({ courseID: course.id, classroomID: view.classroom.id }) : null;
if courseInstance
- link = view.urls.courseArenaLadder({level: level, courseInstance: courseInstance});
- labelText = translate('teacher.view_arena_ladder');
else
- labelText = translate('courses.arena');
- dotClass = 'navy progress-dot-lg';
else if level.isProject()
- labelText = translate('teacher.project')
- dotClass += ' progress-dot-lg';
.progress-dot.level-progress-dot(class=dotClass, data-html='true', data-title=view.allStudentsLevelProgressDotTemplate(context)) .progress-dot.level-progress-dot(class=dotClass, data-html='true', data-title=view.allStudentsLevelProgressDotTemplate(context))
+progressDotLabel(levelNumber) if link
a(href=link)
+progressDotLabel(labelText)
else
+progressDotLabel(labelText)
mixin studentLevelProgressDot(progress, level, levelNumber) mixin studentLevelProgressDot(progress, level, levelNumber)
//- TODO: Refactor with TeacherClassesView jade //- TODO: Refactor with TeacherClassesView jade
- dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : ''); - dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : '');
- levelName = i18n(level.attributes, 'name') - levelName = i18n(level.attributes, 'name')
- context = _.merge(progress, { levelName: levelName, levelNumber: levelNumber, moment: moment }) - context = _.merge(progress, { levelName: levelName, levelNumber: levelNumber, moment: moment })
- link = null;
- labelText = levelNumber;
if level.isLadder()
- var course = view.state.get('selectedCourse');
- 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 progress.started
- link = view.urls.playDevLevel({level: level, session: progress.session, course: view.state.get('selectedCourse')});
- 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)) .progress-dot.level-progress-dot(class=dotClass, data-html='true', data-title=view.singleStudentLevelProgressDotTemplate(context))
+progressDotLabel(levelNumber) if link
a(href=link)
+progressDotLabel(labelText)
else
+progressDotLabel(labelText)
mixin progressDotLabel(label) mixin progressDotLabel(label)
.dot-label.text-center .dot-label.text-center
@ -439,37 +474,3 @@ mixin enrollmentStatusTab
td.enroll-col td.enroll-col
if status !== 'enrolled' if status !== 'enrolled'
button.enroll-student-button.btn.btn-navy(data-i18n="teacher.enroll_student", data-user-id=student.id, data-event-action="Teachers Class Enrollment Enroll Student") button.enroll-student-button.btn.btn-navy(data-i18n="teacher.enroll_student", data-user-id=student.id, data-event-action="Teachers Class Enrollment Enroll Student")
mixin studentProjectsTab
#student-projects-tab.m-t-3
if state.get('progressData')
.render-on-course-sync
.student-levels-table
+sortButtons
each student in state.get('students').models
+studentProjectsRow(student)
mixin studentProjectsRow(student)
.row.student-levels-row.alternating-background
div.student-info.col-sm-3
div.student-name= student.broadName()
div.student-email.small-details= student.get('email')
div.student-levels-progress.col-sm-9
each trimCourse in view.classroom.get('courses')
- var course = view.courses.get(trimCourse._id);
- var levels = view.classroom.getLevels({courseID: course.id, projectLevels: true}).models
each level in levels
- var progress = state.get('progressData').get({ classroom: view.classroom, course: course, level: level, user: student })
- var levelNumber = view.classroom.getLevelNumber(level.get('original'), index + 1)
+studentProjectLink(progress, level, levelNumber, course)
mixin studentProjectLink(progress, level, levelNumber, course)
- var colorClass = progress.completed ? 'btn-primary' : (progress.started ? 'btn-warning' : 'btn-primary');
- var levelName = i18n(level.attributes, 'name')
- var context = _.merge(progress, { levelName: levelName, levelNumber: levelNumber, moment: moment })
- var title = view.singleStudentLevelProgressDotTemplate(context);
if context.session
- var url = '/play/' + level.get('type') + '-level/' + level.get('slug') + '/' + context.session.id + '?course=' + course.id;
a(class="btn btn-lg btn-view-project-level " + colorClass, href=url, data-title=title)= levelName
else
btn(class="btn btn-lg btn-view-project-level " + colorClass, data-title=title, disabled=true)= levelName

View file

@ -91,7 +91,7 @@ mixin classRow(classroom)
mixin addStudentsButton(classroom) mixin addStudentsButton(classroom)
.add-students .add-students
.text-center .text-center
div.small-details(data-i18n='teacher.no_students_yet') div.small-details(data-i18n='teacher.no_students_yet_view_class')
mixin createClassButton mixin createClassButton
.create-class .create-class

View file

@ -40,7 +40,7 @@ block content
//- TODO: Automate this list @scott //- TODO: Automate this list @scott
//- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting //- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting
- var courseSlug = course.get('slug') || ''; - var courseSlug = course.get('slug') || '';
if courseSlug === 'web-dev-1' if courseSlug === 'web-dev-1' || courseSlug === 'web-development-1'
option(value="javascript") option(value="javascript")
| HTML | HTML
else if courseSlug.indexOf('web-dev') >= 0 else if courseSlug.indexOf('web-dev') >= 0
@ -97,7 +97,7 @@ mixin course-info(course)
if me.isTeacher() || view.ownedClassrooms.size() || me.isAdmin() if me.isTeacher() || view.ownedClassrooms.size() || me.isAdmin()
//- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting //- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting
- var courseSlug = course.get('slug') || ''; - var courseSlug = course.get('slug') || '';
if courseSlug === 'web-dev-1' if courseSlug === 'web-dev-1' || courseSlug === 'web-development-1'
a.guide-btn.btn.btn-primary(href=("/teachers/course-solution/" + course.id + "/javascript") data-course-id=course.id data-course-name=course.get('name') data-event-action="Classes Guides Guide JavaScript" class=(me.isTeacher() || me.isAdmin() ? '': 'disabled')) a.guide-btn.btn.btn-primary(href=("/teachers/course-solution/" + course.id + "/javascript") data-course-id=course.id data-course-name=course.get('name') data-event-action="Classes Guides Guide JavaScript" class=(me.isTeacher() || me.isAdmin() ? '': 'disabled'))
span(data-i18n="courses.view_guide_online") span(data-i18n="courses.view_guide_online")
| — HTML | — HTML

View file

@ -135,6 +135,10 @@ module.exports = class NewHomeView extends RootView
'introduction-to-computer-science': '2-4' 'introduction-to-computer-science': '2-4'
'game-dev-1': '2-3' 'game-dev-1': '2-3'
'web-dev-1': '2-3' 'web-dev-1': '2-3'
'game-development-1': '2-3'
'web-development-1': '2-3'
'game-development-2': '2-3'
'web-development-3': '2-3'
'computer-science-6': '24-30' 'computer-science-6': '24-30'
'computer-science-7': '30-40' 'computer-science-7': '30-40'
'computer-science-8': '30-40' 'computer-science-8': '30-40'
@ -144,6 +148,10 @@ module.exports = class NewHomeView extends RootView
'introduction-to-computer-science': '1-3' 'introduction-to-computer-science': '1-3'
'game-dev-1': '1-3' 'game-dev-1': '1-3'
'web-dev-1': '1-3' 'web-dev-1': '1-3'
'game-development-1': '1-3'
'web-development-1': '1-3'
'game-development-2': '1-3'
'web-development-2': '1-3'
'computer-science-6': '12-14' 'computer-science-6': '12-14'
'computer-science-7': '14-16' 'computer-science-7': '14-16'
'computer-science-8': '14-16' 'computer-science-8': '14-16'
@ -153,6 +161,10 @@ module.exports = class NewHomeView extends RootView
'introduction-to-computer-science': '1' 'introduction-to-computer-science': '1'
'game-dev-1': '1-2' 'game-dev-1': '1-2'
'web-dev-1': '1-2' 'web-dev-1': '1-2'
'game-development-1': '1-2'
'web-development-1': '1-2'
'game-development-2': '1-2'
'web-development-2': '1-2'
'computer-science-6': '10-12' 'computer-science-6': '10-12'
'computer-science-7': '12-16' 'computer-science-7': '12-16'
'computer-science-8': '12-16' 'computer-science-8': '12-16'

View file

@ -73,6 +73,7 @@ module.exports = class TeacherClassView extends RootView
@singleStudentCourseProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-course' @singleStudentCourseProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-course'
@singleStudentLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-level' @singleStudentLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-level'
@allStudentsLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-all-students-single-level' @allStudentsLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-all-students-single-level'
@urls = require('core/urls')
@debouncedRender = _.debounce @render @debouncedRender = _.debounce @render

View file

@ -31,7 +31,7 @@ var courses =
}, },
{ {
name: "Game Development 1", name: "Game Development 1",
slug: "game-dev-1", slug: "game-development-1",
campaignID: ObjectId("5789236960deed1f00ec2ab8"), campaignID: ObjectId("5789236960deed1f00ec2ab8"),
description: "Learn to create your own games which you can share with your friends.", description: "Learn to create your own games which you can share with your friends.",
duration: NumberInt(1), duration: NumberInt(1),
@ -40,7 +40,7 @@ var courses =
}, },
{ {
name: "Web Development 1", name: "Web Development 1",
slug: "web-dev-1", slug: "web-development-1",
campaignID: ObjectId("578913f2c8871ac2326fa3e4"), campaignID: ObjectId("578913f2c8871ac2326fa3e4"),
description: "Learn the basics of web development in this introductory HTML & CSS course.", description: "Learn the basics of web development in this introductory HTML & CSS course.",
duration: NumberInt(1), duration: NumberInt(1),
@ -59,7 +59,7 @@ var courses =
}, },
{ {
name: "Game Development 2", name: "Game Development 2",
slug: "game-dev-2", slug: "game-development-2",
campaignID: ObjectId("57b49c866430272000100c4d"), campaignID: ObjectId("57b49c866430272000100c4d"),
description: "Learn more advanced game development.", description: "Learn more advanced game development.",
duration: NumberInt(2), duration: NumberInt(2),
@ -68,7 +68,7 @@ var courses =
}, },
{ {
name: "Web Development 2", name: "Web Development 2",
slug: "web-dev-2", slug: "web-development-2",
campaignID: ObjectId("57891570c8871ac2326fa3f8"), campaignID: ObjectId("57891570c8871ac2326fa3f8"),
description: "Learn more advanced web development, including scripting to make interactive webpages.", description: "Learn more advanced web development, including scripting to make interactive webpages.",
duration: NumberInt(2), duration: NumberInt(2),

View file

@ -22,22 +22,34 @@ CourseSchema.statics.sortCourses = (courses) ->
'introduction-to-computer-science' 'introduction-to-computer-science'
'computer-science-2' 'computer-science-2'
'game-dev-1' 'game-dev-1'
'game-development-1'
'web-dev-1' 'web-dev-1'
'web-development-1'
'computer-science-3' 'computer-science-3'
'game-dev-2' 'game-dev-2'
'game-development-2'
'web-dev-2' 'web-dev-2'
'web-development-2'
'computer-science-4' 'computer-science-4'
'game-dev-3' 'game-dev-3'
'game-development-3'
'web-dev-3' 'web-dev-3'
'web-development-3'
'computer-science-5' 'computer-science-5'
'game-dev-4' 'game-dev-4'
'game-development-4'
'web-dev-4' 'web-dev-4'
'web-development-4'
'computer-science-6' 'computer-science-6'
'game-dev-5' 'game-dev-5'
'game-development-5'
'web-dev-5' 'web-dev-5'
'web-development-5'
'computer-science-7' 'computer-science-7'
'game-dev-6' 'game-dev-6'
'game-development-6'
'web-dev-6' 'web-dev-6'
'web-development-6'
'computer-science-8' 'computer-science-8'
] ]
_.sortBy courses, (course) -> _.sortBy courses, (course) ->