   updateAverages: (task, courseId, period_id, columnIndex, isAccepted, currentValue, acceptValue) ->
     scores = @_get(courseId)
     period = _.findWhere(scores, {period_id})
-    #students = _.findWhere(period,student, {})
+    periodTasks = _.flatten(_.pluck(period.students, 'data'))
+
     numStudents = period.students.length
     currentValue = currentValue / 100
     acceptValue = acceptValue / 100
+
 
     currentAssignmentAverage = period?.data_headings[columnIndex]?.average_score
 

    period?.data_headings[columnIndex]?.average_score = assignmentAverage


    currentPeriodAverage = period?.overall_average_score

    periodAverage =
      (currentPeriodAverage - (currentValue / numStudents)) + 
      (acceptValue / numStudents)

    period?.overall_average_score = periodAverage


    students = allStudents @_get(courseId)

        taskIds = _.pluck student.data, 'id'
        _.indexOf(taskIds, taskId) > -1


    currentStudentAverage = taskStudent?.average_score

    # number of included homework tasks for student
    numTasksStudent = _.filter(taskStudent.data, {is_included_in_averages: true}).length

    studentAverage =
      (currentStudentAverage - (currentValue / numTasksStudent)) + 
      (acceptValue / numTasksStudent)

    taskStudent?.average_score = studentAverage






  acceptLate: (taskId) ->
