mWater / mwater-visualization

GNU Lesser General Public License v3.0
3 stars 5 forks source link

Matrix question export IDs not appearing in exports #446

Closed Autio closed 4 years ago

Autio commented 4 years ago

When trying to export the export IDs of matrix questions from surveys the column headers are exported instead. May have been the case since these were first implemented?

See for example here: https://portal.mwater.co/#/forms/2d05e0fb76df4122b0d67c0ceb2f68e7/responses

Autio commented 4 years ago

Relatively high priority, seems to be affecting all matrix questions

broncha commented 4 years ago

According to this line here https://github.com/mWater/mwater-forms/blob/b529353631745ba13888a9e982b3f8d1b0de3871/src/FormSchemaBuilder.coffee#L1399

For the export ID to appear in the export, the matrix question has to have a code/exportID, each item has to have code/exportID and the individual columns

cellCode = if code and itemItem.code and itemColumn.code then code + " - " + itemItem.code + " - " + itemColumn.code

code -> question code/ExportID itemItem.code -> matrix item code/exportID itemColumn.code -> matrix column code/exportID

But it does look like, the export ID from item and columns are not taken into account (just the code is checked) Ill fix that.

The condition may be by design, so I am not changing the condition, I am just adding export Id check as well

Autio commented 4 years ago

I see. So at the moment if all of the columns have a code as well as export ID it will export the ID? Yes please let's fix.

broncha commented 4 years ago

Not just the columns, the Question itself, the items and the columns Screen Shot 2020-07-29 at 10 44 01 PM

broncha commented 4 years ago

Fixed in https://github.com/mWater/mwater-forms/commit/23fcf758f5a9ead4c8c5b4fd0d87ba6a93a686ba

Autio commented 4 years ago

This seems to have come back as a problem. When I try to export the code for matrix questions I just get the question name instead.

broncha commented 4 years ago

forms version rolled back on server in recent update. All fixed now.