Sha256: cf380bde4a45f66d692672cedbeacaf0a900a487800f8eae406974b5e61e5279

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

ready = ->

  self = this

  class CoursesController
    edit: ->
      self.app.student_chooser()

    grading: ->

      socket = io.connect("http://localhost:5001")

      socket.on "grading-change", (message) ->
        exam_id   = message.exam_id
        course_id = message.course_id
        if message.exam_portion_score
          exam_portion_score = message.exam_portion_score.exam_portion_score
          form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
          input = form.children('input#exam_portion_score_score')
          input.val("#{exam_portion_score.score}")
        for grading_method_id, calculation of message.calculations
          if calculation.student_results
            console.log('vika me collection')
            for result in calculation.student_results
              el = $("#course-#{course_id}-exam-#{exam_id}-student-#{result.id}-grading-method-#{grading_method_id}-score")
              el.html result.score

          else
            console.log('vika me single')
            el = $("#course-#{course_id}-exam-#{exam_id}-student-#{calculation.id}-grading-method-#{grading_method_id}-score")
            el.html calculation.score

  @app.courses = new CoursesController

$(document).ready(ready)
$(document).on('page:load', ready)

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gaku-0.2.4 frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku_frontend-0.2.4 app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku-0.2.3 frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku_frontend-0.2.3 app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku-0.2.2 frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku_frontend-0.2.2 app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku-0.2.1 frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku_frontend-0.2.1 app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku-0.2.0 frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee
gaku_frontend-0.2.0 app/assets/javascripts/gaku/frontend/courses.js.coffee