Sha256: 5cfc6d02a2e897b4bc2e5f42394d7dd399cc9d376ca5a3e1e59ea04b6135d087

Contents?: true

Size: 1.77 KB

Versions: 6

Compression:

Stored size: 1.77 KB

Contents

class GAKUEngine.Models.Calculation extends Backbone.Model

  initialize: ->
    @on 'change', @reRenderCalculationsView, @

  reRenderCalculationsView: ->
    calculationsView = new GAKUEngine.Views.ExamCalculationsView
                              course: @get('course')
                              exams: @get('exams')
                              student_total_scores: @get('student_total_scores')
                              exam_averages: @get('exam_averages')
                              deviation: @get('deviation')
                              students: $.parseJSON(@get('students'))
                              grades: @get('grades')
                              ranks: @get('ranks')

    $('#exam-grading-calculations').html calculationsView.render().el

    completionView = new GAKUEngine.Views.ExamCompletion(exam: @get('exams')[0], completion: @get('completion')  )
    $('.exam-name-info').html completionView.render().el

    # @tes = 1
    # console.log("calcualation.js dayo-")
    # console.log(@tes)
    # tableSizeFix = ->
      # @tes++
      # $("html").css "overflow-x", "hidden"
      # $("html").css "overflow-y", "hidden"
      # fixW = 303
      # fixW += $(".btn-warning").length * 131
      # if $(".exam_infos").length > 1
        # fixW += ($(".btn-inverse").length - 1) * 76
        # fixW += 302
      # else
        # fixW += $(".btn-inverse").length * 76
      # $(".exam_grid").width(fixW)
      # if fixW > $(window).width() - 80
        # fixW = $(window).width() - 80
      # fixH = $(".exam_grid").height()
      # if fixH > $(window).height() - $(".exam_grid").offset().top - 40
        # fixH = $(window).height() - $(".exam_grid").offset().top - 40
      # $('.exam_grid').tablefix({width: fixW, height: fixH, fixRows: 1, fixCols: 1})
    # tableSizeFix()

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gaku_core-0.0.3 app/assets/javascripts/gaku/backbone/models/calculation.js.coffee
gaku-0.0.3 core/app/assets/javascripts/gaku/backbone/models/calculation.js.coffee
gaku-0.0.2 core/app/assets/javascripts/gaku/backbone/models/calculation.js.coffee
gaku_core-0.0.2 app/assets/javascripts/gaku/backbone/models/calculation.js.coffee
gaku-0.0.1 core/app/assets/javascripts/gaku/backbone/models/calculation.js.coffee
gaku_core-0.0.1 app/assets/javascripts/gaku/backbone/models/calculation.js.coffee