diff --git a/app/assets/images/pages/home/game-development-1.png b/app/assets/images/pages/home/game-development-1.png new file mode 100644 index 000000000..4fe0b8f96 Binary files /dev/null and b/app/assets/images/pages/home/game-development-1.png differ diff --git a/app/assets/images/pages/home/game-development-2.png b/app/assets/images/pages/home/game-development-2.png new file mode 100644 index 000000000..6c09ce67e Binary files /dev/null and b/app/assets/images/pages/home/game-development-2.png differ diff --git a/app/assets/images/pages/home/web-development-1.png b/app/assets/images/pages/home/web-development-1.png new file mode 100644 index 000000000..29a561a73 Binary files /dev/null and b/app/assets/images/pages/home/web-development-1.png differ diff --git a/app/assets/images/pages/home/web-development-2.png b/app/assets/images/pages/home/web-development-2.png new file mode 100644 index 000000000..21dc046fb Binary files /dev/null and b/app/assets/images/pages/home/web-development-2.png differ diff --git a/app/core/urls.coffee b/app/core/urls.coffee index 09687210a..6069d9e56 100644 --- a/app/core/urls.coffee +++ b/app/core/urls.coffee @@ -3,3 +3,7 @@ module.exports = shareURL = "#{window.location.origin}/play/#{level.get('type')}-level/#{level.get('slug')}/#{session.id}" shareURL += "?course=#{course.id}" if course return shareURL + + courseArenaLadder: ({level, courseInstance}) -> + "/play/ladder/#{level.get('slug')}/course/#{courseInstance.id}" + diff --git a/app/locale/en.coffee b/app/locale/en.coffee index fd231a7a2..edb3c4344 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -1419,7 +1419,8 @@ archive_class: "archive class" unarchive_class: "unarchive 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)" add_students: "Add Students" create_new_class: "Create a New Class" @@ -1504,6 +1505,9 @@ status_enrolled: "Expires on {{date}}" select_all: "Select All" projects: "Projects" + project: "Project" + view_student_project: "View Student Project" + view_arena_ladder: "View Arena Ladder" sharing: game: "Game" diff --git a/app/styles/courses/teacher-class-view.sass b/app/styles/courses/teacher-class-view.sass index c00336e24..efd6757e9 100644 --- a/app/styles/courses/teacher-class-view.sass +++ b/app/styles/courses/teacher-class-view.sass @@ -257,19 +257,26 @@ .progress-dot display: inline-block margin-right: 6px - width: 34px + min-width: 34px height: 34px - border-radius: 50% + border-radius: 16px + padding: 0 10px // margin-top: 23px // margin-bottom: 23px background: $gray-light position: relative + a + text-decoration: none + .dot-label padding-top: 2px .dot-label-inner font-size: 11px font-weight: bold color: white + + .progress-dot-lg .dot-label .dot-label-inner + font-size: 13px .progress-dot.forest background: $forest @@ -286,6 +293,14 @@ border-color: $navy .tooltip-arrow 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 diff --git a/app/templates/courses/teacher-class-view.jade b/app/templates/courses/teacher-class-view.jade index 03c73f95f..3bf78c3be 100644 --- a/app/templates/courses/teacher-class-view.jade +++ b/app/templates/courses/teacher-class-view.jade @@ -122,13 +122,6 @@ block content li(class=(activeTab === "#enrollment-status-tab" ? 'active' : '')) a.course-progress-tab-btn(href='#enrollment-status-tab') .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-content @@ -138,8 +131,6 @@ block content +courseProgressTab else if activeTab === '#enrollment-status-tab' +enrollmentStatusTab - else - +studentProjectsTab else .text-center.m-t-5.m-b-5 @@ -334,6 +325,7 @@ mixin studentLevelsRow(student) - 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) +studentLevelProgressDot(progress, level, levelNumber) + mixin studentCourseProgressDot(progress, levelsTotal, level, label) //- TODO: Refactor with TeacherClassesView jade @@ -347,16 +339,59 @@ mixin allStudentsLevelProgressDot(progress, level, levelNumber) - dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : ''); - levelName = i18n(level.attributes, 'name') - 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)) - +progressDotLabel(levelNumber) + if link + a(href=link) + +progressDotLabel(labelText) + else + +progressDotLabel(labelText) + mixin studentLevelProgressDot(progress, level, levelNumber) //- TODO: Refactor with TeacherClassesView jade - dotClass = progress.completed ? 'forest' : (progress.started ? 'gold' : ''); - levelName = i18n(level.attributes, 'name') - 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)) - +progressDotLabel(levelNumber) + if link + a(href=link) + +progressDotLabel(labelText) + else + +progressDotLabel(labelText) mixin progressDotLabel(label) .dot-label.text-center @@ -439,37 +474,3 @@ mixin enrollmentStatusTab td.enroll-col 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") - -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 diff --git a/app/templates/courses/teacher-classes-view.jade b/app/templates/courses/teacher-classes-view.jade index 5e6c7908e..2ffe473b4 100644 --- a/app/templates/courses/teacher-classes-view.jade +++ b/app/templates/courses/teacher-classes-view.jade @@ -91,7 +91,7 @@ mixin classRow(classroom) mixin addStudentsButton(classroom) .add-students .text-center - div.small-details(data-i18n='teacher.no_students_yet') + div.small-details(data-i18n='teacher.no_students_yet_view_class') mixin createClassButton .create-class diff --git a/app/templates/courses/teacher-courses-view.jade b/app/templates/courses/teacher-courses-view.jade index f91018ef8..0ff5ec4a5 100644 --- a/app/templates/courses/teacher-courses-view.jade +++ b/app/templates/courses/teacher-courses-view.jade @@ -40,7 +40,7 @@ block content //- TODO: Automate this list @scott //- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting - var courseSlug = course.get('slug') || ''; - if courseSlug === 'web-dev-1' + if courseSlug === 'web-dev-1' || courseSlug === 'web-development-1' option(value="javascript") | HTML else if courseSlug.indexOf('web-dev') >= 0 @@ -97,7 +97,7 @@ mixin course-info(course) if me.isTeacher() || view.ownedClassrooms.size() || me.isAdmin() //- Web dev courses use HTML and JavaScript, except web-dev-1 which doesn't have scripting - 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')) span(data-i18n="courses.view_guide_online") | — HTML diff --git a/app/views/NewHomeView.coffee b/app/views/NewHomeView.coffee index 68fcd7918..cddba6ce4 100644 --- a/app/views/NewHomeView.coffee +++ b/app/views/NewHomeView.coffee @@ -135,6 +135,10 @@ module.exports = class NewHomeView extends RootView 'introduction-to-computer-science': '2-4' 'game-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-7': '30-40' 'computer-science-8': '30-40' @@ -144,6 +148,10 @@ module.exports = class NewHomeView extends RootView 'introduction-to-computer-science': '1-3' 'game-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-7': '14-16' 'computer-science-8': '14-16' @@ -153,6 +161,10 @@ module.exports = class NewHomeView extends RootView 'introduction-to-computer-science': '1' 'game-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-7': '12-16' 'computer-science-8': '12-16' diff --git a/app/views/courses/TeacherClassView.coffee b/app/views/courses/TeacherClassView.coffee index 4b48bee11..8dec7245a 100644 --- a/app/views/courses/TeacherClassView.coffee +++ b/app/views/courses/TeacherClassView.coffee @@ -73,6 +73,7 @@ module.exports = class TeacherClassView extends RootView @singleStudentCourseProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-course' @singleStudentLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-level' @allStudentsLevelProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-all-students-single-level' + @urls = require('core/urls') @debouncedRender = _.debounce @render diff --git a/scripts/mongodb/updateCourses.js b/scripts/mongodb/updateCourses.js index 7a4645dba..0d10d9cd7 100644 --- a/scripts/mongodb/updateCourses.js +++ b/scripts/mongodb/updateCourses.js @@ -31,7 +31,7 @@ var courses = }, { name: "Game Development 1", - slug: "game-dev-1", + slug: "game-development-1", campaignID: ObjectId("5789236960deed1f00ec2ab8"), description: "Learn to create your own games which you can share with your friends.", duration: NumberInt(1), @@ -40,7 +40,7 @@ var courses = }, { name: "Web Development 1", - slug: "web-dev-1", + slug: "web-development-1", campaignID: ObjectId("578913f2c8871ac2326fa3e4"), description: "Learn the basics of web development in this introductory HTML & CSS course.", duration: NumberInt(1), @@ -59,7 +59,7 @@ var courses = }, { name: "Game Development 2", - slug: "game-dev-2", + slug: "game-development-2", campaignID: ObjectId("57b49c866430272000100c4d"), description: "Learn more advanced game development.", duration: NumberInt(2), @@ -68,7 +68,7 @@ var courses = }, { name: "Web Development 2", - slug: "web-dev-2", + slug: "web-development-2", campaignID: ObjectId("57891570c8871ac2326fa3f8"), description: "Learn more advanced web development, including scripting to make interactive webpages.", duration: NumberInt(2), diff --git a/server/models/Course.coffee b/server/models/Course.coffee index 1c7d8bcdc..c5d4203ba 100644 --- a/server/models/Course.coffee +++ b/server/models/Course.coffee @@ -22,22 +22,34 @@ CourseSchema.statics.sortCourses = (courses) -> 'introduction-to-computer-science' 'computer-science-2' 'game-dev-1' + 'game-development-1' 'web-dev-1' + 'web-development-1' 'computer-science-3' 'game-dev-2' + 'game-development-2' 'web-dev-2' + 'web-development-2' 'computer-science-4' 'game-dev-3' + 'game-development-3' 'web-dev-3' + 'web-development-3' 'computer-science-5' 'game-dev-4' + 'game-development-4' 'web-dev-4' + 'web-development-4' 'computer-science-6' 'game-dev-5' + 'game-development-5' 'web-dev-5' + 'web-development-5' 'computer-science-7' 'game-dev-6' + 'game-development-6' 'web-dev-6' + 'web-development-6' 'computer-science-8' ] _.sortBy courses, (course) ->