Observations PM API

Global Variables

  • OBSBASE = /disks/www/myrecord/observations
  • STATUS_DESC (hash array of descriptive names for each status type -- IP, IP2, Stu, C)
  • ACCESSTYPE_NAME (hash array of descriptive names for each access type -- student, mentor, principal, supervisor, progcoord)

Functions

  • getCurrentSemester
    • calls Utils::getCurrentSemester to determine the current semester.
  • getBeginningDate
    • Estimate the Internship start date based on the current semester
  • getPrograms
    • Retrieve an array of Observation_Programs
      • Each element of array is a hash reference
      • Hash variables are:
        • ObsProgramID
        • ProgramAbbreviation
        • ProgramName
        • CoordinatorName, CoordinatorEmail, StudentType, Active
    • Input: 0, 1 (whereclause), or 2 (whereclause and orderby clause) arguments.
    • if where clause not provided, empty string used
    • if orderby clause not provided, ProgramName will be used
  • getProgramInfo
    • Retrieve hash array containing data about a given program
    • Input: Program ID
    • Hash Variables:
      • ProgramAbbrev
      • ProgramName
      • CoordinatorName
      • CoordinatorEmail
      • StudentType
      • Active
      • Active_1 = CHECKED if Active == 1
      • Active_0 = CHECKED if Active == 0
  • getCoordinatorPrograms
    • Return array of hash array references containing the programs belonging to a given coordinator e-mail address
    • Input: e-mail address
    • Hash Variables of each array element
      • ObsProgramID
      • ProgramAbbreviation
      • ProgramName
  • getProgramForms
    • Returns an array of hash array references for the forms associated with a given program
    • Input: Program ID, where clause (Optional)
    • The optional where clause adds additional conditions (other than restricting to the requested program id)
    • Hash variables of each array element
      • ObsFormID
      • ObsProgramID
      • FormName
      • FormDisplay
      • ReflectionQuestion
      • FinalEmailSubject
      • ObservationDate
      • ConferenceData
      • Reflection
      • OverallRating
      • SendFinalStudent
      • SendFinalSupervisor
      • SendFinalMentor
      • SendFinalCoordinator
      • SendFinalPrincipal
      • CompletedBy
      • FormDisplayAbbrev
      • Active
  • getObservationFormByObsID
    • Retrive the Form ID for a given Observation ID
    • Input: Observation ID
  • getObservationStudentID
    • Return the ObsStudentID for a given semester, UIN, and record count
    • Input: Semester, UIN or Email, Record Count
    • Output: ObsStudentID
  • isStudent
    • Return 0 (if not found) or 1 (if found) and email address for given UIN and semester
    • Input: UIN, Semester
  • addObservationStudent
    • Add a new record to Observations_Students based on data provided
    • Input: string containing tab-delimited data needed to instantiate the record
  • getName
    • Retrieve a person's name in the student records based on e-mail
    • Input: e-mail address
  • getAccessType
    • Retrieve the access type based on a given email address and ObsStudentID
    • Input: email, ObsStudentID
  • getAccessTypeBySemester
    • Retrieve all Access Types for a given email address and semester
    • Input: e-mail, semester
    • Ouput: comma-deimited list of access types
  • getObservationStudentData
    • Retrieve a hash array of the data from a given Observations_Students record
    • Input: ObsStudentID
    • Hash Variables:
      • ObsStudentID
      • Semester
      • Program
      • StudentUIN
      • StudentRecordCt
      • StudentFirstName
      • StudentLastName
      • StudentEmail
      • SupervisorFirstName
      • SupervisorLastName
      • SupervisorEmail
      • PrincipalFirstName
      • PrincipalLastName
      • PrincipalEmail
      • MentorFirstName
      • MentorLastName
      • MentorEmail
      • District
      • School
      • GradeLevel
      • Subject
      • InternshipBeginningDate
      • ObsProgramID
  • convertTimeForSelect
    • Return the hour and minute parts of a time value
    • Input: HH:MM
    • Output: Hour, Minute
  • convertTimeTo12HR
    • Return the time portion + am/pm from a 24 hour time formatted string
    • Input: HH:MM (in 24 hour time)
    • Output: hh:MM (in 12 hour time), am or pm
  • validateTime
    • Returns whether or not a given time value is a valid time
    • Input: HH:MM, am/pm
    • Output: 0 or 1 depending on whether the input is a valid time
  • canSubmitForm
    • Returns whether or not a given access type can submit a given form
    • Input: Access type, form id
    • Uses completedby and reflection data associated with form id
  • finalizeObservation
    • Set status of observation to "Stu"
    • Input: Observation ID
  • setObservationStatus
    • Set the status of an observation
    • Input: Observation ID, New Status
  • updateProgramAnswer
    • Update an observation answer
    • Input: Observation ID, Question, Question Type, Answer, Comments
  • getObservationStatus
    • Get the status of a given observation
    • Input: Observation ID
  • recordReflection
    • Record a student reflection
    • Input: Obsevation ID, Student Reflection
    • Output: 0 or 1 (depending on success), and a returned message
  • updateProgramAnswerFile
    • Records the answer for question type "file" and uploads the file
    • Input: Observation ID, Variable name for the file element containing the file to upload, %fdat
  • recordProgramData
    • Record the program/form specific portion of an Observation 
    • Input: Observation ID, %fdat
  • getFormInfo
    • Retrieve hash array of data associated with a given Form ID
    • Input: Form ID
    • Hash Variables:
      • ObsFormID
      • ObsProgramID
      • FormName
      • FormDisplay
      • ReflectionQuestion
      • FinalEmailSubject
      • ObsDate (alias of ObservationDate)
      • ObservationDate
      • ConfDate (alias of ConferenceDate)
      • ConferenceData
      • Reflection
      • OverallRating
      • SendFinalStudent
      • SendFinalEmailTo_Student
      • SendSupervisor
      • SendFinalEmailTo_University Supervisor
      • SendFinalMentor
      • SendFinalEmailTo_Cooperating/Mentor Teacher
      • SendFinalCoordinator
      • SendFinalEmailTo_Program Coordinator
      • SendFinalPrincipal
      • SendFinalEmailTo_Principal
      • CompletedBy
      • FormDisplayAbbrev
      • Active
      • Active_1 = CHECKED if Active = 1
      • Active_0 = CHECKED if Active = 0
  • recordObservation
    • Record an observation
    • Input: %fdat
  • getProgramObservationData
    • Retrieve an hash array containing the program/form specific portion of an observation
    • Input: Observation ID
    • The variables of the hash array are the Question IDs
    • Each array element is a hash reference containing the individual answer's data
    • Hash Variables for each answer
      • ObsAnswerID
      • QuestionType
      • Answer
      • AnswerDisp
      • TextAnswer
      • Answer_[Answer] = CHECKED (to be used in radio/check boxes for defaults)
  • getObservationData
    • Retrieve a hash array containing the common data associated with an observation
    • Input: Observation ID
    • Hash Variables:
      • ObservationID
      • ObsStudentID
      • FormType
      • ObservationDate
      • ObservationTimeIn
      • ObservationTimeOut
      • ObservationTimeIn12Hr
      • ObservationTimeInAMPM
      • ObservationTimeInHour
      • ObservationTimeInMinute
      • ObservationTimeOut12Hr
      • ObservationTimeOutAMPM
      • ObservationTimeOutHour
      • ObservationTimeOutMinute
      • ConferenceTimeIn
      • ConferenceTimeOut
      • ConferenceTimeIn12Hr
      • ConferenceTimeInAMPM
      • ConferenceTimeInHour
      • ConferenceTimeInMinute
      • ConferenceTimeOut12Hr
      • ConferenceTimeOutAMPM
      • ConferenceTimeOutHour
      • ConferenceTimeOutMinute
      • OverallRating
      • OverallComments
      • Status
      • SubmissionTime
      • Reflection
      • ReflectionTime
      • ObsFormID
  • getObservations
    • Retrieve an array of hash references of observations associated with a given Observation Student ID that is accessible by a person with a given accesstype for that ObsStudentID
    • Input: ObsStudentID, accesstype
    • Hash Variable for each array element
      • ObservationID
      • ObservationDate
      • Status
      • ObsFormID
      • FormName
      • SubmissionTime
      • ConferrenceDate
      • SubmissionDate
      • DisplayDate [Calculated: coalesce( ObservationDate, ConferenceDate, SubmissionTime) ]
      • FormNameDisplay
      • CompletedBy
      • ViewableBy
  • updateProgram
    • Update a Observations_Programs record
    • Input: ObsProgramID, form hash aray
    • Will create new or update existing
    • Output: ObsProgramID, MESSAGE with error or debug information
  • validObsProgramID
    • Determine if given ID is associated with a valid Obserations_Programs record
    • Input: ObsProgramID
    • Output: 1 if yes, 0 if no
  • updateForm
    • Update a Observations_Forms record
    • Input: ObsFormID, form hash aray
    • Will create new or update existing
    • Output: ObsFormOD, MESSAGE with error or debug information
  • studentReflection
    • Return HTML to display the Student Reflection (either for editing or display)
    • Input: accesstype, observation status, Reflection text, ObsFormID
    • If the observation has not been submitted, return empty string
    • If the observation has been submitted to the student (and the accesstype is student), display a text area where the reflection would be input.
    • If this is a blank form for demonstration, display text area
    • If the observation is complete, display the reflection question with the student response.
  • sendFinalEmail
    • Distribute final observation (after reflection complete, if one is required) via email based on Form settings (send to mentor, principal, etc.).
    • Input: ObsStudentID, Observation ID, ObsFormID, ResendTo (Optional)
    • ResendTo is used if this is a program coordinator sending an additional copy to someone who reported not receiving the original.
      • ResendTo=0, resend to all
      • ResendTo=1 (Student)
      • ResendTo=2 (University Supervisor)
      • ResendTo=3 (Principal)
      • ResendTo=4 (Mentor)
      • ResendTo=5 (Coordinator)
    • Output: the string "Email sent to: " + list of people sent to
    • Updates the observation status to Completed.
  • sendStudentEmail
    • Send request for reflection email to student
    • Input: ObsStudentID, ObservationID
    • Sets Observation Status to "Stu"
    • Output: Display message
  • sendAccessKey
    • Send the KEY to access the front observation page for a gen e-mail address
    • Input: Email Address
    • If the given email address is found within an Observations_Students record (as student, mentor, principal or supervisor) OR if the email is a program coordinator email, send an email to the address with a link to the observation system containing the KEY.  If not found, return a message to user.
  • getProgramID
    • Retrieve the ObsProgramID associated with a given program abbreviation
    • Input: Program Abbreviation
    • Output: ObsProgramID
  • isProgramCoordinator
    • Determine if the given email address is the program coordinator for an active program
    • Input: email address
    • Output: 0=no,  1=yes
  • getObservationSemesters
    • Retrieve a list of all semesters for which Observation Student records exists
    • Input: none
    • Ouput: array of semester ids
  • getUserSemesters
    • Retrieve a list of all semesters for which a given email is associated with on observation
    • Input: email address
    • Output: array of semester ids
    • Note: an active program coordinator is associated with all semesters for which observations exists
  • getPhoto
    • Retrieve the URL of the photo associated with a given ObsStudentID
    • Input: ObsStudentID
    • Output URL (empty if no photo exists)

 

 
Taxonomy: