/school_loop

Client for School Loop API (OpenLoop)

Primary LanguageRubyMIT LicenseMIT

School Loop API

Build Status Gem Version

Installation

Install the gem by issuing

gem install school_loop

or put it in your Gemfile and run bundle install

gem "school_loop"

Configuration

These global settings will be used unless specifically overridden by an instance below.

SchoolLoop.configure do |config|
  config.subdomain  = 'demoschool'
  config.username   = 'apiuser'
  config.password   = 'some_api_password'
  config.adapter    = :net_http
end

Usage

Create a new client using the global defaults:

school_loop = SchoolLoop.new

Create a new client instance and override global defaults

school_loop = SchoolLoop.new subdomain: 'demoschool', username: 'apiuser', password: 'some_api_password'

Alternatively, you can configure the School Loop settings by passing a block:

school_loop = SchoolLoop.new do |config|
  config.subdomain  = 'demoschool'
  config.username   = 'apiuser'
  config.password   = 'some_api_password'
  config.adapter    = :net_http
end

Currently, only three methods are implemented:

Get Entire School Roster

roster = school_loop.get_roster
# returns a Nokogiri::XML::Document

Get Teacher Roster

teacher_id = "12345"
roster = school_loop.get_roster(teacher_id)
# returns a Nokogiri::XML::Document (with a single 'teacher' node)

Example roster data is available on School Loop's Documentation

Posting Progress Reports

For a detailed schema for Progress reports, you can look at School Loop's Progress Report API Schema

prog_report_xml = <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <sections>
    <section ID="1234">
      <progressReports>
        <progressReport markName="Current Grades" ... grade="A">
          ...
        </progressReport>
      </progressReports>
    </section>
  </sections>
</root>
EOF

school_loop.publish_progress_report(prog_report_xml)

License

MIT

Special Thanks

This gem is heavily based on the bitbucket_rest_api gem by Mike Cochran.