emis_developer_manual
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| emis_developer_manual [2023/02/20 21:49] – [Download and Install the Main Development Tools] ghachey | emis_developer_manual [2026/01/02 20:47] (current) – ghachey | ||
|---|---|---|---|
| Line 63: | Line 63: | ||
| There is no need for an expensive license, the Express edition which is freely available will work fine for most small countries. If you don't have already a commercial license download the free version [[https:// | There is no need for an expensive license, the Express edition which is freely available will work fine for most small countries. If you don't have already a commercial license download the free version [[https:// | ||
| + | |||
| + | The following databases distributed with the source code in the folder databases: | ||
| + | |||
| + | * **IdentifiesP.bak**: | ||
| + | * **pacificemisdb.bak**: | ||
| + | * **pacificemisdb-withsamplelookups.bak**: | ||
| + | |||
| + | <note important> | ||
| + | |||
| + | Restoring a database from a backup is documented [[https:// | ||
| ==== Programming Language ==== | ==== Programming Language ==== | ||
| Line 97: | Line 107: | ||
| - Download and install [[https:// | - Download and install [[https:// | ||
| - | - Download and install | + | - Download and install [[https:// |
| - | - Download and install [[https:// | + | - Download and install [[https:// |
| - Download and install latest [[https:// | - Download and install latest [[https:// | ||
| - | - Download and install most recent version 16 LTS [[https:// | + | - Download and install most recent version 16 LTS [[https:// |
| - Install Bower from the command line you can simply ''> | - Install Bower from the command line you can simply ''> | ||
| - Install Grunt from the command line you can simply ''> | - Install Grunt from the command line you can simply ''> | ||
| - Download and install [[https:// | - Download and install [[https:// | ||
| + | <note important> | ||
| ==== Software Configuration Management ==== | ==== Software Configuration Management ==== | ||
| Line 146: | Line 156: | ||
| <note important> | <note important> | ||
| - | Then install a location | + | Then a local version of grunt seems to be needed to silence an error in Visual Studio later. Again, from the command line go into the ``pineapples`` root folder (not ``Pineapples.Client``) and issue the following command. |
| + | |||
| + | < | ||
| + | > npm install grunt | ||
| + | </ | ||
| + | |||
| + | Then install a locale | ||
| < | < | ||
| Line 161: | Line 177: | ||
| {{ : | {{ : | ||
| - | You can then verify if VS is actually using the node and npm binaries you think they were by opening **Tools - NuGet Package Manager - Package Manager Console** and typing the following commands and observing the output. | + | You can then verify if VS is actually using the node and npm binaries you think they were by opening **Tools - NuGet Package Manager - Package Manager Console** and typing the following commands and observing the output. The version should be the one you installed manually above (and not the one in the screenshot). |
| {{ : | {{ : | ||
| Line 167: | Line 183: | ||
| </ | </ | ||
| - | Try to build the solution. At first, | + | As a one time thing, you need to set/verify the starting project of the solution. |
| + | |||
| + | At this point if you followed closely the previous sections you should already be able to right click on the **Solution ' | ||
| + | |||
| + | You should then try running | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | If you do not yet see the Task Runner Explorer window | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | ==== Application Configuration ==== | ||
| + | |||
| + | The main configuration for the application is the file '' | ||
| + | |||
| + | You will need to setup two databases: the Identity database (i.e. IdentitiesP) and the application' | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | <code xml> | ||
| + | <add name=" | ||
| + | </ | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | ... | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | There are other appSettings less critical but important for some functionalities. | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | ... | ||
| + | <!-- The report server configuration for the reporting functionality --> | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | ... | ||
| + | <!-- The location where files are stored on the computer used by a number of features in the system --> | ||
| + | <add key=" | ||
| + | ... | ||
| + | <!-- Emailing functionality cnofiguration --> | ||
| + | <add key=" | ||
| + | <add key=" | ||
| + | <!-- use the your own email if you want to test receiving systems emails (e.g. errors notifications) --> | ||
| + | <add key=" | ||
| + | <!-- use the bc for testing, so that a copy of all outbound emails is sent to this address --> | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | And finally, for email notifications to work it must be configured to use a email server. Various approaches can be used, perhaps the easiest is to use a Gmail account with an application password. | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | < | ||
| + | <!-- settings for email delivery using smtp client | ||
| + | will vary according to the sender - refer to sysadmin docs at | ||
| + | http:// | ||
| + | <!-- Using a Google account is an easy and reliable way. | ||
| + | this may require that you " | ||
| + | be enabled for the Gmail account used by the NetworkCredential | ||
| + | see https:// | ||
| + | <smtp deliveryMethod=" | ||
| + | <network host=" | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | ==== Running the Solution ==== | ||
| + | |||
| + | At this point you should be ready to run the system by clicking on the following. Note that below was first set to Google Chrome but it could be started within any browser. | ||
| + | |||
| + | {{ : | ||
| - | TODO | ||
| ==== [Optional] Various Visual Studio Configuration ==== | ==== [Optional] Various Visual Studio Configuration ==== | ||
| Line 212: | Line 312: | ||
| * **Tabify Selected Lines** - converts leading spaces to tabs. Respects the tab size setting in **Tools - Options** when making this conversion. It is recommended to run this on files before submitting a commit. | * **Tabify Selected Lines** - converts leading spaces to tabs. Respects the tab size setting in **Tools - Options** when making this conversion. It is recommended to run this on files before submitting a commit. | ||
| * **View White Space** - toggle display spaces and tabs (CTRL-E,S) | * **View White Space** - toggle display spaces and tabs (CTRL-E,S) | ||
| - | |||
| - | |||
| - | ==== Databases Setup ==== | ||
| - | |||
| - | You will need to setup two databases: the application' | ||
| - | |||
| - | Restoring a database from a backup is documented [[https:// | ||
| - | |||
| - | In VS, open the file '' | ||
| - | |||
| - | <code xml> | ||
| - | <add name=" | ||
| - | </ | ||
| - | |||
| - | And replace '' | ||
| - | |||
| - | <code xml> | ||
| - | < | ||
| - | <add key=" | ||
| - | <add key=" | ||
| - | <add key=" | ||
| - | <add key=" | ||
| - | <add key=" | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | And replace '' | ||
| - | |||
| - | ==== Building the Solution ==== | ||
| - | |||
| - | First, as a one time thing, you need to set the starting project of the solution. Right click on the **Pineapples** project in the **Solution Explorer** and click on **Set as StartUp project**. The Pineapples project should from now on become bold. | ||
| - | |||
| - | At this point if you followed closely the previous sections you should already be able to right click on the **Solution ' | ||
| - | |||
| - | You should then try running the grunt task _build_deploy as shown below. Run it a couple of times for good measure. | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | At this point you should be ready to run the system by clicking on the following. Note that below was first set to Google Chrome but it could be started within any browser. | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | |||
| ==== Troubleshooting Visual Studio Build/Run Errors ==== | ==== Troubleshooting Visual Studio Build/Run Errors ==== | ||
| Line 1035: | Line 1092: | ||
| <note important> | <note important> | ||
| + | |||
| ===== Low Level Documentation and API ===== | ===== Low Level Documentation and API ===== | ||
| Line 1045: | Line 1103: | ||
| * The AtAGlance pages are built from a static XML file containing a table of aggregated values. Particular values are dug out of this XML using Jquery as a kind of client-side " | * The AtAGlance pages are built from a static XML file containing a table of aggregated values. Particular values are dug out of this XML using Jquery as a kind of client-side " | ||
| - | ==== Public REST API ==== | + | ==== Notes Teacher Data Processing |
| + | |||
| + | === Collection === | ||
| + | |||
| + | * Census workbook (Excel XLSX) | ||
| + | * PDF survey | ||
| + | |||
| + | In both cases the data are reduced to XML; however the formats are different. | ||
| + | |||
| + | === Upload === | ||
| + | |||
| + | The Excel and PDF documents are uploaded and processed to extract the XML contents, which are uploaded into the EMIS database. | ||
| + | |||
| + | === Main tables === | ||
| + | |||
| + | * | ||
| + | * | ||
| + | * Also use pTeacherRead.TeacherSurveyV which provides denormalised values (school, surveyYear). | ||
| + | |||
| + | === Accessing TeacherSurvey XML === | ||
| + | |||
| + | The functions pTeacherRead.Activities and pTeacherRead.TeacherQualCert shred the source XML on TeacherSurvey into relational records. | ||
| + | |||
| + | === Main functions === | ||
| + | |||
| + | * Handles both formats (PDF/XLSX) of source XML to produce a common rowset — consumers downstream of these functions deal with a consistent data format regardless of collection source. | ||
| + | * Shows the array of Activities — all classes taught, A = Admin and X = Other. | ||
| + | * Calculates the " | ||
| + | * From AllocatedClassLevel, | ||
| + | * Uses AllocatedSector and qualification history to determine Qualified and Certified status for each year. | ||
| + | |||
| + | pTeacherRead.TeacherQualCert has three principal uses: | ||
| + | |||
| + | * Provides detailed teacher data to the School page (available without a warehouse rebuild). | ||
| + | * Provides the History tab on the Teacher page (no warehouse rebuild required). | ||
| + | * Used by the warehouse rebuild; Qualified and Certified status are consolidated in one place. | ||
| + | |||
| + | === Warehouse Teacher Info === | ||
| + | |||
| + | The fundamental warehouse table for teacher data is warehouse.TeacherLocation. This performs several functions: | ||
| + | |||
| + | * For legacy reasons, can incorporate teacher locations sourced from Appointments. | ||
| + | * Collects all survey data, Qual/Cert status and allocated Level, Sector and EdLevel from | ||
| + | |||
| + | pTeacherRead.TeacherQualCert: | ||
| + | |||
| + | * Supplies Estimate records for missing surveys. | ||
| + | * Includes teaching staff and non‑teaching staff (A, X). | ||
| + | |||
| + | === Common filters on TeacherLocation === | ||
| + | |||
| + | TAMX in (' | ||
| + | Source not in (' | ||
| + | |||
| + | Use the Source filter to get all survey teacher info, including Estimates and Admin/Other staff. | ||
| + | |||
| + | Grouping by AllocatedEdLevel, | ||
| + | |||
| + | Note: Aggregates on warehouse.TeacherLocation vs pTeacherRead.TeacherQualCert differ because TeacherLocation provides the Estimate records. These queries return the same record count: | ||
| + | |||
| + | <code sql> | ||
| + | Select * from pTeacherRead.TeacherQualCert(null, | ||
| + | Select * from warehouse.TeacherLocation WHERE Source not in (' | ||
| + | </ | ||
| + | |||
| + | All teacher reporting from the warehouse should ultimately draw from warehouse.TeacherLocation so that interpretations of Allocated and Qualified/ | ||
| + | |||
| + | === Examples === | ||
| + | |||
| + | <code sql> | ||
| + | Select * from warehouse.TeacherLocation WHERE Source not in (' | ||
| + | Select * from warehouse.TeacherLocation WHERE TAMX in (' | ||
| + | Select * from warehouse.TeacherLocation WHERE TAMX = ' | ||
| + | Select * from warehouse.TeacherLocation WHERE A = 1 — staff doing some admin duties, not necessarily exclusively (i.e., may be teaching as well). | ||
| + | </ | ||
| + | |||
| + | There is one record per teacher per year in TeacherLocation (i.e., tID/ | ||
| + | |||
| + | warehouse.TeacherLocation includes Gender and Age Group; for other demographics, | ||
| + | |||
| + | === Weightings === | ||
| + | |||
| + | A major group of tables derived from warehouse.TeacherLocation are: | ||
| + | |||
| + | * warehouse.TeacherActivityWeights | ||
| + | * warehouse.TeacherActivityWeightsEdLevel | ||
| + | * warehouse.TeacherActivityWeightsSector | ||
| + | * warehouse.TeacherActivityWeightsClassLevel | ||
| + | |||
| + | To handle the fact that a teacher may perform multiple activities, weightings are applied to teacher activities in the aggregation category to avoid double‑counting when aggregating. | ||
| + | |||
| + | Example (UIS A9 sheet): we record the number of teachers teaching in ISCED 1 and the number teaching in ISCED 2, then add totals across the page. If a teacher teaches one class at ISCED 1 and another at ISCED 2, counting them as 1 in each would inflate the page total. | ||
| + | |||
| + | To overcome this, we weight a teacher' | ||
| + | |||
| + | === Terminology === | ||
| + | |||
| + | FTPT (Full Time / Part Time) weighting — teaching activities in some group (ISCED, EdLevel, Sector, Class Level) as a fraction of the total teaching activities of that teacher. | ||
| + | FTE (Full Time Equivalent) — teaching activities in some group as a fraction of the TOTAL activities of that teacher (including any A or X activity). | ||
| + | Example: | ||
| + | |||
| + | Teacher B teaches 1 class at ISCED 1 and is recorded as performing Admin tasks. FTPT for ISCED 1 = 1 (1/1 teaching activity). FTE = 0.5 (1 divided by 2 total activities). | ||
| + | Difference between FTPT and FTE depends on whether the teacher performs A or X activities. Aggregated, the difference indicates teacher time spent on admin tasks. | ||
| + | |||
| + | Filter by TAMX in (' | ||
| + | |||
| + | A third weighting mechanism is Allocation: allocate a teacher to a single AllocatedClassLevel, | ||
| + | |||
| + | Example: | ||
| + | |||
| + | Teacher C teaches 3 classes at ISCED 1 and 1 at ISCED 2. AllocatedISCED = ISCED 1 (most activity). FTPT for ISCED 1 = 0.75, for ISCED 2 = 0.25. Using Allocation: Allocated ISCED 1 = 1, Allocated ISCED 2 = 0. Page total remains 1. | ||
| + | TeacherActivityWeights entries for Teacher C: | ||
| + | |||
| + | ISCED 1A — W (FTE): 0.75, WTeach (FTPT): 0.75, Allocated: 1 | ||
| + | ISCED 2A — W: 0.25, WTeach: 0.25, Allocated: 0 | ||
| + | Summary: a teacher will have entries in this table (for a given year) for each ISCED Level in which they teach; exactly one of these records will have Allocated = 1. | ||
| + | |||
| + | === Head Count (unweighted totals) === | ||
| + | |||
| + | Head Count = number of teachers who do any activity in that group regardless of other activities. One teacher may be included in multiple categories; head counts cannot be summed without double counting. | ||
| + | To get Head Count by EdLevel: | ||
| + | |||
| + | <code sql> | ||
| + | select surveyYear, EdLevelCode, | ||
| + | from warehouse.TeacherActivityWeightsEdLevel | ||
| + | where TAMX in (' | ||
| + | group by surveyYear, EdLevelCode | ||
| + | </ | ||
| + | |||
| + | To get a Head Count grand total (without double-counting): | ||
| + | |||
| + | <code sql> | ||
| + | select surveyYear, count(DISTINCT tID) HeadCount | ||
| + | from warehouse.TeacherActivityWeightsEdLevel | ||
| + | where TAMX in (' | ||
| + | group by surveyYear | ||
| + | </ | ||
| + | |||
| + | === Handling Admin and Other (A / X) teachers === | ||
| + | |||
| + | A/X staff have no teaching class level activities; their allocated Class Level (and hence Allocated ISCED, ED Level, Sector) is derived entirely from the default level of the school type. | ||
| + | A/X activities are written to separate rows, identified by the flag AX: null for teaching activities, or ' | ||
| + | To split these off from teaching activities when aggregating: | ||
| + | |||
| + | <code sql> | ||
| + | select surveyYear, coalesce(AX, | ||
| + | from warehouse.TeacherActivityWeightsEdLevel | ||
| + | group by surveyYear, coalesce(AX, | ||
| + | </ | ||
| + | |||
| + | Contributions of staff with TAMX in (' | ||
| + | |||
| + | === VERMPAF === | ||
| + | |||
| + | Values from the Weights tables are incorporated into the VERMPAF Teachers node. These are filtered on TAMX in (' | ||
| - | Refer to [[emis_public_rest_api|EMIS Public REST API]] | ||
| ==== A Note on the use of Lodash' | ==== A Note on the use of Lodash' | ||
emis_developer_manual.1676929760.txt.gz · Last modified: 2023/02/20 21:49 by ghachey
