Module: StudyplusForSchoolSync::Endpoint::Student

Included in:
StudyplusForSchoolSync::Endpoint
Defined in:
lib/studyplus_for_school_sync/endpoint/student.rb

Instance Method Summary collapse

Instance Method Details

#attach_student_tag(student_id:, tag_id:) ⇒ Hash

Attach student tag

Parameters:

  • student_id (String)
  • tag_id (String)

Returns:

  • (Hash)

    API response



54
55
56
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 54

def attach_student_tag(student_id:, tag_id:)
  put(path: "#{BASE_PAH}/students/#{student_id}/tags/#{tag_id}")
end

#create_passcode(student_id) ⇒ Hash

Creae passcode

Parameters:

  • student_id (String)

Returns:

  • (Hash)

    API response



7
8
9
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 7

def create_passcode(student_id)
  post(path: "#{BASE_PAH}/students/#{student_id}/passcode")
end

#create_student_transfer(student_id:, partner_id:) ⇒ Hash

Create transfer student

Parameters:

  • student_id (String)
  • partner_id (String)

Returns:

  • (Hash)

    API response



78
79
80
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 78

def create_student_transfer(student_id:, partner_id:)
  post(path: "#{BASE_PAH}/students/#{student_id}/transfers", params: { partner_id: partner_id })
end

#create_study_record(learning_material_public_id:, student_public_id:, recorded_at:, **options) ⇒ Hash

Create study record

Parameters:

  • learning_material_public_id (String)
  • student_public_id (String)
  • recorded_at (String)
  • options (Hash)

Options Hash (**options):

  • :amount (Integer)
  • :number_of_seconds (Integer)
  • :start_position (Integer)
  • :end_position (Integer)
  • :comment (String)
  • :external_link (String)
  • :learning_material_customer_uid (String)
  • :student_customer_uid (String)

Returns:

  • (Hash)

    API response



32
33
34
35
36
37
38
39
40
41
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 32

def create_study_record(learning_material_public_id:, student_public_id:, recorded_at:, **options)
  post(
    path: "#{BASE_PAH}/study_records",
    params: options.merge(
      learning_material_public_id: learning_material_public_id,
      student_public_id: student_public_id,
      recorded_at: recorded_at
    )
  )
end

#detach_student_tag(student_id:, tag_id:) ⇒ Hash

Detach student tag

Parameters:

  • student_id (String)
  • tag_id (String)

Returns:

  • (Hash)

    API response



62
63
64
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 62

def detach_student_tag(student_id:, tag_id:)
  delete(path: "#{BASE_PAH}/students/#{student_id}/tags/#{tag_id}")
end

#inactivate_passcode(student_id) ⇒ Hash

Stop passcode

Parameters:

  • student_id (String)

Returns:

  • (Hash)

    API response



14
15
16
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 14

def inactivate_passcode(student_id)
  delete(path: "#{BASE_PAH}/students/#{student_id}/passcode")
end

#student_tags(student_id:) ⇒ Hash

Get student tags

Parameters:

  • student_id (String)

Returns:

  • (Hash)

    API response



46
47
48
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 46

def student_tags(student_id:)
  get(path: "#{BASE_PAH}/students/#{student_id}/tags")
end

#student_transfer(student_id:, transfer_id:) ⇒ Hash

Ge transfer student

Parameters:

  • student_id (String)
  • transfer_id (String)

Returns:

  • (Hash)

    API response



70
71
72
# File 'lib/studyplus_for_school_sync/endpoint/student.rb', line 70

def student_transfer(student_id:, transfer_id:)
  get(path: "#{BASE_PAH}/students/#{student_id}/transfers/#{transfer_id}")
end