synergy

package module
v0.0.0-...-fce085f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

studentvue

Structured API calls to EDUPoint's StudentVue alongside representitive data structs.

Disclaimer

The API as of now is still being worked on and is flexible to drastic change and should not be used until it is stabilized

Installation

go get github.com/abimek/synergy

Features

  • GradeBook
  • Attendance
  • ReportCard
  • Calendar
  • StudentInfo
  • SchoolInfo

ToDo

  • Implement Proper Districting
  • Student Class List
  • Studnet Health Info
  • Login Confirmation

Example

package main

import (
	"fmt"

	 "github.com/abimek/synergy"
)

func main() {
	client := synergy.New("school portal", 0o000000, "password")

	pb := synergy.ParamaterBuilder{}
	pb.Add(&synergy.ReportPeriodParamater{Period: 0})

	gradebook, err := client.GradeBook(&pb)
	if err != nil {
		fmt.Println("issue getting grade")
		return
	}

	// Print the points gained on the fourth assignment in marking period 1 in course 1
	fmt.Println(gradebook.Courses[0].Marks[0].Assignments[3].Score.Points)
}

Documentation

Index

Constants

View Source
const (
	ReportPeriodNone = -1
)

Variables

This section is empty.

Functions

func GetXmlString

func GetXmlString(text string) (*string, error)

Types

type Absence

type Absence struct {
	AbsenceDate           Time     `xml:"AbsenceDate,attr"`
	Reason                string   `xml:"Reason,attr"`
	Note                  string   `xml:"Note,attr"`
	DailyIconName         string   `xml:"DailyIconName,attr"`
	CodeAllDayReasonType  string   `xml:"CodeAllDayReasonType,attr"`
	CodeAllDayDescription string   `xml:"CodeAllDayDescription,attr"`
	Periods               []Period `xml:"Periods>Period"`
}

A signle instance / day which you were absence

type Assignment

type Assignment struct {
	GradebookID        int    `xml:"GradebookID,attr"`
	Measure            string `xml:"Measure,attr"`
	Type               string `xml:"Type,attr"`
	Date               Time   `xml:"Date,attr"`
	DueDate            Time   `xml:"DueDate,attr"`
	Score              Score  `xml:"Score,attr"`
	ScoreType          string `xml:"ScoreType,attr"`
	Points             Points `xml:"Points,attr"`
	Notes              string `xml:"Notes,attr"`
	TeacherID          int    `xml:"TeacherID,attr"`
	StudentID          int    `xml:"StudentID,attr"`
	MeasureDescription string `xml:"MeasureDescription,attr"`
	HasDropBox         bool   `xml:"HasDropBox,attr"`
	DropStartDate      Time   `xml:"DropStartDate,attr"`
	DropEndDate        Time   `xml:"DropEndDate,attr"`
	Resources          string `xml:"Resources"`
	Standards          string `xml:"Standards"`
}

type Attendance

type Attendance struct {
	Type                   string             `xml:"Type,attr"`
	StartPeriod            byte               `xml:"StartPeriod,attr"`
	EndPeriod              byte               `xml:"EndPeriod,attr"`
	PeriodCount            byte               `xml:"PeriodCount,attr"`
	SchoolName             string             `xml:"SchoolName,attr"`
	Absences               []Absence          `xml:"Absences>Absence"`
	TotalExcused           []PeriodTotal      `xml:"TotalExcused>PeriodTotal"`
	TotalTardies           []PeriodTotal      `xml:"TotalTardies>PeriodTotal"`
	TotalUnexcused         []PeriodTotal      `xml:"TotalUnexcused>PeriodTotal"`
	TotalActivities        []PeriodTotal      `xml:"TotalActivities>PeriodTotal"`
	TotalUnexcusedTardies  []PeriodTotal      `xml:"TotalUnexcusedTardies"`
	ConcurrentSchoolsLists []ConcurrentSchool `xml:"ConcurrentSchoolsLists>ConcurrentSchoolsList"`
}

