Class: PowerSchool::Students

Inherits:
Object
  • Object
show all
Defined in:
lib/power_school/students.rb

Class Method Summary collapse

Class Method Details

.find(full_name) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/power_school/students.rb', line 4

def self.find( full_name )
    PowerSchool::Connection.go_home
    PowerSchool.browser.text_field(:id => "ss").set full_name
    PowerSchool.browser.button(:id => "btnSearch").click
    if PowerSchool.browser.frame(:id => "frameContent").exists?
        PowerSchool.browser.frame(:id => "frameContent").div(:id => "content-main").p.text
    else
        false
    end
end

.import(file_path) ⇒ Object



15
16
17
# File 'lib/power_school/students.rb', line 15

def self.import(file_path)
    PowerSchool::Connection.quick_import('Students', file_path)
end

.list_array(fields = ["Student_Number", "LastFirst", "Grade_Level"], css = "#content-main .box-round table tr", enroll_status = "Active") ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/power_school/students.rb', line 19

def self.list_array( fields = ["Student_Number", "LastFirst", "Grade_Level"], css = "#content-main .box-round table tr", enroll_status = "Active" )
    case enroll_status
        when "Active"
            PowerSchool::Connection.go_home("?selectstudent=")
        when "Pre-registered"
            PowerSchool::Connection.go_home("?selectstudent=/enroll_status=-1")
    end
    PowerSchool::Connection.go_to("studentlist/studentlist1.html")

    PowerSchool::Connection.clear_form

    fields.each_with_index do |field, index|
        index = index + 1
        PowerSchool.browser.text_field(:id => "tt"+index.to_s).set (field)
    end
    PowerSchool.browser.button(:id => "btnSubmit").click
    student_array = PowerSchool.table_to_a( PowerSchool.browser.html, css)
end