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 &#x60;active&#x60;. This is mainly used for classes synchronized from Clever that are initially with an &#x60;inactive&#x60; 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'])

  # 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'])

  # 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'])

  # 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 &#x60;archived&#x60;. 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'])

  # 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'])
  # 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'])
  # 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 &#x60;PUT /classes/class/users/user&#x60;, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using &#x60;POST /classes/enroll/enrollmentCode&#x60; and the &#x60;enrollmentCode&#x60; returned in the &#x60;ClassDetails&#x60; 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'])
  # 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 &#x60;attachments&#x60; and &#x60;submit&#x60;. Teachers can use &#x60;PUT /classes/class/assignments/assignment/submissions/submission&#x60; 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'])
  # 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&#39;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'])

  # 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_class_user(_class, user, opts = {}) ⇒ nil

Remove a user from the class This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. 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)


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

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 to remove a user from the class, or by a student to leave the classroom. 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



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_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'])

  # 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:



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

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)


805
806
807
808
# File 'lib/flat_api/api/class_api.rb', line 805

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



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
866
867
868
869
870
871
872
873
874
875
# File 'lib/flat_api/api/class_api.rb', line 817

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'])

  # 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



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
791
792
793
794
795
796
# File 'lib/flat_api/api/class_api.rb', line 742

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'])

  # 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:



885
886
887
888
# File 'lib/flat_api/api/class_api.rb', line 885

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 &#x60;return&#x60;, &#x60;draftGrade&#x60; and &#x60;grade&#x60;

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



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
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/flat_api/api/class_api.rb', line 898

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'])
  # 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 &#x60;ClassDetails&#x60;

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

    the optional parameters

Returns:



968
969
970
971
# File 'lib/flat_api/api/class_api.rb', line 968

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 &#x60;ClassDetails&#x60; 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 &#x60;ClassDetails&#x60;

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

    the optional parameters

Returns:

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

    ClassDetails data, response status code and response headers



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

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'])

  # 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)


1032
1033
1034
1035
# File 'lib/flat_api/api/class_api.rb', line 1032

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



1043
1044
1045
1046
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 1043

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'])

  # 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)


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

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



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_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'])

  # 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_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:



1168
1169
1170
1171
# File 'lib/flat_api/api/class_api.rb', line 1168

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



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

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'])

  # 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. &#x60;ScoreDetails.id&#x60;) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with &#x60;drive-&#x60; (e.g. &#x60;drive-0B000000000&#x60;).

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

    the optional parameters

Returns:



1230
1231
1232
1233
# File 'lib/flat_api/api/class_api.rb', line 1230

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. &#x60;ScoreDetails.id&#x60;) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with &#x60;drive-&#x60; (e.g. &#x60;drive-0B000000000&#x60;).

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

    the optional parameters

Returns:

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

    Array<AssignmentSubmission> data, response status code and response headers



1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
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
# File 'lib/flat_api/api/class_api.rb', line 1240

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'])

  # 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:



1294
1295
1296
1297
# File 'lib/flat_api/api/class_api.rb', line 1294

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:



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

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:

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

    Array<AssignmentSubmissionComment> 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
1425
1426
1427
1428
1429
1430
1431
1432
# File 'lib/flat_api/api/class_api.rb', line 1378

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'])

  # 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:



1441
1442
1443
1444
# File 'lib/flat_api/api/class_api.rb', line 1441

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:

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

    Array<AssignmentSubmissionHistory> data, response status code and response headers



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
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
# File 'lib/flat_api/api/class_api.rb', line 1453

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'])

  # 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



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
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
# File 'lib/flat_api/api/class_api.rb', line 1305

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'])

  # 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:



1514
1515
1516
1517
# File 'lib/flat_api/api/class_api.rb', line 1514

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&#39; 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<AssignmentSubmission> data, response status code and response headers



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
1571
1572
1573
1574
# File 'lib/flat_api/api/class_api.rb', line 1524

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'])

  # 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:



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

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<ClassAssignment> data, response status code and response headers



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

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'])

  # 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:



1643
1644
1645
1646
# File 'lib/flat_api/api/class_api.rb', line 1643

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<AssignmentSubmission> data, response status code and response headers



1654
1655
1656
1657
1658
1659
1660
1661
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
# File 'lib/flat_api/api/class_api.rb', line 1654

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'])

  # 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:



1710
1711
1712
1713
# File 'lib/flat_api/api/class_api.rb', line 1710

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<ClassDetails> data, response status code and response headers



1719
1720
1721
1722
1723
1724
1725
1726
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
# File 'lib/flat_api/api/class_api.rb', line 1719

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'])

  # 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:



1775
1776
1777
1778
# File 'lib/flat_api/api/class_api.rb', line 1775

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



1787
1788
1789
1790
1791
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
1843
1844
1845
1846
1847
1848
1849
1850
# File 'lib/flat_api/api/class_api.rb', line 1787

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'])
  # 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:



1858
1859
1860
1861
# File 'lib/flat_api/api/class_api.rb', line 1858

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 &#x60;active&#x60;.

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



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
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
# File 'lib/flat_api/api/class_api.rb', line 1869

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'])

  # 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:



1926
1927
1928
1929
# File 'lib/flat_api/api/class_api.rb', line 1926

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 &#x60;active&#x60;. 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



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

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'])

  # 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:



1990
1991
1992
1993
# File 'lib/flat_api/api/class_api.rb', line 1990

def update_class(_class, body, opts = {})
  data, _status_code, _headers = update_class_with_http_info(_class, body, opts)
  data
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



2001
2002
2003
2004
2005
2006
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
# File 'lib/flat_api/api/class_api.rb', line 2001

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'])
  # 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:



2066
2067
2068
2069
# File 'lib/flat_api/api/class_api.rb', line 2066

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



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
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
# File 'lib/flat_api/api/class_api.rb', line 2079

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'])
  # 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