Class: LUSI::API::Course::Module
- Inherits:
-
ModuleBase
- Object
- ModuleBase
- LUSI::API::Course::Module
- Defined in:
- lib/lusi_api/course.rb
Overview
Represents a module in the LUSI API
Instance Attribute Summary collapse
-
#assessment_proportions ⇒ Array<LUSI::API::Course::AssessmentProportion>?
The assessment proportions for the module.
-
#course_convenors ⇒ Array<LUSI::API::Person::StaffMember>
The course convenor(s).
-
#lecture_capture_enabled ⇒ Boolean?
True if automated lecture capture is available for the module, otherwise false.
-
#module_evaluation_cohorts ⇒ Array<LUSI::API::Course::ModuleEvaluationCohort>?
The evaluation cohorts for the module.
-
#partner_module_leaders ⇒ Array<LUSI::API::Person::StaffMember>?
The staff members leading the module.
-
#validating_institution ⇒ LUSI::API::Organisation::Unit?
The validating institution for the module.
Attributes inherited from ModuleBase
#category_level, #cohorts, #course_departments, #course_documents, #credit, #delivery_mode, #display_long_title, #display_short_title, #enrolled_students, #external_course_identity, #identity, #identity_class, #learning_hours, #mnemonic, #status, #syllabus_rules, #teaching_institution, #title, #year
Class Method Summary collapse
-
.get_instance_params(validating_institution_id: nil, **kwargs) ⇒ Object
Returns a hash of parameters for the LUSI API call.
-
.lusi_ws_endpoint ⇒ String
Returns the LUSI API endpoint.
-
.lusi_ws_method ⇒ String
Returns the LUSI API method.
-
.lusi_ws_xml_root ⇒ String
Returns the root element name of the LUSI API XML response.
Instance Method Summary collapse
- #enrolment_lookup_indices ⇒ Object
-
#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) ⇒ Module
constructor
Initialises a new Module instance.
Methods inherited from ModuleBase
#enrolment_lookup_keys, get_instance, #major_departments
Methods included from LUSI::API::Core::Endpoint
#lusi_ws_endpoint, #lusi_ws_method, #lusi_ws_path, #lusi_ws_xml_root
Constructor Details
#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) ⇒ Module
Initialises a new Module instance
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 |
# 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 |
Instance Attribute Details
#assessment_proportions ⇒ Array<LUSI::API::Course::AssessmentProportion>?
Returns the assessment proportions for the module.
1121 1122 1123 |
# File 'lib/lusi_api/course.rb', line 1121 def assessment_proportions @assessment_proportions end |
#course_convenors ⇒ Array<LUSI::API::Person::StaffMember>
Returns the course convenor(s).
1125 1126 1127 |
# File 'lib/lusi_api/course.rb', line 1125 def course_convenors @course_convenors end |
#lecture_capture_enabled ⇒ Boolean?
Returns true if automated lecture capture is available for the module, otherwise false.
1129 1130 1131 |
# File 'lib/lusi_api/course.rb', line 1129 def lecture_capture_enabled @lecture_capture_enabled end |
#module_evaluation_cohorts ⇒ Array<LUSI::API::Course::ModuleEvaluationCohort>?
Returns the evaluation cohorts for the module.
1133 1134 1135 |
# File 'lib/lusi_api/course.rb', line 1133 def module_evaluation_cohorts @module_evaluation_cohorts end |
#partner_module_leaders ⇒ Array<LUSI::API::Person::StaffMember>?
Returns the staff members leading the module.
1137 1138 1139 |
# File 'lib/lusi_api/course.rb', line 1137 def partner_module_leaders @partner_module_leaders end |
#validating_institution ⇒ LUSI::API::Organisation::Unit?
Returns the validating institution for the module.
1141 1142 1143 |
# File 'lib/lusi_api/course.rb', line 1141 def validating_institution @validating_institution end |
Class Method Details
.get_instance_params(validating_institution_id: nil, **kwargs) ⇒ Object
Returns a hash of parameters for the LUSI API call
1181 1182 1183 1184 1185 |
# 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 ⇒ String
Returns the LUSI API endpoint
1189 1190 1191 |
# File 'lib/lusi_api/course.rb', line 1189 def self.lusi_ws_endpoint 'CourseManager.asmx' end |
.lusi_ws_method ⇒ String
Returns the LUSI API method
1195 1196 1197 |
# File 'lib/lusi_api/course.rb', line 1195 def self.lusi_ws_method 'GetModuleFullDetails' end |
.lusi_ws_xml_root ⇒ String
Returns the root element name of the LUSI API XML response
1201 1202 1203 |
# File 'lib/lusi_api/course.rb', line 1201 def self.lusi_ws_xml_root 'ModuleRecord' end |
Instance Method Details
#enrolment_lookup_indices ⇒ Object
1174 1175 1176 |
# File 'lib/lusi_api/course.rb', line 1174 def enrolment_lookup_indices [:module_staff, :module_student] end |