🐛Exclude practice levels from course progress counts

This commit is contained in:
Matt Lott 2016-09-03 08:16:32 -07:00
parent 9888bb7cef
commit 0316cc507e
2 changed files with 3 additions and 2 deletions

View file

@ -13,6 +13,7 @@ module.exports =
instance.numCompleted = 0
instance.started = false
levels = classroom.getLevels({courseID: course.id})
levels.remove(levels.filter((level) => level.get('practice')))
for userID in instance.get('members')
instance.started ||= _.any levels.models, (level) ->
session = _.find classroom.sessions.models, (session) ->
@ -180,7 +181,7 @@ module.exports =
if _.find(sessions, (s) -> s.completed()) # have finished this level
courseProgress.completed &&= true #no-op
courseProgress[userID].completed &&= true #no-op
courseProgress[userID].levelsCompleted += 1
courseProgress[userID].levelsCompleted += 1 unless level.get('practice')
courseProgress[levelID].completed &&= true #no-op
# courseProgress[levelID].numCompleted += 1
courseProgress[levelID][userID].completed = true

View file

@ -226,7 +226,7 @@ mixin studentRow(student)
- var instance = view.courseInstances.findWhere({ courseID: course.id, classroomID: classroom.id })
if instance && instance.hasMember(student)
- var progress = state.get('progressData').get({ classroom: view.classroom, course: course, user: student })
- var levelsTotal = trimCourse.levels.length
- var levelsTotal = _.reject(trimCourse.levels, 'practice').length
//- - var level = ???
- var label = courseLabelsArray[index];
+studentCourseProgressDot(progress, levelsTotal, level, label)