PacificEMIS / pacific-emis-education-survey-tool

Pacific EMIS Education Survey Tool is the android app used for survey data collection integrated with the Pacific EMIS
GNU General Public License v3.0
1 stars 4 forks source link

Get list of schools from EMIS API #13

Closed ghachey closed 2 years ago

ghachey commented 3 years ago

In anticipation of a school list that will need to change over time we need a better way to get the list of schools. The app shall add the ability to get/update the list of updated schools from the EMIS API with the configured context (e.g. FEDEMIS, MIEMIS, etc.). We keep the ability to load the list of schools has it currently does by loading the CSV file. But we add the ability to update it by getting list from the EMIS API.

The below highlighted in yellow remains untouched and continues to work as it does. Simply rename from Import schools to "Import schools from CSV". And below "Import schools from CSV" you add a new button "Update schools from $EMIS API" where $EMIS displayed is actually the context (settings just above).

load-schools

This new "Update schools from $EMIS API" button simply triggers a REST API call to /api/schools (exact API URL will be provided soon). The data returned should be a JSON like this.

[
{"schNo ": "AIL100 ", "schName":"Aerok Elementary School"},
{"schNo ": "ALU101 ", "schName":"Ailuk Elementary School"},
...
]

The data returned from the "Update schools from $EMIS API" call shall always completely replace the hard coded "Import schools from CSV" list of schools.

When setting up a new tablet and selecting the context the settings are fetched from Firebug. At that point the "Update schools from $EMIS API" should be executed in the background. If it works, then it replaces the schools. Otherwise it defaults to the CSV list.

An admin user should always be able to go in the settings and also force the "Update schools from $EMIS API".

ghachey commented 2 years ago

Feedback:

1) Works for MIEMIS (RMI) but not for FedEMIS (FSM)

ghachey commented 2 years ago

This problem still exists as of version 01.10.21

ghachey commented 2 years ago

This problem still exists as of version 02.11.21

marinaomega commented 2 years ago

Same thing as issue 15 : At the moment we are working on the fix. The issue is reproduced when user updates the version from an old one (released in June or before) to the newest. It can be solved for now by updating either RemoteSettings (Force fetch remote settings button) or context. Issue is not reproduced if it's the first app launch.

ghachey commented 2 years ago

Refer to my comment in https://github.com/ghachey/pacific-emis-education-survey-tool/issues/15#issuecomment-966782435

ghachey commented 2 years ago

This can be considered fixed.