class FlatApi::ClassApi
Attributes
Public Class Methods
# File lib/flat_api/api/class_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 28 def activate_class(_class, opts = {}) data, _status_code, _headers = activate_class_with_http_info(_class, opts) return data end
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 38 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' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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 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. @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [nil]
# File lib/flat_api/api/class_api.rb, line 84 def add_class_user(_class, user, opts = {}) add_class_user_with_http_info(_class, user, opts) return nil end
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. @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 95 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' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) 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 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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 143 def archive_class(_class, opts = {}) data, _status_code, _headers = archive_class_with_http_info(_class, opts) return data end
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 153 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' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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 an assignment Copy an assignment to a specified class. If the original assignment has a due date in the past, this new assingment will be created without a due date. If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param body @param [Hash] opts the optional parameters @return [Assignment]
# File lib/flat_api/api/class_api.rb, line 200 def copy_assignment(_class, assignment, body, opts = {}) data, _status_code, _headers = copy_assignment_with_http_info(_class, assignment, body, opts) return data end
Copy an assignment Copy an assignment to a specified class. If the original assignment has a due date in the past, this new assingment will be created without a due date. If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param body @param [Hash] opts the optional parameters @return [Array<(Assignment
, Fixnum, Hash)>] Assignment
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 212 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' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Assignment') 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
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @option opts [AssignmentCreation] :body @return [Assignment]
# File lib/flat_api/api/class_api.rb, line 266 def create_assignment(_class, opts = {}) data, _status_code, _headers = create_assignment_with_http_info(_class, opts) return data end
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @option opts [AssignmentCreation] :body @return [Array<(Assignment
, Fixnum, Hash)>] Assignment
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 277 def create_assignment_with_http_info(_class, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClassApi.create_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_assignment" end # resource path local_var_path = "/classes/{class}/assignments".sub('{' + 'class' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Assignment') if @api_client.config.debugging @api_client.config.logger.debug "API called: ClassApi#create_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
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 `POST /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. @param body @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 322 def create_class(body, opts = {}) data, _status_code, _headers = create_class_with_http_info(body, opts) return data end
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 `POST /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. @param body @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 332 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 = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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 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`, `studentComment` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param body @param [Hash] opts the optional parameters @return [AssignmentSubmission]
# File lib/flat_api/api/class_api.rb, line 379 def create_submission(_class, assignment, body, opts = {}) data, _status_code, _headers = create_submission_with_http_info(_class, assignment, body, opts) return data end
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`, `studentComment` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param body @param [Hash] opts the optional parameters @return [Array<(AssignmentSubmission
, Fixnum, Hash)>] AssignmentSubmission
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 391 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' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AssignmentSubmission') 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
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. @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [nil]
# File lib/flat_api/api/class_api.rb, line 445 def delete_class_user(_class, user, opts = {}) delete_class_user_with_http_info(_class, user, opts) return nil end
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. @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 456 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' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) 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
Edit a submission Use this method as a teacher to update the different submission and give feedback. Teachers can only set `returnFeedback` @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param submission Unique identifier of the submission @param body @param [Hash] opts the optional parameters @return [AssignmentSubmission]
# File lib/flat_api/api/class_api.rb, line 507 def edit_submission(_class, assignment, submission, body, opts = {}) data, _status_code, _headers = edit_submission_with_http_info(_class, assignment, submission, body, opts) return data end
Edit a submission Use this method as a teacher to update the different submission and give feedback. Teachers can only set `returnFeedback` @param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param submission Unique identifier of the submission @param body @param [Hash] opts the optional parameters @return [Array<(AssignmentSubmission
, Fixnum, Hash)>] AssignmentSubmission
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 520 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' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s).sub('{' + 'submission' + '}', submission.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AssignmentSubmission') 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
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. @param enrollment_code The enrollment code, available to the teacher in `ClassDetails` @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 577 def enroll_class(enrollment_code, opts = {}) data, _status_code, _headers = enroll_class_with_http_info(enrollment_code, opts) return data end
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. @param enrollment_code The enrollment code, available to the teacher in `ClassDetails` @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 587 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' + '}', enrollment_code.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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
Get the details of a single class
@param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 632 def get_class(_class, opts = {}) data, _status_code, _headers = get_class_with_http_info(_class, opts) return data end
Get the details of a single class
@param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 642 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' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<AssignmentSubmission>]
# File lib/flat_api/api/class_api.rb, line 687 def get_score_submissions(score, opts = {}) data, _status_code, _headers = get_score_submissions_with_http_info(score, opts) return data end
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 697 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' + '}', score.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AssignmentSubmission>') 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 a student submission
@param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param submission Unique identifier of the submission @param [Hash] opts the optional parameters @return [AssignmentSubmission]
# File lib/flat_api/api/class_api.rb, line 744 def get_submission(_class, assignment, submission, opts = {}) data, _status_code, _headers = get_submission_with_http_info(_class, assignment, submission, opts) return data end
Get a student submission
@param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param submission Unique identifier of the submission @param [Hash] opts the optional parameters @return [Array<(AssignmentSubmission
, Fixnum, Hash)>] AssignmentSubmission
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 756 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' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s).sub('{' + 'submission' + '}', submission.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AssignmentSubmission') 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
List the students' submissions
@param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param [Hash] opts the optional parameters @return [Array<AssignmentSubmission>]
# File lib/flat_api/api/class_api.rb, line 810 def get_submissions(_class, assignment, opts = {}) data, _status_code, _headers = get_submissions_with_http_info(_class, assignment, opts) return data end
List the students' submissions
@param _class Unique identifier of the class @param assignment Unique identifier of the assignment @param [Hash] opts the optional parameters @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 821 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' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AssignmentSubmission>') 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
Assignments listing
@param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<Assignment>]
# File lib/flat_api/api/class_api.rb, line 870 def list_assignments(_class, opts = {}) data, _status_code, _headers = list_assignments_with_http_info(_class, opts) return data end
Assignments listing
@param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<(Array<Assignment>, Fixnum, Hash)>] Array<Assignment> data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 880 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' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<Assignment>') 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 the submissions for a student Use this method as a teacher to list all the assignment submissions sent by a student of the class @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [Array<AssignmentSubmission>]
# File lib/flat_api/api/class_api.rb, line 926 def list_class_student_submissions(_class, user, opts = {}) data, _status_code, _headers = list_class_student_submissions_with_http_info(_class, user, opts) return data end
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 @param _class Unique identifier of the class @param user Unique identifier of the user @param [Hash] opts the optional parameters @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 937 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' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AssignmentSubmission>') 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 the classes available for the current user
@param [Hash] opts the optional parameters @option opts [String] :state Filter the classes by state (default to active) @return [Array<ClassDetails>]
# File lib/flat_api/api/class_api.rb, line 986 def list_classes(opts = {}) data, _status_code, _headers = list_classes_with_http_info(opts) return data end
List the classes available for the current user
@param [Hash] opts the optional parameters @option opts [String] :state Filter the classes by state @return [Array<(Array<ClassDetails>, Fixnum, Hash)>] Array<ClassDetails> data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 996 def list_classes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClassApi.list_classes ..." end if @api_client.config.client_side_validation && opts[:'state'] && !['active', 'inactive', 'archived'].include?(opts[:'state']) fail ArgumentError, 'invalid value for "state", must be one of active, inactive, archived' end # resource path local_var_path = "/classes" # query parameters query_params = {} query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ClassDetails>') 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
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 1041 def unarchive_class(_class, opts = {}) data, _status_code, _headers = unarchive_class_with_http_info(_class, opts) return data end
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. @param _class Unique identifier of the class @param [Hash] opts the optional parameters @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 1051 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' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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 the class Update the meta information of the class @param _class Unique identifier of the class @param [Hash] opts the optional parameters @option opts [ClassUpdate] :body Details of the Class @return [ClassDetails]
# File lib/flat_api/api/class_api.rb, line 1097 def update_class(_class, opts = {}) data, _status_code, _headers = update_class_with_http_info(_class, opts) return data end
Update the class Update the meta information of the class @param _class Unique identifier of the class @param [Hash] opts the optional parameters @option opts [ClassUpdate] :body Details of the Class @return [Array<(ClassDetails
, Fixnum, Hash)>] ClassDetails
data, response status code and response headers
# File lib/flat_api/api/class_api.rb, line 1108 def update_class_with_http_info(_class, 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 # resource path local_var_path = "/classes/{class}".sub('{' + 'class' + '}', _class.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClassDetails') 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