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

Add autocomplete for Teacher and Subject #15

Closed ghachey closed 2 years ago

ghachey commented 3 years ago

Currently the user can enter freely the Teacher name and Subject in the step below in the Schools accreditation survey. A predefined list shall be first extracted when the app is setup (same as loading Schools from API as described in https://github.com/ghachey/pacific-emis-education-survey-tool/issues/13). From this list the fields shall now be an autocomplete. After typing for example 3 characters a short list of choices matching the characters will be display to user for selection. Typing additional characters will shorten then list dynamically. If the Teacher is not in the list the field can accept the fully typed name also. This will improve data quality by linking with known data in the system.

When recording this in the XML of the survey currently is sets teacherName as shown below. This is good, but when retrieving from the EMIS we will also get the ability to put the teacher ID there. So this can only be added if users selected a teacher from list. But if so, add below teacherName tID=IDOFTEACHER.

The same shall be done for subjects (which can also have an ID called subjCode if selected from list).

autocomplete

And these UI widgets shall be available in any other surveys in the tablet. Currently there is only one other example in WASH.

autocomplete-2

The REST API call to get the data will be added here soon.

ghachey commented 3 years ago

Question from Omega-R:

  1. How to get subjects for FedEMIS? We are getting an empty list when requesting Core Data Collection, and the request /api/subjects returns an empty list too. A similar request to MIEMIS works fine http://pacifici-emis-address/api/subjects.

  2. A token is required for getting a list of Teachers from the EMIS API. We need a user login and password to generate a token. Which one should we use - user login and password or do we need one hardcoded into the app?

ghachey commented 3 years ago

To which I replied

To question 1.:

The subjects were not in the FedEMIS database but they were in the MIEMIS database. This is why you saw it in MIEMIS and not in FedEMIS. They are in both now. See below from FedEMIS.

subjects

To question 2.:

The user credentials should be configurable from the Firebase projects. For example, for FedEMIS you would publish the additional settings like below screenshot. You will need one for each context/ountry (e.g. MIEMIS Education Survey Tool will need the same for MIEMIS.)

For the time being, you can use the user you are using for the Pacific Open Education Data app (user details sent to your email). But these users will be refined and will change.

And we will do the same for the Pacific Open Education Data app (I added the comment in the related issue https://github.com/ghachey/pacific-open-education-data/issues/4).

ghachey commented 3 years ago

Feedback:

1) Works for MIEMIS (RMI) but not for FedEMIS (FSM). Message below is shown even with a good tested Internet connection on the tablet.

Screenshot_20211013-153311

ghachey commented 3 years ago

I still see the problem "No Internet connection. Make sure Wi-Fi or mobile data is turned on then try again" message. I have a good Internet connection and have tested access to the production FedEMIS and it is working. This is still as far as I can see in latest shared version 01.10.21 not working.

marinaomega commented 3 years ago

Good point. The text "No Internet connection. Make sure Wi-Fi or mobile data is turned on then try again" is currently displayed in 2 cases:

  1. No internet connection
  2. No data in the DB

We should leave "No Internet connection. Make sure Wi-Fi or mobile data is turned on then try again" for the internet issue only. And we suggest adding 3 detailed descriptions: "There is no data on subjects in the database" "There is no data on the names of teachers in the database" "There is no data on schools in the database"

ghachey commented 3 years ago

While your suggestions are better yes, I do not believe this is the case. Because I tried with force get schools, teachers and subjects and it returns that same error. The FedEMIS server is running and my Internet connection is strong. We have schools (its the most basic data and has been there for many years). We have teachers and we have subjects. I think you need to look into this a bit more deeply/

marinaomega commented 3 years ago

Sure, we'll double-check that!

ghachey commented 3 years ago

This problem still exists as of version 02.11.21

marinaomega commented 3 years ago

Yes, we are on it

marinaomega commented 3 years ago

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 3 years ago

I believe this is due to the device not recognizing the SSL certificate of the server. The SSL certificate is valid and recognized by all major browsers updated to the latest on Windows 10 and MacOS. It is not a problem on some of our device but older devices it is. Please refer to my email on this for my proposed solution in the interim.

ghachey commented 2 years ago

This can be considered fixed