Class: CanvasCc::CanvasCC::Models::Assignment

Inherits:
Object
  • Object
show all
Defined in:
lib/canvas_cc/canvas_cc/models/assignment.rb

Constant Summary collapse

LAR_TYPE =
'associatedcontent/imscc_xmlv1p1/learning-application-resource'
ASSIGNMENT_SETTINGS_FILE =
'assignment_settings.xml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAssignment

Returns a new instance of Assignment.



13
14
15
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 13

def initialize
  @submission_types = []
end

Instance Attribute Details

#all_dayObject

Returns the value of attribute all_day.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def all_day
  @all_day
end

#all_day_dateObject

Returns the value of attribute all_day_date.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def all_day_date
  @all_day_date
end

#anonymous_peer_reviewsObject

Returns the value of attribute anonymous_peer_reviews.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def anonymous_peer_reviews
  @anonymous_peer_reviews
end

#assignment_group_identifier_refObject

Returns the value of attribute assignment_group_identifier_ref.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def assignment_group_identifier_ref
  @assignment_group_identifier_ref
end

#automatic_peer_reviewsObject

Returns the value of attribute automatic_peer_reviews.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def automatic_peer_reviews
  @automatic_peer_reviews
end

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def body
  @body
end

#due_atObject

Returns the value of attribute due_at.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def due_at
  @due_at
end

#grade_group_students_individuallyObject

Returns the value of attribute grade_group_students_individually.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def grade_group_students_individually
  @grade_group_students_individually
end

#grading_standard_identifier_refObject

Returns the value of attribute grading_standard_identifier_ref.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def grading_standard_identifier_ref
  @grading_standard_identifier_ref
end

#grading_typeObject

Returns the value of attribute grading_type.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def grading_type
  @grading_type
end

#identifierObject

Returns the value of attribute identifier.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def identifier
  @identifier
end

#lock_atObject

Returns the value of attribute lock_at.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def lock_at
  @lock_at
end

#mutedObject

Returns the value of attribute muted.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def muted
  @muted
end

#omit_from_final_gradeObject

Returns the value of attribute omit_from_final_grade.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def omit_from_final_grade
  @omit_from_final_grade
end

#peer_review_countObject

Returns the value of attribute peer_review_count.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def peer_review_count
  @peer_review_count
end

#peer_reviewsObject

Returns the value of attribute peer_reviews.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def peer_reviews
  @peer_reviews
end

#peer_reviews_assignedObject

Returns the value of attribute peer_reviews_assigned.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def peer_reviews_assigned
  @peer_reviews_assigned
end

#peer_reviews_due_atObject

Returns the value of attribute peer_reviews_due_at.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def peer_reviews_due_at
  @peer_reviews_due_at
end

#points_possibleObject

Returns the value of attribute points_possible.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def points_possible
  @points_possible
end

#positionObject

Returns the value of attribute position.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def position
  @position
end

#quiz_identifierrefObject

Returns the value of attribute quiz_identifierref.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def quiz_identifierref
  @quiz_identifierref
end

#rubricObject

Returns the value of attribute rubric.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def rubric
  @rubric
end

#rubric_hide_score_totalObject

Returns the value of attribute rubric_hide_score_total.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def rubric_hide_score_total
  @rubric_hide_score_total
end

#rubric_use_for_gradingObject

Returns the value of attribute rubric_use_for_grading.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def rubric_use_for_grading
  @rubric_use_for_grading
end

#submission_typesObject

Returns the value of attribute submission_types.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def submission_types
  @submission_types
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def title
  @title
end

#turnitin_enabledObject

Returns the value of attribute turnitin_enabled.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def turnitin_enabled
  @turnitin_enabled
end

#unlock_atObject

Returns the value of attribute unlock_at.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def unlock_at
  @unlock_at
end

#workflow_stateObject

Returns the value of attribute workflow_state.



3
4
5
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 3

def workflow_state
  @workflow_state
end

Instance Method Details

#assignment_resourceObject



21
22
23
24
25
26
27
28
29
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 21

def assignment_resource
  resource = CanvasCc::CanvasCC::Models::Resource.new
  resource.identifier = @identifier
  resource.href = "#{resource.identifier}/assignment-#{CGI::escape(title.downcase.gsub(/\s/, '-'))}.html"
  resource.type = LAR_TYPE
  resource.files = [resource.href, "#{resource.identifier}/#{ASSIGNMENT_SETTINGS_FILE}"]

  resource
end

#resourcesObject



17
18
19
# File 'lib/canvas_cc/canvas_cc/models/assignment.rb', line 17

def resources
  [assignment_resource]
end