Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dougpenny committed Apr 25, 2018
0 parents commit 6833c38
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
23 changes: 23 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://plugin.powerschool.pearson.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://plugin.powerschool.pearson.com plugin.xsd"
name="SwiftyPowerSchool PowerQueries"
version="1.0"
description="A collection of PowerQueries to be used with SwiftyPowerSchool">
<oauth></oauth>
<access_request>
<field table="courses" field="course_name" access="ViewOnly" />
<field table="courses" field="course_number" access="ViewOnly" />
<field table="sections" field="id" access="ViewOnly" />
<field table="sections" field="course_number" access="ViewOnly" />
<field table="sections" field="external_expression" access="ViewOnly" />
<field table="sections" field="no_of_students" access="ViewOnly" />
<field table="sections" field="room" access="ViewOnly" />
<field table="sections" field="teacher" access="ViewOnly" />
<field table="sections" field="termid" access="ViewOnly" />
</access_request>
<publisher name="North Raleigh Christian Academy">
<contact email="[email protected]"/>
</publisher>
</plugin>
39 changes: 39 additions & 0 deletions queries_root/sections_for_teacher.named_queries.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<queries>
<query name="com.nrcaknights.swiftypowerschool.section.get_by_teacher" coreTable="SECTIONS" flattened="true">
<description>List of sections currently being taught by a teacher</description>
<args>
<arg name="teacher_id" required="true" description="Teacher ID (not the teacher number)" type="primitive" />
</args>
<columns>
<column column="sections.id">sections.id</column>
<column column="sections.course_number">sections.course_number</column>
<column column="courses.course_name">sections.course_name</column>
<column column="sections.external_expression">sections.external_expression</column>
<column column="sections.no_of_students">sections.num_students</column>
<column column="sections.room">sections.room</column>
</columns>
<sql><![CDATA[
select
sections.id,
sections.course_number,
courses.course_name,
sections.external_expression,
sections.no_of_students,
sections.room
from
sections inner join
courses on courses.course_number = sections.course_number
where
sections.teacher = :teacher_id and
/***
To get the current term we subtract 7 months from the current date
to get the current school year and subtract this value from the
epoch year (1990) to get the first two digits of the current PowerSchool term.
4/24/2018 - 7 months -> 10/24/2017 -> 2017 - 1990 -> 27
***/
substr(sections.termid,1,2) = to_char(add_months(sysdate,-7),'YYYY') - 1990
order by
sections.external_expression
]]></sql>
</query>
</queries>

0 comments on commit 6833c38

Please sign in to comment.