From 98bfcb4c9e391b00ff7dd4490257bb2b96730482 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Mon, 13 Jun 2016 14:45:24 -0700 Subject: [PATCH 1/2] Fix footer margin on TeacherClassView --- app/styles/style-flat.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/styles/style-flat.sass b/app/styles/style-flat.sass index 939de0aa4..480372890 100644 --- a/app/styles/style-flat.sass +++ b/app/styles/style-flat.sass @@ -444,7 +444,7 @@ body[lang='ru'], body[lang='uk'], body[lang='bg'], body[lang^='mk'], body[lang=' #footer background-image: url("/images/pages/home/footer_background.png") height: 229px - margin: -22px auto 0 + margin: 65px auto 0 color: white @media (max-width: $screen-sm-min) From ccf5b449e3b41d14e9a7fe74e5d25dad3ccbee37 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Mon, 13 Jun 2016 14:30:56 -0700 Subject: [PATCH 2/2] Use classroom.courses.levels instead of campaign.levels --- app/views/courses/TeacherClassView.coffee | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/views/courses/TeacherClassView.coffee b/app/views/courses/TeacherClassView.coffee index d1e8c6f24..fc821f0aa 100644 --- a/app/views/courses/TeacherClassView.coffee +++ b/app/views/courses/TeacherClassView.coffee @@ -111,9 +111,6 @@ module.exports = class TeacherClassView extends RootView return dir * diff if diff return (if student1.broadName().toLowerCase() < student2.broadName().toLowerCase() then -dir else dir) - @campaigns = new Campaigns() - @supermodel.trackRequest @campaigns.fetchByType('course', { data: { project: 'levels,slug,type' } }) - @courses = new Courses() @supermodel.trackRequest @courses.fetch() @@ -331,23 +328,18 @@ module.exports = class TeacherClassView extends RootView courseLabels += "CS#{index + 1} Playtime," courseOrder.push(course._id) csvContent = "data:text/csv;charset=utf-8,Username,Email,Total Playtime,#{courseLabels}Concepts\n" - campaignCourseMap = {} - courseMap = {} - for course in @courses.models - campaignCourseMap[course.get('campaignID')] = course - courseMap[course.id] = course levelCourseMap = {} - for campaign in @campaigns.models - continue unless campaignCourseMap[campaign.id] - for levelID, level of campaign.get('levels') - levelCourseMap[levelID] = campaignCourseMap[campaign.id] + for trimCourse in @classroom.get('courses') + for trimLevel in trimCourse.levels + levelCourseMap[trimLevel.original] = @courses.get(trimCourse._id) for student in @students.models concepts = [] - for course in @courses.models + for trimCourse in @classroom.get('courses') + course = @courses.get(trimCourse._id) instance = @courseInstances.findWhere({ courseID: course.id, classroomID: @classroom.id }) if instance and instance.hasMember(student) - # TODO: @levels collection is for the classroom, and not per-course - for level in @levels.models + for trimLevel in trimCourse.levels + level = @levels.findWhere({ original: trimLevel.original }) progress = @state.get('progressData').get({ classroom: @classroom, course: course, level: level, user: student }) concepts.push(level.get('concepts') ? []) if progress?.completed concepts = _.union(_.flatten(concepts))