Class: Moodle2CC::CanvasCC::Models::Assignment
- Inherits:
-
Object
- Object
- Moodle2CC::CanvasCC::Models::Assignment
- Defined in:
- lib/moodle2cc/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
-
#all_day ⇒ Object
Returns the value of attribute all_day.
-
#all_day_date ⇒ Object
Returns the value of attribute all_day_date.
-
#assignment_group_identifier_ref ⇒ Object
Returns the value of attribute assignment_group_identifier_ref.
-
#automatic_peer_reviews ⇒ Object
Returns the value of attribute automatic_peer_reviews.
-
#body ⇒ Object
Returns the value of attribute body.
-
#due_at ⇒ Object
Returns the value of attribute due_at.
-
#external_tool_url ⇒ Object
Returns the value of attribute external_tool_url.
-
#grade_group_students_individually ⇒ Object
Returns the value of attribute grade_group_students_individually.
-
#grading_type ⇒ Object
Returns the value of attribute grading_type.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#lock_at ⇒ Object
Returns the value of attribute lock_at.
-
#muted ⇒ Object
Returns the value of attribute muted.
-
#peer_review_count ⇒ Object
Returns the value of attribute peer_review_count.
-
#peer_reviews ⇒ Object
Returns the value of attribute peer_reviews.
-
#peer_reviews_assigned ⇒ Object
Returns the value of attribute peer_reviews_assigned.
-
#peer_reviews_due_at ⇒ Object
Returns the value of attribute peer_reviews_due_at.
-
#points_possible ⇒ Object
Returns the value of attribute points_possible.
-
#position ⇒ Object
Returns the value of attribute position.
-
#submission_types ⇒ Object
Returns the value of attribute submission_types.
-
#title ⇒ Object
Returns the value of attribute title.
-
#unlock_at ⇒ Object
Returns the value of attribute unlock_at.
-
#workflow_state ⇒ Object
Returns the value of attribute workflow_state.
Instance Method Summary collapse
- #assignment_resource ⇒ Object
-
#initialize ⇒ Assignment
constructor
A new instance of Assignment.
- #resources ⇒ Object
Constructor Details
#initialize ⇒ Assignment
Returns a new instance of Assignment.
11 12 13 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 11 def initialize @submission_types = [] end |
Instance Attribute Details
#all_day ⇒ Object
Returns the value of attribute all_day.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def all_day @all_day end |
#all_day_date ⇒ Object
Returns the value of attribute all_day_date.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def all_day_date @all_day_date end |
#assignment_group_identifier_ref ⇒ Object
Returns the value of attribute assignment_group_identifier_ref.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def assignment_group_identifier_ref @assignment_group_identifier_ref end |
#automatic_peer_reviews ⇒ Object
Returns the value of attribute automatic_peer_reviews.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def automatic_peer_reviews @automatic_peer_reviews end |
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def body @body end |
#due_at ⇒ Object
Returns the value of attribute due_at.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def due_at @due_at end |
#external_tool_url ⇒ Object
Returns the value of attribute external_tool_url.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def external_tool_url @external_tool_url end |
#grade_group_students_individually ⇒ Object
Returns the value of attribute grade_group_students_individually.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def grade_group_students_individually @grade_group_students_individually end |
#grading_type ⇒ Object
Returns the value of attribute grading_type.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def grading_type @grading_type end |
#identifier ⇒ Object
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def identifier @identifier end |
#lock_at ⇒ Object
Returns the value of attribute lock_at.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def lock_at @lock_at end |
#muted ⇒ Object
Returns the value of attribute muted.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def muted @muted end |
#peer_review_count ⇒ Object
Returns the value of attribute peer_review_count.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def peer_review_count @peer_review_count end |
#peer_reviews ⇒ Object
Returns the value of attribute peer_reviews.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def peer_reviews @peer_reviews end |
#peer_reviews_assigned ⇒ Object
Returns the value of attribute peer_reviews_assigned.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def peer_reviews_assigned @peer_reviews_assigned end |
#peer_reviews_due_at ⇒ Object
Returns the value of attribute peer_reviews_due_at.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def peer_reviews_due_at @peer_reviews_due_at end |
#points_possible ⇒ Object
Returns the value of attribute points_possible.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def points_possible @points_possible end |
#position ⇒ Object
Returns the value of attribute position.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def position @position end |
#submission_types ⇒ Object
Returns the value of attribute submission_types.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def submission_types @submission_types end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def title @title end |
#unlock_at ⇒ Object
Returns the value of attribute unlock_at.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def unlock_at @unlock_at end |
#workflow_state ⇒ Object
Returns the value of attribute workflow_state.
3 4 5 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 3 def workflow_state @workflow_state end |
Instance Method Details
#assignment_resource ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 19 def assignment_resource resource = Moodle2CC::CanvasCC::Models::Resource.new resource.identifier = @identifier suffix = CGI::escape(title.downcase.gsub(/\s/, '-')) suffix = suffix[0, 100] if suffix.length > 100 resource.href = "#{resource.identifier}/assignment-#{suffix}.html" resource.type = LAR_TYPE resource.files = [resource.href, "#{resource.identifier}/#{ASSIGNMENT_SETTINGS_FILE}"] resource end |
#resources ⇒ Object
15 16 17 |
# File 'lib/moodle2cc/canvas_cc/models/assignment.rb', line 15 def resources [assignment_resource] end |