type CalendarListing

type CalendarListing struct {
	SchoolBegDate Time    `xml:"SchoolBegDate,attr"`
	SchoolEndDate Time    `xml:"SchoolEndDate,attr"`
	MonthBegDate  Time    `xml:"MonthBegDate,attr"`
	MonthEndDate  Time    `xml:"MonthEndDate,attr"`
	EventList     []Event `xml:"EventLists>EventList"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(url string, identifier int, password string) Client

func (*Client) Attendance

func (client *Client) Attendance() (*Attendance, error)

func (*Client) CalendarListing

func (client *Client) CalendarListing() (*CalendarListing, error)

func (*Client) GradeBook

func (client *Client) GradeBook(builder *ParamaterBuilder) (*GradeBook, error)

func (*Client) ReportCard

func (client *Client) ReportCard() (*ReportingPeriods, error)

Returns a ReportingPeriods struct which contains all the reporting periods

func (*Client) Request

func (c *Client) Request(endpoint Endpoint, handle Handle, method Method, head *Header, paramaters *Paramater) (*string, error)

func (*Client) SchoolInfo

func (client *Client) SchoolInfo() (*SchoolInfo, error)

func (*Client) StudentInfo

func (client *Client) StudentInfo() (*StudentInfo, error)

type ConcurrentSchool

type ConcurrentSchool struct {
	ConcurrentOrgYearGU  string `xml:"ConcurrentOrgYearGU,attr"`
	ConcurrentSchoolName string `xml:"ConcurrentSchoolName,attr"`
}

This represents a specific concurrent school

type Course

type Course struct {
	UsesRichContent                         bool   `xml:"UsesRichContent,attr"`
	Period                                  int8   `xml:"Period,attr"`
	Title                                   string `xml:"Title,attr"`
	Room                                    string `xml:"Room,attr"`
	Staff                                   string `xml:"Staff,attr"`
	StaffEMail                              string `xml:"StaffEMail,attr"`
	StaffGU                                 string `xml:"StaffGU,attr"`
	HighlightPercentageCutOffForProgressBar int    `xml:"HighlightPercentageCutOffForProgressBar,attr"`
	Marks                                   []Mark `xml:"Marks>Mark"`
}

type DocumentGUParmater

type DocumentGUParmater struct {
	DocumentGU string
}

Used in the ReportCard DocumentData Method to request a specific document

func (*DocumentGUParmater) ToString

func (p *DocumentGUParmater) ToString() string

type EmergencyContact

type EmergencyContact struct {
	Name         string `xml:"Name,attr"`
	Relationship string `xml:"Relationship,attr"`
	HomePhone    string `xml:"HomePhone,attr"`
	WorkPhone    string `xml:"WorkPhone,attr"`
	OtherPhone   string `xml:"OtherPhone,attr"`
	MobilePhone  string `xml:"MobilePhone,attr"`
}

type Endpoint

type Endpoint string
const (
	PXPEndpoint Endpoint = "/Service/PXPCommunication.asmx/ProcessWebServiceRequest"
	HDEndpoint  Endpoint = "/Service/HDInfoCommunication.asmx/ProcessWebServiceRequest"
)

type Event

type Event struct {
	Date           Time   `xml:"Date,attr"`
	Title          string `xml:"Title,attr"`
	DayType        string `xml:"DayType,attr"`
	StartTime      string `xml:"StartTime,attr"`
	Icon           string `xml:"Icon,attr"`
	AGU            string `xml:"AGU,attr"`
	Link           string `xml:"Link,attr"`
	DGU            string `xml:"DGU,attr"`
	ViewType       int    `xml:"ViewType,attr"`
	AddLinkData    string `xml:"AddLinkData,attr"`
	EvtDescription string `xml:"EvtDescription,attr"`
}

Specific Event on the calendar

type GradeBook

type GradeBook struct {
	Type                       string         `xml:"Type,attr"`
	ErrorMessage               string         `xml:"ErrorMessage,attr"`
	HideStandardGraphInd       bool           `xml:"HideStandardGraphInd,attr"`
	HideMarksColumnElementary  bool           `xml:"HideMarksColumnElementary,attr"`
	HidePointsColumnElementary bool           `xml:"HidePointsColumnElementary,attr"`
	HidePercentSecondary       bool           `xml:"HidePercentSecondary,attr"`
	DisplayStandardsData       bool           `xml:"DisplayStandardsData,attr"`
	GBStandardsTabDefault      bool           `xml:"GBStandardsTabDefault,attr"`
	ReportingPeriods           []ReportPeriod `xml:"ReportingPeriods>ReportPeriod"`
	ReportingPeriod            struct {
		GradePeriod string `xml:"GradePeriod,attr"`
		StartDate   Time   `xml:"StartDate,attr"`
		EndDate     Time   `xml:"EndDate,attr"`
	} `xml:"ReportingPeriod"`
	Courses []Course `xml:"Courses>Course"`
}

type GradeType

type GradeType string
const (
	MajorSummative  GradeType = "Major Summative"
	MinorSummative  GradeType = "Minor Summative"
	FormalFormative GradeType = "Formal Formative"
)

type Handle

type Handle string
const (
	PXPWebServices Handle = "PXPWebServices"
	HDInfoServices Handle = "HDInfoServices"
)
type Header map[string]string

func DefaultHeader

func DefaultHeader() Header

func (*Header) AddHeader

func (h *Header) AddHeader(key, value string)

func (*Header) ApplyHeader

func (h *Header) ApplyHeader(r *http.Request)

type Mark

type Mark struct {
	MarkName                string       `xml:"MarkName,attr"`
	CalculatedScoreString   string       `xml:"CalculatedScoreString,attr"`
	CalculatedScoreRaw      int8         `xml:"CalculatedScoreRaw,attr"`
	StandardViews           string       `xml:"StandardViews"`
	GradeCalculationSummary string       `xml:"GradeCalculationSummary"`
	Assignments             []Assignment `xml:"Assignments>Assignment"`
}

type MatchToDistrictZipCodeParamater

type MatchToDistrictZipCodeParamater struct {
	ZipCode int
}

GetMatchingDistrictList Method: Specifies a specific zip code to return all the schools in it

func (*MatchToDistrictZipCodeParamater) ToString

type Method

type Method string
const (
	GradeBookMethod                 Method = "Gradebook"
	GetMatchingDistrictListMethod   Method = "GetMatchingDistrictList"
	AttendanceMethod                Method = "Attendance"
	StudentCalendarMethod           Method = "StudentCalendar"
	StudentInfoMethod               Method = "StudentInfo"
	StudentSchoolInfoMethod         Method = "StudentSchoolInfo"
	GetReportCardInitialDataMethod  Method = "GetReportCardInitialData"
	GetReportCardDocumentDataMethod Method = "GetReportCardDocumentData"
)

type Paramater

type Paramater string

func GetEmptyParamater

func GetEmptyParamater() Paramater

type ParamaterBuilder

type ParamaterBuilder struct {
	// contains filtered or unexported fields
}

func NewParamaterBuilder

func NewParamaterBuilder() ParamaterBuilder

func (*ParamaterBuilder) Add

func (p *ParamaterBuilder) Add(paramater ParamaterType)

func (*ParamaterBuilder) Build

func (p *ParamaterBuilder) Build() Paramater

type ParamaterType

type ParamaterType interface {
	ToString() string
}

type Period

type Period struct {
	Number     byte   `xml:"Number,attr"`
	Name       string `xml:"Name,attr"`
	Reason     string `xml:"Reason,attr"`
	Course     string `xml:"Course,attr"`
	Staff      string `xml:"Staff,attr"`
	StaffEMail string `xml:"StaffEMail,attr"`
	IconName   string `xml:"IconName,attr"`
	SchoolName string `xml:"SchoolName,attr"`
	StaffGU    string `xml:"StaffGU,attr"`
	OrgYearGU  string `xml:"OrgYearGU,attr"`
}

This type represents a signle Period in which you were absent

type PeriodTotal

type PeriodTotal struct {
	Number byte `xml:"Number,attr"`
	Total  byte `xml:"Total,attr"`
}

Represents one speciifc Period

type PointType

type PointType string
const (
	NormalPoints  PointType = "normal"
	PendingPoints PointType = "pending"
)

type Points

type Points struct {
	Type   PointType
	Points float64
	Total  float64
}

func (Points) MarshalText

func (f Points) MarshalText() ([]byte, error)

Marshal for Points

func (*Points) UnmarshalText

func (f *Points) UnmarshalText(text []byte) error

Unmarshal for Points

type ReportCard

type ReportCard struct {
	DocumentGU  string `xml:"DocumentGU,attr"`
	FileName    string `xml:"FileName,attr"`
	DocFileName string `xml:"DocFileName,attr"`
	DocType     string `xml:"DocType,attr"`
	Base64Code  string `xml:"Base64Code"`
}

I don't currently know how to decode the Base64Code into a PDF

type ReportPeriod

type ReportPeriod struct {
	GradePeriod string `xml:"GradePeriod,attr"`
	StartDate   Time   `xml:"StartDate,attr"`
	EndDate     Time   `xml:"EndDate,attr"`
}

type ReportPeriodParamater

type ReportPeriodParamater struct {
	Period int
}

GradeBook Method: Report Periods species which period to get grades from when using the GradeBook Method

func (*ReportPeriodParamater) ToString

func (p *ReportPeriodParamater) ToString() string

type ReportingPeriod

type ReportingPeriod struct {
	ReportingPeriodGU   string `xml:"ReportingPeriodGU,attr"`
	ReportingPeriodName string `xml:"ReportingPeriodName,attr"`
	EndDate             string `xml:"EndDate,attr"`
	Message             string `xml:"Message,attr"`
	DocumentGU          string `xml:"DocumentGU,attr"`
}

func (*ReportingPeriod) GetReportCard

func (p *ReportingPeriod) GetReportCard(client *Client) (*ReportCard, error)

type ReportingPeriods

type ReportingPeriods struct {
	ReportingPeriods []ReportingPeriod `xml:"RCReportingPeriods>RCReportingPeriod"`
}

type SchoolInfo

type SchoolInfo struct {
	School         string  `xml:"School,attr"`
	Principal      string  `xml:"Principal,attr"`
	SchoolAddress  string  `xml:"SchoolAddress,attr"`
	SchoolAddress2 string  `xml:"SchoolAddress2,attr"`
	SchoolCity     string  `xml:"SchoolCity,attr"`
	SchoolState    string  `xml:"SchoolState,attr"`
	SchoolZip      int     `xml:"SchoolZip,attr"`
	Phone          string  `xml:"Phone,attr"`
	Phone2         string  `xml:"Phone2,attr"`
	URL            string  `xml:"URL,attr"`
	PrincipalEmail string  `xml:"PrincipalEmail,attr"`
	PrincipalGu    string  `xml:"PrincipalGu,attr"`
	StaffList      []Staff `xml:"StaffLists>StaffList"`
}

type Score

type Score struct {
	Type        ScoreType
	Points      float64
	Total       float64
	LetterGrade string
}

func (Score) MarshalText

func (f Score) MarshalText() ([]byte, error)

Marshal for Score struct

func (*Score) UnmarshalText

func (f *Score) UnmarshalText(text []byte) error

Unmarshal for Score struct

type ScoreType

type ScoreType string
const (
	NormalScore          ScoreType = "normal"
	NotGradedScore       ScoreType = "not graded"
	CharachterGradeScore ScoreType = "charachter grade"
)

type Staff

type Staff struct {
	Name    string `xml:"Name,attr"`
	EMail   string `xml:"EMail,attr"`
	Title   string `xml:"Title,attr"`
	Phone   string `xml:"Phone,attr"`
	Extn    string `xml:"Extn,attr"`
	StaffGU string `xml:"StaffGU,attr"`
}

type StudentInfo

type StudentInfo struct {
	LockerInfo struct {
		LockerGU           string `xml:"LockerGU,attr"`
		LockerNumber       string `xml:"LockerNumber,attr"`
		CurrentCombination string `xml:"CurrentCombination,attr"`
		Location           string `xml:"Location,attr"`
	} `xml:"LockerInfoRecords>StudentLockerInfoRecord"`
	FormattedName      string             `xml:"FormattedName"`
	PermID             int                `xml:"PermID"`
	Gender             string             `xml:"Gender"`
	Grade              byte               `xml:"Grade"`
	Address            string             `xml:"Address"`
	LastNameGoesBy     string             `xml:"LastNameGoesBy"`
	NickName           string             `xml:"NickName"`
	BirthDate          Time               `xml:"BirthDate"`
	EMail              string             `xml:"EMail"`
	Phone              string             `xml:"Phone"`
	HomeLanguage       string             `xml:"HomeLanguage"`
	CurrentSchool      string             `xml:"CurrentSchool"`
	Track              string             `xml:"Track"`
	HomeRoomTch        string             `xml:"HomeRoomTch"`
	HomeRoomTchEMail   string             `xml:"HomeRoomTchEMail"`
	HomeRoomTchStaffGU string             `xml:"HomeRoomTchStaffGU"`
	OrgYearGU          string             `xml:"OrgYearGU"`
	HomeRoom           string             `xml:"HomeRoom"`
	CounselorName      string             `xml:"CounselorName"`
	CounselorEmail     string             `xml:"CounselorEmail"`
	CounselorStaffGU   string             `xml:"CounselorStaffGU"`
	Photo              string             `xml:"Photo"`
	EmergencyContacts  []EmergencyContact `xml:"EmergencyContacts>EmergencyContact"`
	Physician          struct {
		Name     string `xml:"Name,attr"`
		Hospital string `xml:"Hospital,attr"`
		Phone    string `xml:"Phone,attr"`
		Extn     string `xml:"Extn,attr"`
	} `xml:"Physician"`
	Dentist struct {
		Name   string `xml:"Name,attr"`
		Office string `xml:"Office,attr"`
		Phone  string `xml:"Phone,attr"`
		Extn   string `xml:"Extn,attr"`
	} `xml:"Dentist"`
	UserDefinedGroupBoxes []UserDefinedGroupBox `xml:"UserDefinedGroupBoxes>UserDefinedGroupBox"`
}

type Time

type Time struct {
	Time time.Time
}

/ I need to wrap the Time struct in my own to enable xml encoding and decoding

func (Time) MarshalText

func (t Time) MarshalText() ([]byte, error)

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(text []byte) error

type UserDefinedGroupBox

type UserDefinedGroupBox struct {
	GroupBoxLabel    string            `xml:"GroupBoxLabel,attr"`
	GroupBoxID       string            `xml:"GroupBoxID,attr"`
	VCID             string            `xml:"VCID,attr"`
	UserDefinedItems []UserDefinedItem `xml:"UserDefinedItems>UserDefinedItem"`
}

type UserDefinedItem

type UserDefinedItem struct {
	ItemLabel     string `xml:"ItemLabel,attr"`
	ItemType      string `xml:"ItemType,attr"`
	SourceObject  string `xml:"SourceObject,attr"`
	SourceElement string `xml:"SourceElement,attr"`
	VCID          string `xml:"VCID,attr"`
	Value         string `xml:"Value,attr"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL