Class: LMSGraphQL::Mutations::Canvas::CreateScore

Inherits:
BaseMutation
  • Object
show all
Defined in:
lib/lms_graphql/mutations/canvas/create_score.rb

Instance Method Summary collapse

Instance Method Details

#resolve(course_id:, line_item_id:, userId:, activityProgress:, gradingProgress:, timestamp:, scoreGiven: nil, scoreMaximum: nil, comment: nil, submission: nil) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/lms_graphql/mutations/canvas/create_score.rb', line 21

def resolve(course_id:, line_item_id:, userId:, activityProgress:, gradingProgress:, timestamp:, scoreGiven: nil, scoreMaximum: nil, comment: nil, submission: nil)
  context[:canvas_api].call("CREATE_SCORE").proxy(
    "CREATE_SCORE",
    {
      "course_id": course_id,
      "line_item_id": line_item_id
    },
    {
      "userId": userId,
      "activityProgress": activityProgress,
      "gradingProgress": gradingProgress,
      "timestamp": timestamp,
      "scoreGiven": scoreGiven,
      "scoreMaximum": scoreMaximum,
      "comment": comment,
      "https://canvas.instructure.com/lti/submission": submission
    },
  ).parsed_response
end