Class: FlatApi::AssignmentCopyResponse

Inherits:
ApiModelBase show all
Defined in:
lib/flat_api/models/assignment_copy_response.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ AssignmentCopyResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/flat_api/models/assignment_copy_response.rb', line 204

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AssignmentCopyResponse` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'type')
    self.type = attributes[:'type']
  else
    self.type = nil
  end

  if attributes.key?(:'capabilities')
    self.capabilities = attributes[:'capabilities']
  else
    self.capabilities = nil
  end

  if attributes.key?(:'title')
    self.title = attributes[:'title']
  else
    self.title = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'description_html')
    self.description_html = attributes[:'description_html']
  end

  if attributes.key?(:'teacher_instructions')
    self.teacher_instructions = attributes[:'teacher_instructions']
  end

  if attributes.key?(:'teacher_instructions_html')
    self.teacher_instructions_html = attributes[:'teacher_instructions_html']
  end

  if attributes.key?(:'cover')
    self.cover = attributes[:'cover']
  end

  if attributes.key?(:'cover_file')
    self.cover_file = attributes[:'cover_file']
  end

  if attributes.key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  else
    self.attachments = nil
  end

  if attributes.key?(:'use_dedicated_attachments')
    self.use_dedicated_attachments = attributes[:'use_dedicated_attachments']
  end

  if attributes.key?(:'max_points')
    self.max_points = attributes[:'max_points']
  end

  if attributes.key?(:'release_grades')
    self.release_grades = attributes[:'release_grades']
  end

  if attributes.key?(:'shuffle_exercises')
    self.shuffle_exercises = attributes[:'shuffle_exercises']
  end

  if attributes.key?(:'toolset')
    self.toolset = attributes[:'toolset']
  end

  if attributes.key?(:'nb_playback_authorized')
    self.nb_playback_authorized = attributes[:'nb_playback_authorized']
  end

  if attributes.key?(:'restrict_play_note')
    self.restrict_play_note = attributes[:'restrict_play_note']
  end

  if attributes.key?(:'restrict_to_audio_tracks')
    self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks']
  end

  if attributes.key?(:'submission_students_mode')
    self.submission_students_mode = attributes[:'submission_students_mode']
  end

  if attributes.key?(:'recording_type')
    self.recording_type = attributes[:'recording_type']
  end

  if attributes.key?(:'allow_metronome')
    self.allow_metronome = attributes[:'allow_metronome']
  end

  if attributes.key?(:'allow_backing_track')
    self.allow_backing_track = attributes[:'allow_backing_track']
  end

  if attributes.key?(:'allow_speed_change')
    self.allow_speed_change = attributes[:'allow_speed_change']
  end

  if attributes.key?(:'free_record')
    self.free_record = attributes[:'free_record']
  end

  if attributes.key?(:'resource')
    self.resource = attributes[:'resource']
  end
end

Instance Attribute Details

#allow_backing_trackObject

For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'.



82
83
84
# File 'lib/flat_api/models/assignment_copy_response.rb', line 82

def allow_backing_track
  @allow_backing_track
end

#allow_metronomeObject

For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'.



79
80
81
# File 'lib/flat_api/models/assignment_copy_response.rb', line 79

def allow_metronome
  @allow_metronome
end

#allow_speed_changeObject

For performance assignments: whether students can adjust the playback speed of the score during recording. * true: Students can change the tempo/speed during practice and recording * false: Tempo is fixed to the original score tempo Only set when type is 'performance'.



85
86
87
# File 'lib/flat_api/models/assignment_copy_response.rb', line 85

def allow_speed_change
  @allow_speed_change
end

#attachmentsObject

Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of.



47
48
49
# File 'lib/flat_api/models/assignment_copy_response.rb', line 47

def attachments
  @attachments
end

#capabilitiesObject

Returns the value of attribute capabilities.



23
24
25
# File 'lib/flat_api/models/assignment_copy_response.rb', line 23

def capabilities
  @capabilities
end

#coverObject

The URL of the cover to display



41
42
43
# File 'lib/flat_api/models/assignment_copy_response.rb', line 41

def cover
  @cover
end

#cover_fileObject

The id of the cover to display



44
45
46
# File 'lib/flat_api/models/assignment_copy_response.rb', line 44

def cover_file
  @cover_file
end

#descriptionObject

Student instructions and content of the assignment (plain text)



29
30
31
# File 'lib/flat_api/models/assignment_copy_response.rb', line 29

def description
  @description
end

#description_htmlObject

HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs.



32
33
34
# File 'lib/flat_api/models/assignment_copy_response.rb', line 32

def description_html
  @description_html
end

#free_recordObject

For performance assignments: "Free Record" mode. When true, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'.



88
89
90
# File 'lib/flat_api/models/assignment_copy_response.rb', line 88

def free_record
  @free_record
end

#idObject

Unique identifier of the assignment



19
20
21
# File 'lib/flat_api/models/assignment_copy_response.rb', line 19

def id
  @id
end

#max_pointsObject

If set, the grading will be enabled for the assignement



53
54
55
# File 'lib/flat_api/models/assignment_copy_response.rb', line 53

def max_points
  @max_points
end

#nb_playback_authorizedObject

The number of playback authorized on the scores of the assignment.



65
66
67
# File 'lib/flat_api/models/assignment_copy_response.rb', line 65

def nb_playback_authorized
  @nb_playback_authorized
end

#recording_typeObject

For performance assignments: recording type that will be either 'audio' or 'video'. * audio: Only audio will be required during the recording. * video: Camera will be required during the recording. Only set when type is 'performance'.



76
77
78
# File 'lib/flat_api/models/assignment_copy_response.rb', line 76

def recording_type
  @recording_type
end

#release_gradesObject

For worksheets, how grading will work for the assignment: - If set to auto, the grades will be automatically released when the student submits the submissions - If set to manual, the grades will only be set as draftGrade and will be released when the teacher returns the submissions



56
57
58
# File 'lib/flat_api/models/assignment_copy_response.rb', line 56

def release_grades
  @release_grades
end

#resourceObject

If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource.



91
92
93
# File 'lib/flat_api/models/assignment_copy_response.rb', line 91

def resource
  @resource
end

#restrict_play_noteObject

Restrict the ability to get an audio feedback every time a student adds or selects a note.



68
69
70
# File 'lib/flat_api/models/assignment_copy_response.rb', line 68

def restrict_play_note
  @restrict_play_note
end

#restrict_to_audio_tracksObject

Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.



71
72
73
# File 'lib/flat_api/models/assignment_copy_response.rb', line 71

def restrict_to_audio_tracks
  @restrict_to_audio_tracks
end

#shuffle_exercisesObject

Mixing worksheets exercises for each student



59
60
61
# File 'lib/flat_api/models/assignment_copy_response.rb', line 59

def shuffle_exercises
  @shuffle_exercises
end

#submission_students_modeObject

Returns the value of attribute submission_students_mode.



73
74
75
# File 'lib/flat_api/models/assignment_copy_response.rb', line 73

def submission_students_mode
  @submission_students_mode
end

#teacher_instructionsObject

Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If teacherInstructionsHtml is provided, this field will contain the plain text version for compatibility.



35
36
37
# File 'lib/flat_api/models/assignment_copy_response.rb', line 35

def teacher_instructions
  @teacher_instructions
end

#teacher_instructions_htmlObject

HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs.



38
39
40
# File 'lib/flat_api/models/assignment_copy_response.rb', line 38

def teacher_instructions_html
  @teacher_instructions_html
end

#titleObject

Title of the assignment



26
27
28
# File 'lib/flat_api/models/assignment_copy_response.rb', line 26

def title
  @title
end

#toolsetObject

The id of the associated toolset



62
63
64
# File 'lib/flat_api/models/assignment_copy_response.rb', line 62

def toolset
  @toolset
end

#typeObject

Returns the value of attribute type.



21
22
23
# File 'lib/flat_api/models/assignment_copy_response.rb', line 21

def type
  @type
end

#use_dedicated_attachmentsObject

For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments.



50
51
52
# File 'lib/flat_api/models/assignment_copy_response.rb', line 50

def use_dedicated_attachments
  @use_dedicated_attachments
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



148
149
150
# File 'lib/flat_api/models/assignment_copy_response.rb', line 148

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



153
154
155
# File 'lib/flat_api/models/assignment_copy_response.rb', line 153

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/flat_api/models/assignment_copy_response.rb', line 116

def self.attribute_map
  {
    :'id' => :'id',
    :'type' => :'type',
    :'capabilities' => :'capabilities',
    :'title' => :'title',
    :'description' => :'description',
    :'description_html' => :'descriptionHtml',
    :'teacher_instructions' => :'teacherInstructions',
    :'teacher_instructions_html' => :'teacherInstructionsHtml',
    :'cover' => :'cover',
    :'cover_file' => :'coverFile',
    :'attachments' => :'attachments',
    :'use_dedicated_attachments' => :'useDedicatedAttachments',
    :'max_points' => :'maxPoints',
    :'release_grades' => :'releaseGrades',
    :'shuffle_exercises' => :'shuffleExercises',
    :'toolset' => :'toolset',
    :'nb_playback_authorized' => :'nbPlaybackAuthorized',
    :'restrict_play_note' => :'restrictPlayNote',
    :'restrict_to_audio_tracks' => :'restrictToAudioTracks',
    :'submission_students_mode' => :'submissionStudentsMode',
    :'recording_type' => :'recordingType',
    :'allow_metronome' => :'allowMetronome',
    :'allow_backing_track' => :'allowBackingTrack',
    :'allow_speed_change' => :'allowSpeedChange',
    :'free_record' => :'freeRecord',
    :'resource' => :'resource'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/flat_api/models/assignment_copy_response.rb', line 497

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



196
197
198
199
200
# File 'lib/flat_api/models/assignment_copy_response.rb', line 196

def self.openapi_all_of
  [
  :'Assignment'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



190
191
192
193
# File 'lib/flat_api/models/assignment_copy_response.rb', line 190

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/flat_api/models/assignment_copy_response.rb', line 158

def self.openapi_types
  {
    :'id' => :'String',
    :'type' => :'AssignmentType',
    :'capabilities' => :'AssignmentCapabilities',
    :'title' => :'String',
    :'description' => :'String',
    :'description_html' => :'String',
    :'teacher_instructions' => :'String',
    :'teacher_instructions_html' => :'String',
    :'cover' => :'String',
    :'cover_file' => :'String',
    :'attachments' => :'Array<MediaAttachment>',
    :'use_dedicated_attachments' => :'Boolean',
    :'max_points' => :'Float',
    :'release_grades' => :'String',
    :'shuffle_exercises' => :'Boolean',
    :'toolset' => :'String',
    :'nb_playback_authorized' => :'Float',
    :'restrict_play_note' => :'Boolean',
    :'restrict_to_audio_tracks' => :'Boolean',
    :'submission_students_mode' => :'AssignmentSubmissionStudentsMode',
    :'recording_type' => :'String',
    :'allow_metronome' => :'Boolean',
    :'allow_backing_track' => :'Boolean',
    :'allow_speed_change' => :'Boolean',
    :'free_record' => :'Boolean',
    :'resource' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/flat_api/models/assignment_copy_response.rb', line 451

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      type == o.type &&
      capabilities == o.capabilities &&
      title == o.title &&
      description == o.description &&
      description_html == o.description_html &&
      teacher_instructions == o.teacher_instructions &&
      teacher_instructions_html == o.teacher_instructions_html &&
      cover == o.cover &&
      cover_file == o.cover_file &&
      attachments == o.attachments &&
      use_dedicated_attachments == o.use_dedicated_attachments &&
      max_points == o.max_points &&
      release_grades == o.release_grades &&
      shuffle_exercises == o.shuffle_exercises &&
      toolset == o.toolset &&
      nb_playback_authorized == o.nb_playback_authorized &&
      restrict_play_note == o.restrict_play_note &&
      restrict_to_audio_tracks == o.restrict_to_audio_tracks &&
      submission_students_mode == o.submission_students_mode &&
      recording_type == o.recording_type &&
      allow_metronome == o.allow_metronome &&
      allow_backing_track == o.allow_backing_track &&
      allow_speed_change == o.allow_speed_change &&
      free_record == o.free_record &&
      resource == o.resource
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


484
485
486
# File 'lib/flat_api/models/assignment_copy_response.rb', line 484

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



490
491
492
# File 'lib/flat_api/models/assignment_copy_response.rb', line 490

def hash
  [id, type, capabilities, title, description, description_html, teacher_instructions, teacher_instructions_html, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record, resource].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/flat_api/models/assignment_copy_response.rb', line 337

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @type.nil?
    invalid_properties.push('invalid value for "type", type cannot be nil.')
  end

  if @capabilities.nil?
    invalid_properties.push('invalid value for "capabilities", capabilities cannot be nil.')
  end

  if @title.nil?
    invalid_properties.push('invalid value for "title", title cannot be nil.')
  end

  if @attachments.nil?
    invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/flat_api/models/assignment_copy_response.rb', line 519

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/flat_api/models/assignment_copy_response.rb', line 365

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @type.nil?
  return false if @capabilities.nil?
  return false if @title.nil?
  return false if @attachments.nil?
  release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"])
  return false unless release_grades_validator.valid?(@release_grades)
  recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"])
  return false unless recording_type_validator.valid?(@recording_type)
  true
end