class LUSI::API::Course::Module

Represents a module in the LUSI API

Attributes

assessment_proportions[RW]

@!attribute [rw] assessment_proportions

@return [Array<LUSI::API::Course::AssessmentProportion>, nil] the assessment proportions for the module
course_convenors[RW]

@!attribute [rw] course_convenors

@return [Array<LUSI::API::Person::StaffMember>] the course convenor(s)
lecture_capture_enabled[RW]

@!attribute [rw] lecture_capture_enabled

@return [Boolean, nil] true if automated lecture capture is available for the module, otherwise false
module_evaluation_cohorts[RW]

@!attribute [rw] module_evaluation_cohorts

@return [Array<LUSI::API::Course::ModuleEvaluationCohort>, nil] the evaluation cohorts for the module
partner_module_leaders[RW]

@!attribute [rw] partner_module_leaders

@return [Array<LUSI::API::Person::StaffMember>, nil] the staff members leading the module
validating_institution[RW]

@!attribute [rw] validating_institution

@return [LUSI::API::Organisation::Unit, nil] the validating institution for the module

Public Class Methods

get_instance_params(validating_institution_id: nil, **kwargs) click to toggle source

Returns a hash of parameters for the LUSI API call @param (see LUSI::API::Course::ModuleBase#get_instance_params) @param awarding_institution_id [String, nil] the awarding institution identity code

# File lib/lusi_api/course.rb, line 1181
def self.get_instance_params(validating_institution_id: nil, **kwargs)
  params = super(**kwargs)
  params[:ValidatingInstitutionId] = kwargs.fetch(:validating_institution_id, '')
  params
end
lusi_ws_endpoint() click to toggle source

Returns the LUSI API endpoint @return [String] the LUSI API endpoint

# File lib/lusi_api/course.rb, line 1189
def self.lusi_ws_endpoint
  'CourseManager.asmx'
end
lusi_ws_method() click to toggle source

Returns the LUSI API method @return [String] the LUSI API method

# File lib/lusi_api/course.rb, line 1195
def self.lusi_ws_method
  'GetModuleFullDetails'
end
lusi_ws_xml_root() click to toggle source

Returns the root element name of the LUSI API XML response @return [String] the root element name of the LUSI API XML response

# File lib/lusi_api/course.rb, line 1201
def self.lusi_ws_xml_root
  'ModuleRecord'
end
new(xml = nil, lookup = nil, assessment_proportions: nil, course_convenors: nil, lecture_capture_enabled: nil, module_evaluation_cohorts: nil, partner_module_leaders: nil, validating_institution: nil, **kwargs) click to toggle source

Initialises a new Module instance @param (see LUSI::API::Course::ModuleBase#initialize) @param assessment_proportions [Array<LUSI::API::Course::AssessmentProportion>, nil] the default assessment

proportions

@param course_convenors [Array<LUSI::API::Person::StaffMember>, nil] the default course convenors @param lecture_capture_enabled [Boolean, nil] the default lecture-capture-enabled flag @param module_evaluation_cohorts [Array<LUSI::API::Course::ModuleEvaluationCohort>, nil] the default

module evaluation cohorts

@param partner_module_leaders [Array<LUSI::API::Person::StaffMember>, nil] the default partner module leaders @param validating_institution [LUSI::API::Organisation::Unit] the default validating institution

Calls superclass method LUSI::API::Course::ModuleBase::new
# File lib/lusi_api/course.rb, line 1153
def initialize(xml = nil, lookup = nil, assessment_proportions: nil, course_convenors: nil,
               lecture_capture_enabled: nil, module_evaluation_cohorts: nil, partner_module_leaders: nil,
               validating_institution: nil, **kwargs)
  super(xml, lookup, **kwargs)
  @assessment_proportions = LUSI::API::Core::XML.xml(xml,
                                                     'xmlns:AssessmentProportions/xmlns:AssessmentProportion',
                                                      assessment_proportions) { |a| AssessmentProportion.new(a, lookup) }
  @course_convenors = LUSI::API::Core::XML.xml(xml, 'xmlns:CourseConvenor/xmlns:StaffMember',
                                               course_convenors) { |s| LUSI::API::Person::StaffMember.new(s, lookup) }
  @lecture_caputure_enabled = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:LectureCaptureEnabled',
                                                                 lecture_capture_enabled)
  @module_evaluation_cohorts = LUSI::API::Core::XML.xml(xml, 'xmlns:ModuleEvaluationCohorts/xmlns:ModuleEvaluationCohort',
                                                        module_evaluation_cohorts) { |m| ModuleEvaluationCohort.new(m, lookup) }
  @partner_module_leaders = LUSI::API::Core::XML.xml(xml, 'xmlns:PartnerModuleLeader/xmlns:StaffMember',
                                                     partner_module_leaders) { |s| LUSI::API::Person::StaffMember.new(s, lookup) }
  @validating_institution = LUSI::API::Core::XML.lookup(xml, lookup, :institution,
                                                        'xmlns:ValidatingInstitution/xmlns:Identity',
                                                        validating_institution)
end

Public Instance Methods

enrolment_lookup_indices() click to toggle source

@see (LUSI::API::Course::ModuleBase#enrolment_lookup_indices)

# File lib/lusi_api/course.rb, line 1174
def enrolment_lookup_indices
  [:module_staff, :module_student]
end