akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

Graphical survey summary report gives a decimal in the summary sheet #1580

Closed Geerts closed 8 years ago

Geerts commented 8 years ago

Example in http://sig.akvoflow.org/admin/ , ID 20500916

stellanl commented 8 years ago

The answer data contains numbers both with and without a decimal point for the same question, e.g. "1" and "1.0". On the raw data sheet all NUMBER answers gets forced into a number cell, which hides the difference. The summary code, otoh, treats all answers as strings, so "1" and "1.0" gets tallied separately. Simplest solution is to format all NUMBER answers into canonical form before summarising.

stellanl commented 8 years ago

Before, two cells were shown for the value 1: before and after: after

stellanl commented 8 years ago

Test plan

(you can skip steps 1-3 if the current results are still there):

  1. Assign form 42833002 of survey "akvoflowsandbox -> Stellans tests->Reporting test forms" to a device.
  2. Submit one instance where the answer to "How much" is "1"
  3. Submit one instance where the answer to "How much" is "1.0"
  4. Order a comprehensive report.
  5. Open the report in Excel/Libreoffice calc etc.
  6. On the summary sheet, all answers either "1" and "1.0" should not be reported separately, but only as "1"
rumca commented 8 years ago

@stellanl do you know if the commits for this issue are part of release/1.9.6 (it looks like they are)?

If they are, then something is going wrong with this fix. When I create a number question, submit some responses with and without .0 I see the below:

screen shot 2016-04-07 at 22 08 48

stellanl commented 8 years ago

Since that service runs in another place than the rest of FLOW, I guess we need to check that it was deployed

stellanl commented 8 years ago

Does not look like it was. Dated August 2015: stellan@test2:~$ ls /var/akvo/flowexporter/jars/ -al total 172648 drwxr-x--- 2 flowexporter root 4096 Aug 20 2015 . drwxr-xr-x 8 flowexporter flowexporter 4096 May 27 2015 .. lrwxrwxrwx 1 flowexporter flowexporter 58 Aug 20 2015 current.jar -> /var/akvo/flowexporter/jars/flowexporter-build292-test.j ar -rw-r--r-- 1 flowexporter flowexporter 88387528 Aug 20 2015 flowexporter-build291-test.jar -rw-r--r-- 1 flowexporter flowexporter 88387547 Aug 20 2015 flowexporter-build292-test.jar

rumca commented 8 years ago

redeployment has indeed fixed the "issue", test plan now passes as described :+1: