© 2018 Capita Business Services Ltd. All rights reserved.

Capita Education Software Solutions is a trading name of Capita Business Services Ltd. Our Registered office is 30 Berners Street, London, W1T 3LR and our registered number is 02299747. Further information about Capita plc can be found in our legal statement.

SIMS 7 - Lesson Attendance Concepts

Lesson Attendance Concepts

A typical partner system offers some form of location recording. In essence their system will have allowed some form of setup that identifies where an access point is; it knows the time and the access point activation by card, biometric or other mechanism in effect identifies the student at the location.

Whilst partner systems work in many different ways, if we can provide a training session that shows how to convert:

A room ID

A student ID

A date / time for the student triggering the system in that room

Then this is probably sufficient for most partners to adapt to their way of working.

In order to simplify the information here, we will assume that the partner system has exported via command reporter the set of room names and their ids and used this to configure their access points and hence identify where they are.

We will further assume that a second export has been achieved, again command reporter which is the list of student ids, surname, forename, admission number, house, year group and registration group. This will have been used to map the identity token to a student id by the partner system.

Like the Cluedo® game we now know that C S Tudent is in the Library at 09:40:12 on 3rd September 2011. The sample aims to work back from this information to recording a mark in SIMS for the student’s lesson attendance; identifying pitfalls on the way…

The key function call that identifies what C S Tudent is up to is

TPTimetable tpt = new TPTimetable();
string tt = tpt.GetXmlStudentTimetable(StudentID, DateTime.Now, DateTime.Now);

Simply replace the DateTime.Now with the time of the Swipe and this will return the student’s timetable at the time of the swipe. For example:

<Timetable>
  <StudentID>5253</StudentID>
  <EmployeeID>82</EmployeeID>
  <EventInstanceID>25292</EventInstanceID>
  <EventID>202</EventID>
  <TimetableDate>2009-09-02T10:15:00</TimetableDate>
  <PeriodName>Wed:2</PeriodName>
  <PeriodNumber>12</PeriodNumber>
  <BaseGroupID>5390</BaseGroupID>
  <LocationID>4</LocationID>
  <SubjectID>521</SubjectID>
</Timetable>

Any full implementation will need to consider the possibility that the swipe occurs during break time (5 seconds early say) and the above call would return no results.  However, if the call is made for:

string testdata = timetable.GetXmlStudentTimetable (StudentID, DateTime.Parse("01/09/2009T00:00:01"), DateTime.Parse("01/09/2009T23:59:59"));

… would return all the timetabled lessons for that student on the day.  It is up to the partner system how they choose to deal with this.

Writing the data back:

string xmlstring = @"<LessonAttendances>
  <LessonAttendance>
    <PersonID>4582</PersonID>
    <EventInstanceID>25719</EventInstanceID>
    <AttendanceMark>M</AttendanceMark>
    <Comments></Comments>
    <MinsLate></MinsLate>
    <BaseGroupID>5390</BaseGroupID>
    <EmployeeID>82</EmployeeID>
    <LocationID>4</LocationID>
  </LessonAttendance>
</LessonAttendances>"; 
TPAttendanceWrite attWrite = new TPAttendanceWrite(); 
bool done = attWrite.WriteLessonAttendances(xmlstring);

The XML string passed for writing the lesson marks should pass the personID, EventInstanceId of the lesson and the mark that needs to be written. Exact mark will be written in SIMS database that has been supplied in the XML passed to this method.

From Autumn 2011 release of SIMS, the interaface can be used to write MinsLate and Comments back with lesson marks. The writing of Comments and MinsLate will be optional.

In the summer 2012 release of SIMS we will add the option of including the room id and base group id.  The interface prior to that release supports only period attendance.  Whilst this is the same outcome for students who have single classes per period, where a student is timetabled for multiple classes in a period, has a class with multiple teachers or a class timetabled for multiple rooms then every combination would have received the same mark. There are circumstances where this would technically record the wrong information, for example if C S Tudent has a music lesson that replaces his maths lesson every few weeks then he should be marked present at music and absent for maths where applicable. The Third Party APIs do not deal with that circumstance prior to the change described here.

By passing the base group id and the room id, the function call can update the desired lessons independently.  It does however mean that partners passing the additional XML data will need to decide what to do with say multiple teachers or rooms and submit appropriate updates from the partner’s code.

For example if a student was taught by 2 teachers in the same room, 2 entries would occur in their time table. A location system would have no idea of which teacher was taking the session and so it may be appropriate to mark them present for both lessons.

Example 2: If a student had 2 timetabled lessons in 2 locations, a mark for one would typically have no effect on the other.

Please note that any mark providing one or other of room ID / base group ID but not both will be rejected and flagged as an error.