Class: FlatApi::ClassApi

Inherits:
Object
  • Object
show all
Defined in:
lib/flat_api/api/class_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ClassApi

Returns a new instance of ClassApi.



19
20
21
# File 'lib/flat_api/api/class_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/flat_api/api/class_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#activate_class(_class, opts = {}) ⇒ ClassDetails

Activate the class Mark the class as active. This is mainly used for classes synchronized from Clever that are initially with an inactive state and hidden in the UI.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/flat_api/api/class_api.rb', line 27

def activate_class(_class, opts = {})
  data, _status_code, _headers = activate_class_with_http_info(_class, opts)
  data
end

#activate_class_with_http_info(_class, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Activate the class Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/flat_api/api/class_api.rb', line 37

def activate_class_with_http_info(_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.activate_class ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.activate_class"
  end
  # resource path
  local_var_path = '/classes/{class}/activate'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.activate_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#activate_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_class_user(_class, user, opts = {}) ⇒ nil

Add a user to the class This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization.

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/flat_api/api/class_api.rb', line 91

def add_class_user(_class, user, opts = {})
  add_class_user_with_http_info(_class, user, opts)
  nil
end

#add_class_user_with_http_info(_class, user, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add a user to the class This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization.

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
146
147
148
149
150
151
152
# File 'lib/flat_api/api/class_api.rb', line 102

def add_class_user_with_http_info(_class, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.add_class_user ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.add_class_user"
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.add_class_user"
  end
  # resource path
  local_var_path = '/classes/{class}/users/{user}'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.add_class_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#add_class_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_assignment(_class, assignment, opts = {}) ⇒ Assignment

Archive the assignment Archive the assignment

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:



160
161
162
163
# File 'lib/flat_api/api/class_api.rb', line 160

def archive_assignment(_class, assignment, opts = {})
  data, _status_code, _headers = archive_assignment_with_http_info(_class, assignment, opts)
  data
end

#archive_assignment_with_http_info(_class, assignment, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>

Archive the assignment Archive the assignment

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(Assignment, Integer, Hash)>)

    Assignment data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/flat_api/api/class_api.rb', line 171

def archive_assignment_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.archive_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.archive_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.archive_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Assignment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.archive_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#archive_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_class(_class, opts = {}) ⇒ ClassDetails

Archive the class Mark the class as archived. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:



228
229
230
231
# File 'lib/flat_api/api/class_api.rb', line 228

def archive_class(_class, opts = {})
  data, _status_code, _headers = archive_class_with_http_info(_class, opts)
  data
end

#archive_class_with_http_info(_class, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Archive the class Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



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
# File 'lib/flat_api/api/class_api.rb', line 238

def archive_class_with_http_info(_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.archive_class ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.archive_class"
  end
  # resource path
  local_var_path = '/classes/{class}/archive'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.archive_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#archive_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#copy_assignment(_class, assignment, body, opts = {}) ⇒ AssignmentCopyResponse

Copy an assignment Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (AssignmentCopy)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



293
294
295
296
# File 'lib/flat_api/api/class_api.rb', line 293

def copy_assignment(_class, assignment, body, opts = {})
  data, _status_code, _headers = copy_assignment_with_http_info(_class, assignment, body, opts)
  data
end

#copy_assignment_with_http_info(_class, assignment, body, opts = {}) ⇒ Array<(AssignmentCopyResponse, Integer, Hash)>

Copy an assignment Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (AssignmentCopy)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssignmentCopyResponse, Integer, Hash)>)

    AssignmentCopyResponse data, response status code and response headers



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
334
335
336
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
362
363
364
# File 'lib/flat_api/api/class_api.rb', line 305

def copy_assignment_with_http_info(_class, assignment, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.copy_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.copy_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.copy_assignment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.copy_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/copy'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentCopyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.copy_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#copy_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_class(body, opts = {}) ⇒ ClassDetails

Create a new class Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using PUT /classes/{class}/users/{user}, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using POST /classes/enroll/{enrollmentCode} and the enrollmentCode returned in the ClassDetails response.

Parameters:

  • body (ClassCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



371
372
373
374
# File 'lib/flat_api/api/class_api.rb', line 371

def create_class(body, opts = {})
  data, _status_code, _headers = create_class_with_http_info(body, opts)
  data
end

#create_class_assignment(_class, body, opts = {}) ⇒ Assignment

Assignment creation Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course.

Parameters:

  • _class (String)

    Unique identifier of the class

  • body (ClassAssignmentUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



440
441
442
443
# File 'lib/flat_api/api/class_api.rb', line 440

def create_class_assignment(_class, body, opts = {})
  data, _status_code, _headers = create_class_assignment_with_http_info(_class, body, opts)
  data
end

#create_class_assignment_with_http_info(_class, body, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>

Assignment creation Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course.

Parameters:

  • _class (String)

    Unique identifier of the class

  • body (ClassAssignmentUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Assignment, Integer, Hash)>)

    Assignment data, response status code and response headers



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
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/flat_api/api/class_api.rb', line 451

def create_class_assignment_with_http_info(_class, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.create_class_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_class_assignment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_class_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Assignment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.create_class_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#create_class_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_class_with_http_info(body, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Create a new class Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using `PUT /classes/class/users/user`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/enrollmentCode` and the `enrollmentCode` returned in the `ClassDetails` response.

Parameters:

  • body (ClassCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/flat_api/api/class_api.rb', line 381

def create_class_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.create_class ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_class"
  end
  # resource path
  local_var_path = '/classes'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.create_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#create_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_submission(_class, assignment, body, opts = {}) ⇒ AssignmentSubmission

Create or edit a submission Use this method as a student to create, update and submit a submission related to an assignment. Students can only set attachments and submit. Teachers can use PUT /classes/{class}/assignments/{assignment}/submissions/{submission} to update a submission by id.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (AssignmentSubmissionUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



515
516
517
518
# File 'lib/flat_api/api/class_api.rb', line 515

def create_submission(_class, assignment, body, opts = {})
  data, _status_code, _headers = create_submission_with_http_info(_class, assignment, body, opts)
  data
end

#create_submission_with_http_info(_class, assignment, body, opts = {}) ⇒ Array<(AssignmentSubmission, Integer, Hash)>

Create or edit a submission Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments` and `submit`. Teachers can use `PUT /classes/class/assignments/assignment/submissions/submission` to update a submission by id.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (AssignmentSubmissionUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssignmentSubmission, Integer, Hash)>)

    AssignmentSubmission data, response status code and response headers



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/flat_api/api/class_api.rb', line 527

def create_submission_with_http_info(_class, assignment, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.create_submission ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_submission"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.create_submission"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_submission"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmission'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.create_submission",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#create_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_test_student_account(_class, opts = {}) ⇒ UserDetails

Create a test student account Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Options Hash (opts):

  • :reset (Boolean)

    If true, the testing account will be re-created.

Returns:



594
595
596
597
# File 'lib/flat_api/api/class_api.rb', line 594

def (_class, opts = {})
  data, _status_code, _headers = (_class, opts)
  data
end

#create_test_student_account_with_http_info(_class, opts = {}) ⇒ Array<(UserDetails, Integer, Hash)>

Create a test student account Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Options Hash (opts):

  • :reset (Boolean)

    If true, the testing account will be re-created.

Returns:

  • (Array<(UserDetails, Integer, Hash)>)

    UserDetails data, response status code and response headers



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/flat_api/api/class_api.rb', line 605

def (_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.create_test_student_account ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_test_student_account"
  end
  # resource path
  local_var_path = '/classes/{class}/testStudent'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'reset'] = opts[:'reset'] if !opts[:'reset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.create_test_student_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#create_test_student_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_assignment(_class, assignment, opts = {}) ⇒ nil

Delete an assignment Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. archiveAssignment is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (nil)


660
661
662
663
# File 'lib/flat_api/api/class_api.rb', line 660

def delete_assignment(_class, assignment, opts = {})
  delete_assignment_with_http_info(_class, assignment, opts)
  nil
end

#delete_assignment_with_http_info(_class, assignment, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an assignment Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/flat_api/api/class_api.rb', line 671

def delete_assignment_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.delete_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.delete_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.delete_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_class_user(_class, user, opts = {}) ⇒ nil

Remove a user from the class This method can be used by a teacher of the class to remove another user from it. Removing your own account is not allowed. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions.

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:

  • (nil)


729
730
731
732
# File 'lib/flat_api/api/class_api.rb', line 729

def delete_class_user(_class, user, opts = {})
  delete_class_user_with_http_info(_class, user, opts)
  nil
end

#delete_class_user_with_http_info(_class, user, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a user from the class This method can be used by a teacher of the class to remove another user from it. Removing your own account is not allowed. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions.

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/flat_api/api/class_api.rb', line 740

def delete_class_user_with_http_info(_class, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.delete_class_user ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_class_user"
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.delete_class_user"
  end
  # resource path
  local_var_path = '/classes/{class}/users/{user}'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.delete_class_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#delete_class_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_submission(_class, assignment, submission, opts = {}) ⇒ AssignmentSubmission

Reset a submission Use this method as a teacher to reset a submission and allow student to start over the assignment

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



799
800
801
802
# File 'lib/flat_api/api/class_api.rb', line 799

def delete_submission(_class, assignment, submission, opts = {})
  data, _status_code, _headers = delete_submission_with_http_info(_class, assignment, submission, opts)
  data
end

#delete_submission_comment(_class, assignment, submission, comment, opts = {}) ⇒ nil

Delete a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • comment (String)

    Unique identifier of the comment

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

    the optional parameters

Returns:

  • (nil)


874
875
876
877
# File 'lib/flat_api/api/class_api.rb', line 874

def delete_submission_comment(_class, assignment, submission, comment, opts = {})
  delete_submission_comment_with_http_info(_class, assignment, submission, comment, opts)
  nil
end

#delete_submission_comment_with_http_info(_class, assignment, submission, comment, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • comment (String)

    Unique identifier of the comment

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/flat_api/api/class_api.rb', line 886

def delete_submission_comment_with_http_info(_class, assignment, submission, comment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.delete_submission_comment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_submission_comment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.delete_submission_comment"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.delete_submission_comment"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ClassApi.delete_submission_comment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)).sub('{comment}', CGI.escape(comment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.delete_submission_comment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#delete_submission_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_submission_with_http_info(_class, assignment, submission, opts = {}) ⇒ Array<(AssignmentSubmission, Integer, Hash)>

Reset a submission Use this method as a teacher to reset a submission and allow student to start over the assignment

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:

  • (Array<(AssignmentSubmission, Integer, Hash)>)

    AssignmentSubmission data, response status code and response headers



811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# File 'lib/flat_api/api/class_api.rb', line 811

def delete_submission_with_http_info(_class, assignment, submission, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.delete_submission ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_submission"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.delete_submission"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.delete_submission"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmission'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.delete_submission",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#delete_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_submission(_class, assignment, submission, body, opts = {}) ⇒ AssignmentSubmission

Edit a submission Use this method as a teacher to update the different submission and give feedback. Teachers can only set return, draftGrade and grade

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • body (AssignmentSubmissionUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



954
955
956
957
# File 'lib/flat_api/api/class_api.rb', line 954

def edit_submission(_class, assignment, submission, body, opts = {})
  data, _status_code, _headers = edit_submission_with_http_info(_class, assignment, submission, body, opts)
  data
end

#edit_submission_with_http_info(_class, assignment, submission, body, opts = {}) ⇒ Array<(AssignmentSubmission, Integer, Hash)>

Edit a submission Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade`

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • body (AssignmentSubmissionUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssignmentSubmission, Integer, Hash)>)

    AssignmentSubmission data, response status code and response headers



967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'lib/flat_api/api/class_api.rb', line 967

def edit_submission_with_http_info(_class, assignment, submission, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.edit_submission ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.edit_submission"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.edit_submission"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.edit_submission"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.edit_submission"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmission'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.edit_submission",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#edit_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enroll_class(enrollment_code, opts = {}) ⇒ ClassDetails

Join a class Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the ClassDetails returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization.

Parameters:

  • enrollment_code (String)

    The enrollment code, available to the teacher in `ClassDetails`

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

    the optional parameters

Returns:



1037
1038
1039
1040
# File 'lib/flat_api/api/class_api.rb', line 1037

def enroll_class(enrollment_code, opts = {})
  data, _status_code, _headers = enroll_class_with_http_info(enrollment_code, opts)
  data
end

#enroll_class_with_http_info(enrollment_code, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Join a class Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization.

Parameters:

  • enrollment_code (String)

    The enrollment code, available to the teacher in `ClassDetails`

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/flat_api/api/class_api.rb', line 1047

def enroll_class_with_http_info(enrollment_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.enroll_class ...'
  end
  # verify the required parameter 'enrollment_code' is set
  if @api_client.config.client_side_validation && enrollment_code.nil?
    fail ArgumentError, "Missing the required parameter 'enrollment_code' when calling ClassApi.enroll_class"
  end
  # resource path
  local_var_path = '/classes/enroll/{enrollmentCode}'.sub('{enrollmentCode}', CGI.escape(enrollment_code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.enroll_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#enroll_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#export_submissions_reviews_as_csv(_class, assignment, opts = {}) ⇒ File

CSV Grades exports Export list of submissions grades to a CSV file

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (File)


1101
1102
1103
1104
# File 'lib/flat_api/api/class_api.rb', line 1101

def export_submissions_reviews_as_csv(_class, assignment, opts = {})
  data, _status_code, _headers = export_submissions_reviews_as_csv_with_http_info(_class, assignment, opts)
  data
end

#export_submissions_reviews_as_csv_with_http_info(_class, assignment, opts = {}) ⇒ Array<(File, Integer, Hash)>

CSV Grades exports Export list of submissions grades to a CSV file

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/flat_api/api/class_api.rb', line 1112

def export_submissions_reviews_as_csv_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.export_submissions_reviews_as_csv ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.export_submissions_reviews_as_csv"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.export_submissions_reviews_as_csv"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/csv'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/csv']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.export_submissions_reviews_as_csv",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#export_submissions_reviews_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#export_submissions_reviews_as_excel(_class, assignment, opts = {}) ⇒ File

Excel Grades exports Export list of submissions grades to an Excel file

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (File)


1170
1171
1172
1173
# File 'lib/flat_api/api/class_api.rb', line 1170

def export_submissions_reviews_as_excel(_class, assignment, opts = {})
  data, _status_code, _headers = export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts)
  data
end

#export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts = {}) ⇒ Array<(File, Integer, Hash)>

Excel Grades exports Export list of submissions grades to an Excel file

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'lib/flat_api/api/class_api.rb', line 1181

def export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.export_submissions_reviews_as_excel ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.export_submissions_reviews_as_excel"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.export_submissions_reviews_as_excel"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/excel'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.export_submissions_reviews_as_excel",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#export_submissions_reviews_as_excel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_assignment(_class, assignment, opts = {}) ⇒ Assignment

Get an assignment Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use listAssignments to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, teacherInstructions among them.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:



1239
1240
1241
1242
# File 'lib/flat_api/api/class_api.rb', line 1239

def get_assignment(_class, assignment, opts = {})
  data, _status_code, _headers = get_assignment_with_http_info(_class, assignment, opts)
  data
end

#get_assignment_with_http_info(_class, assignment, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>

Get an assignment Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(Assignment, Integer, Hash)>)

    Assignment data, response status code and response headers



1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'lib/flat_api/api/class_api.rb', line 1250

def get_assignment_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Assignment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_class(_class, opts = {}) ⇒ ClassDetails

Get the details of a single class

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:



1306
1307
1308
1309
# File 'lib/flat_api/api/class_api.rb', line 1306

def get_class(_class, opts = {})
  data, _status_code, _headers = get_class_with_http_info(_class, opts)
  data
end

#get_class_with_http_info(_class, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Get the details of a single class

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
# File 'lib/flat_api/api/class_api.rb', line 1315

def get_class_with_http_info(_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_class ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_class"
  end
  # resource path
  local_var_path = '/classes/{class}'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_submissions(score, opts = {}) ⇒ Array<AssignmentSubmission>

List submissions related to the score This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document.

Parameters:

  • score (String)

    Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).

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

    the optional parameters

Returns:



1368
1369
1370
1371
# File 'lib/flat_api/api/class_api.rb', line 1368

def get_score_submissions(score, opts = {})
  data, _status_code, _headers = get_score_submissions_with_http_info(score, opts)
  data
end

#get_score_submissions_with_http_info(score, opts = {}) ⇒ Array<(Array<AssignmentSubmission>, Integer, Hash)>

List submissions related to the score This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document.

Parameters:

  • score (String)

    Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).

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

    the optional parameters

Returns:

  • (Array<(Array<AssignmentSubmission>, Integer, Hash)>)

    Array data, response status code and response headers



1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
# File 'lib/flat_api/api/class_api.rb', line 1378

def get_score_submissions_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_score_submissions ...'
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ClassApi.get_score_submissions"
  end
  # resource path
  local_var_path = '/scores/{score}/submissions'.sub('{score}', CGI.escape(score.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AssignmentSubmission>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_score_submissions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_score_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_submission(_class, assignment, submission, opts = {}) ⇒ AssignmentSubmission

Get a student submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



1432
1433
1434
1435
# File 'lib/flat_api/api/class_api.rb', line 1432

def get_submission(_class, assignment, submission, opts = {})
  data, _status_code, _headers = get_submission_with_http_info(_class, assignment, submission, opts)
  data
end

#get_submission_comments(_class, assignment, submission, opts = {}) ⇒ Array<AssignmentSubmissionComment>

List the feedback comments of a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



1505
1506
1507
1508
# File 'lib/flat_api/api/class_api.rb', line 1505

def get_submission_comments(_class, assignment, submission, opts = {})
  data, _status_code, _headers = get_submission_comments_with_http_info(_class, assignment, submission, opts)
  data
end

#get_submission_comments_with_http_info(_class, assignment, submission, opts = {}) ⇒ Array<(Array<AssignmentSubmissionComment>, Integer, Hash)>

List the feedback comments of a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
# File 'lib/flat_api/api/class_api.rb', line 1516

def get_submission_comments_with_http_info(_class, assignment, submission, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_submission_comments ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submission_comments"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submission_comments"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission_comments"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AssignmentSubmissionComment>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_submission_comments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_submission_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_submission_history(_class, assignment, submission, opts = {}) ⇒ Array<AssignmentSubmissionHistory>

Get the history of the submission For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



1579
1580
1581
1582
# File 'lib/flat_api/api/class_api.rb', line 1579

def get_submission_history(_class, assignment, submission, opts = {})
  data, _status_code, _headers = get_submission_history_with_http_info(_class, assignment, submission, opts)
  data
end

#get_submission_history_with_http_info(_class, assignment, submission, opts = {}) ⇒ Array<(Array<AssignmentSubmissionHistory>, Integer, Hash)>

Get the history of the submission For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
# File 'lib/flat_api/api/class_api.rb', line 1591

def get_submission_history_with_http_info(_class, assignment, submission, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_submission_history ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submission_history"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submission_history"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission_history"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/history'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AssignmentSubmissionHistory>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_submission_history",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_submission_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_submission_with_http_info(_class, assignment, submission, opts = {}) ⇒ Array<(AssignmentSubmission, Integer, Hash)>

Get a student submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

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

    the optional parameters

Returns:

  • (Array<(AssignmentSubmission, Integer, Hash)>)

    AssignmentSubmission data, response status code and response headers



1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
# File 'lib/flat_api/api/class_api.rb', line 1443

def get_submission_with_http_info(_class, assignment, submission, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_submission ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submission"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submission"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmission'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_submission",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_submissions(_class, assignment, opts = {}) ⇒ Array<AssignmentSubmission>

List the students' submissions

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:



1652
1653
1654
1655
# File 'lib/flat_api/api/class_api.rb', line 1652

def get_submissions(_class, assignment, opts = {})
  data, _status_code, _headers = get_submissions_with_http_info(_class, assignment, opts)
  data
end

#get_submissions_with_http_info(_class, assignment, opts = {}) ⇒ Array<(Array<AssignmentSubmission>, Integer, Hash)>

List the students' submissions

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(Array<AssignmentSubmission>, Integer, Hash)>)

    Array data, response status code and response headers



1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
# File 'lib/flat_api/api/class_api.rb', line 1662

def get_submissions_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.get_submissions ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submissions"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submissions"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AssignmentSubmission>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.get_submissions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#get_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_assignments(_class, opts = {}) ⇒ Array<ClassAssignment>

Assignments listing

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:



1718
1719
1720
1721
# File 'lib/flat_api/api/class_api.rb', line 1718

def list_assignments(_class, opts = {})
  data, _status_code, _headers = list_assignments_with_http_info(_class, opts)
  data
end

#list_assignments_with_http_info(_class, opts = {}) ⇒ Array<(Array<ClassAssignment>, Integer, Hash)>

Assignments listing

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:

  • (Array<(Array<ClassAssignment>, Integer, Hash)>)

    Array data, response status code and response headers



1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
# File 'lib/flat_api/api/class_api.rb', line 1727

def list_assignments_with_http_info(_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.list_assignments ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.list_assignments"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ClassAssignment>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.list_assignments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_class_student_submissions(_class, user, opts = {}) ⇒ Array<AssignmentSubmission>

List the submissions for a student Use this method as a teacher to list all the assignment submissions sent by a student of the class

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:



1781
1782
1783
1784
# File 'lib/flat_api/api/class_api.rb', line 1781

def list_class_student_submissions(_class, user, opts = {})
  data, _status_code, _headers = list_class_student_submissions_with_http_info(_class, user, opts)
  data
end

#list_class_student_submissions_with_http_info(_class, user, opts = {}) ⇒ Array<(Array<AssignmentSubmission>, Integer, Hash)>

List the submissions for a student Use this method as a teacher to list all the assignment submissions sent by a student of the class

Parameters:

  • _class (String)

    Unique identifier of the class

  • user (String)

    Unique identifier of the user

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

    the optional parameters

Returns:

  • (Array<(Array<AssignmentSubmission>, Integer, Hash)>)

    Array data, response status code and response headers



1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
# File 'lib/flat_api/api/class_api.rb', line 1792

def list_class_student_submissions_with_http_info(_class, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.list_class_student_submissions ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.list_class_student_submissions"
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.list_class_student_submissions"
  end
  # resource path
  local_var_path = '/classes/{class}/students/{user}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AssignmentSubmission>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.list_class_student_submissions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#list_class_student_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_classes(opts = {}) ⇒ Array<ClassDetails>

List the classes available for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :state (String)

    Filter the classes by state (default to 'active')

Returns:



1848
1849
1850
1851
# File 'lib/flat_api/api/class_api.rb', line 1848

def list_classes(opts = {})
  data, _status_code, _headers = list_classes_with_http_info(opts)
  data
end

#list_classes_with_http_info(opts = {}) ⇒ Array<(Array<ClassDetails>, Integer, Hash)>

List the classes available for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :state (String)

    Filter the classes by state (default to 'active')

Returns:

  • (Array<(Array<ClassDetails>, Integer, Hash)>)

    Array data, response status code and response headers



1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
# File 'lib/flat_api/api/class_api.rb', line 1857

def list_classes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.list_classes ...'
  end
  allowable_values = ["active", "inactive", "archived"]
  if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
    fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/classes'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ClassDetails>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.list_classes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#list_classes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_submission_comment(_class, assignment, submission, assignment_submission_comment_creation, opts = {}) ⇒ AssignmentSubmissionComment

Add a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • assignment_submission_comment_creation (AssignmentSubmissionCommentCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1913
1914
1915
1916
# File 'lib/flat_api/api/class_api.rb', line 1913

def post_submission_comment(_class, assignment, submission, assignment_submission_comment_creation, opts = {})
  data, _status_code, _headers = post_submission_comment_with_http_info(_class, assignment, submission, assignment_submission_comment_creation, opts)
  data
end

#post_submission_comment_with_http_info(_class, assignment, submission, assignment_submission_comment_creation, opts = {}) ⇒ Array<(AssignmentSubmissionComment, Integer, Hash)>

Add a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • assignment_submission_comment_creation (AssignmentSubmissionCommentCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssignmentSubmissionComment, Integer, Hash)>)

    AssignmentSubmissionComment data, response status code and response headers



1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
# File 'lib/flat_api/api/class_api.rb', line 1925

def post_submission_comment_with_http_info(_class, assignment, submission, assignment_submission_comment_creation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.post_submission_comment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.post_submission_comment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.post_submission_comment"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.post_submission_comment"
  end
  # verify the required parameter 'assignment_submission_comment_creation' is set
  if @api_client.config.client_side_validation && assignment_submission_comment_creation.nil?
    fail ArgumentError, "Missing the required parameter 'assignment_submission_comment_creation' when calling ClassApi.post_submission_comment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(assignment_submission_comment_creation)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmissionComment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.post_submission_comment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#post_submission_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unarchive_assignment(_class, assignment, opts = {}) ⇒ Assignment

Unarchive the assignment. Mark the assignment as active.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:



1996
1997
1998
1999
# File 'lib/flat_api/api/class_api.rb', line 1996

def unarchive_assignment(_class, assignment, opts = {})
  data, _status_code, _headers = unarchive_assignment_with_http_info(_class, assignment, opts)
  data
end

#unarchive_assignment_with_http_info(_class, assignment, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>

Unarchive the assignment. Mark the assignment as `active`.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

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

    the optional parameters

Returns:

  • (Array<(Assignment, Integer, Hash)>)

    Assignment data, response status code and response headers



2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
# File 'lib/flat_api/api/class_api.rb', line 2007

def unarchive_assignment_with_http_info(_class, assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.unarchive_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.unarchive_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.unarchive_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Assignment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.unarchive_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#unarchive_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unarchive_class(_class, opts = {}) ⇒ ClassDetails

Unarchive the class Mark the class as active. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:



2064
2065
2066
2067
# File 'lib/flat_api/api/class_api.rb', line 2064

def unarchive_class(_class, opts = {})
  data, _status_code, _headers = unarchive_class_with_http_info(_class, opts)
  data
end

#unarchive_class_with_http_info(_class, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Unarchive the class Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.

Parameters:

  • _class (String)

    Unique identifier of the class

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
# File 'lib/flat_api/api/class_api.rb', line 2074

def unarchive_class_with_http_info(_class, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.unarchive_class ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.unarchive_class"
  end
  # resource path
  local_var_path = '/classes/{class}/archive'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.unarchive_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#unarchive_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_class(_class, body, opts = {}) ⇒ ClassDetails

Update the class Update the meta information of the class

Parameters:

  • _class (String)

    Unique identifier of the class

  • body (ClassUpdate)

    Details of the Class

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

    the optional parameters

Returns:



2128
2129
2130
2131
# File 'lib/flat_api/api/class_api.rb', line 2128

def update_class(_class, body, opts = {})
  data, _status_code, _headers = update_class_with_http_info(_class, body, opts)
  data
end

#update_class_assignment(_class, assignment, body, opts = {}) ⇒ Assignment

Update an assignment Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. attachments is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already active cannot be moved back to draft. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use archiveAssignment.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (ClassAssignmentUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2203
2204
2205
2206
# File 'lib/flat_api/api/class_api.rb', line 2203

def update_class_assignment(_class, assignment, body, opts = {})
  data, _status_code, _headers = update_class_assignment_with_http_info(_class, assignment, body, opts)
  data
end

#update_class_assignment_with_http_info(_class, assignment, body, opts = {}) ⇒ Array<(Assignment, Integer, Hash)>

Update an assignment Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`.

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • body (ClassAssignmentUpdate)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Assignment, Integer, Hash)>)

    Assignment data, response status code and response headers



2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
# File 'lib/flat_api/api/class_api.rb', line 2215

def update_class_assignment_with_http_info(_class, assignment, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.update_class_assignment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.update_class_assignment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.update_class_assignment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.update_class_assignment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Assignment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.update_class_assignment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#update_class_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_class_with_http_info(_class, body, opts = {}) ⇒ Array<(ClassDetails, Integer, Hash)>

Update the class Update the meta information of the class

Parameters:

  • _class (String)

    Unique identifier of the class

  • body (ClassUpdate)

    Details of the Class

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

    the optional parameters

Returns:

  • (Array<(ClassDetails, Integer, Hash)>)

    ClassDetails data, response status code and response headers



2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
# File 'lib/flat_api/api/class_api.rb', line 2139

def update_class_with_http_info(_class, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.update_class ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.update_class"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.update_class"
  end
  # resource path
  local_var_path = '/classes/{class}'.sub('{class}', CGI.escape(_class.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ClassDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.update_class",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#update_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_submission_comment(_class, assignment, submission, comment, assignment_submission_comment_creation, opts = {}) ⇒ AssignmentSubmissionComment

Update a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • comment (String)

    Unique identifier of the comment

  • assignment_submission_comment_creation (AssignmentSubmissionCommentCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2284
2285
2286
2287
# File 'lib/flat_api/api/class_api.rb', line 2284

def update_submission_comment(_class, assignment, submission, comment, assignment_submission_comment_creation, opts = {})
  data, _status_code, _headers = update_submission_comment_with_http_info(_class, assignment, submission, comment, assignment_submission_comment_creation, opts)
  data
end

#update_submission_comment_with_http_info(_class, assignment, submission, comment, assignment_submission_comment_creation, opts = {}) ⇒ Array<(AssignmentSubmissionComment, Integer, Hash)>

Update a feedback comment to a submission

Parameters:

  • _class (String)

    Unique identifier of the class

  • assignment (String)

    Unique identifier of the assignment

  • submission (String)

    Unique identifier of the submission

  • comment (String)

    Unique identifier of the comment

  • assignment_submission_comment_creation (AssignmentSubmissionCommentCreation)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssignmentSubmissionComment, Integer, Hash)>)

    AssignmentSubmissionComment data, response status code and response headers



2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
# File 'lib/flat_api/api/class_api.rb', line 2297

def update_submission_comment_with_http_info(_class, assignment, submission, comment, assignment_submission_comment_creation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClassApi.update_submission_comment ...'
  end
  # verify the required parameter '_class' is set
  if @api_client.config.client_side_validation && _class.nil?
    fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.update_submission_comment"
  end
  # verify the required parameter 'assignment' is set
  if @api_client.config.client_side_validation && assignment.nil?
    fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.update_submission_comment"
  end
  # verify the required parameter 'submission' is set
  if @api_client.config.client_side_validation && submission.nil?
    fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.update_submission_comment"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ClassApi.update_submission_comment"
  end
  # verify the required parameter 'assignment_submission_comment_creation' is set
  if @api_client.config.client_side_validation && assignment_submission_comment_creation.nil?
    fail ArgumentError, "Missing the required parameter 'assignment_submission_comment_creation' when calling ClassApi.update_submission_comment"
  end
  # resource path
  local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)).sub('{comment}', CGI.escape(comment.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(assignment_submission_comment_creation)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignmentSubmissionComment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2']

  new_options = opts.merge(
    :operation => :"ClassApi.update_submission_comment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClassApi#update_submission_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end