Module: TestCases
- Defined in:
- lib/testCases.rb
Class Method Summary collapse
-
.get_student ⇒ Object
return true if there is a student logged in.
-
.get_student_role ⇒ Object
return true if student has a role i.e student or tutor.
-
.is_student ⇒ Object
return true if student role is “Student”.
-
.student_has_subject ⇒ Object
return true if student has subjects of interests.
-
.student_subject_competency ⇒ Object
return true if student has set a competeny level for all subjects.
-
.tutor_subjects ⇒ Object
check to see if tutor has set subjects.
Class Method Details
.get_student ⇒ Object
return true if there is a student logged in
12 13 14 |
# File 'lib/testCases.rb', line 12 def self.get_student true if @student end |
.get_student_role ⇒ Object
return true if student has a role i.e student or tutor
17 18 19 |
# File 'lib/testCases.rb', line 17 def self.get_student_role true if @studentrole["role"] end |
.is_student ⇒ Object
return true if student role is “Student”
22 23 24 |
# File 'lib/testCases.rb', line 22 def self.is_student true if @studentrole["role"] == "Student" end |
.student_has_subject ⇒ Object
return true if student has subjects of interests
27 28 29 |
# File 'lib/testCases.rb', line 27 def self.student_has_subject true if @profile["subjects_of_interest"].length > 0 end |
.student_subject_competency ⇒ Object
return true if student has set a competeny level for all subjects
32 33 34 35 36 37 38 39 40 |
# File 'lib/testCases.rb', line 32 def self.student_subject_competency all_competency_set = true @profile["subjects_of_interest"].each do |s| if s["competency"] == nil all_competency_set = false end end return all_competency_set end |
.tutor_subjects ⇒ Object
check to see if tutor has set subjects
43 44 45 46 47 48 49 50 51 |
# File 'lib/testCases.rb', line 43 def self.tutor_subjects all_subjects_set = true @tutors.each do |t| if t["subjects"].length <= 0 all_subjects_set = false end end return all_subjects_set end |