EASOL / easol

EASOL - A New Way to Open Learning with Ed-Tech
http://easol.org
GNU Affero General Public License v3.0
1 stars 4 forks source link

Analyze why Attedance data is not shown on dev-staging environment #297

Open edgarf opened 8 years ago

edgarf commented 8 years ago

Analyze which data is missing (or invalid).

edgarf commented 8 years ago

@regiscamimura - could you please check why there is not data shown on "Attendance" section of the EASOL Dashboard?

regiscamimura commented 8 years ago

@edgarf I looked into that, and it's empty because that's how data is set in the database. I mean, it's not an error. Here what I found:

  1. The table for StudentSchoolAttendanceEvent only has records for SchoolID = 3, Sample School 2. So if you don't select this school, you'll get no records.
  2. There is a inner join to make sure the students are related to the selected school:
INNER JOIN edfi.StudentSchoolAssociation 
    ON StudentSchoolAssociation.StudentUSI = StudentSchoolAttendanceEvent.StudentUSI 
    AND StudentSchoolAssociation.SchoolId = StudentSchoolAttendanceEvent.SchoolId 
    AND StudentSchoolAssociation.SchoolYear = StudentSchoolAttendanceEvent.SchoolYear

Note that besides the needed relationship between the attendance event -> Student -> StudentSchoolAssociation, the school year must also match the record. It seems like the fact a student was related to a school in 2014 doesn't means it is still related in 2015... which makes sense, but it does not makes sense that this student has an attendance event for 2015 in a given school, but he is not related to that school in 2015. Not sure why the data is set up like that. Any ideas?

Anyway, if you look at the table for StudentSchoolAssociation, you'll see that we do have a lot of records relating Students to SchoolID = 3, but SchoolYear is NULL for all of them. If you run this query:

UPDATE [edfi].[StudentSchoolAssociation] SET SchoolYear = 2015 WHERE SchoolId = 3 AND SchoolYear IS NULL;

You should see records in the attendance section.

Well, what we have is missing or missmatching data, or should we change something in the code logic?

edgarf commented 8 years ago

@regiscamimura thank you for the research! We will check it with other team members to see what shall we do here.