       @getSubmissionsChunks()
       @initHeader()
 
-    gotAssignmentGroups: (assignmentGroups) =>
+    gotAllAssignmentGroups: () =>
+      assignmentGroups = @allAssignmentGroups;
       @assignmentGroups = {}
       @assignments      = {}
 


    gotAllStudents: ->
      @withAllStudents (students) =>
        for student_id, student of students
          student.computed_current_score ||= 0
          student.computed_final_score ||= 0

      else
        'students_url'

      @gotAllAssignmentGroupsPromise = $.Deferred().done => @gotAllAssignmentGroups()
      gotAllStudents = $.Deferred().done(()=>
        @gotAllAssignmentGroupsPromise.then(()=> @gotAllStudents())
      )

      # this method should be removed after a month in production
      @alignCoursePreferencesWithLocalStorage()

      @assignmentGroupsParams = {exclude_descriptions: true}
      if @mgpEnabled && @gradingPeriodToShow && @gradingPeriodToShow != '0' && @gradingPeriodToShow != ''
        $.extend(@assignmentGroupsParams, {grading_period_id: @gradingPeriodToShow})

      ajax_calls = [
        $.ajaxJSON(@options[enrollmentsUrl], "GET")
      , $.ajaxJSON(@options.assignment_groups_url, "GET", @assignmentGroupsParams, @gotAssignmentGroups)
      , $.ajaxJSON( @options.sections_url, "GET", {}, @gotSections)
      ]

