Skip to content

Commit

Permalink
During story export, dealt more gracefully with situation in which mu…
Browse files Browse the repository at this point in the history
…lti-choice question (checkboxes) was changed to single-choice question (select) after data was collected. Ready for version 1.5.15.
  • Loading branch information
cfkurtz committed Mar 16, 2022
1 parent 1f7b8a5 commit b8dbc7e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ M When import story form, hundreds of triples can be generated which take minute

==== DONE

--- Release 1.5.15

Changed: Dealt more gracefully with situation in which multi-choice question (checkboxes) was changed to single-choice question (select) after data was collected. Was choking on wrong data type during story export.

--- Release 1.5.14

Fixed: Bug in printing story cards where story-form question-answers were not appearing.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "NarraFirma",
"description": "NarraFirma webapp for Participatory Narrative Inquiry (PNI)",
"version": "1.5.14",
"version": "1.5.15",
"keywords": [
"JavaScript",
"NarraFirma",
Expand Down
18 changes: 17 additions & 1 deletion webapp/source/csvImportExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,23 @@ export function exportStoryCollection() {
outputLine.push(value[option] ? option : "");
});
} else {
outputLine.push(value);
// deal with pathological case where object data exists for select question (it should not)
// this could happen if user changed checkboxes question to select question after adding data
// there should be only one true value in the dictionary, so find it, then output that key
if (question.displayType === "select" && typeof value === "object") {
const keys = Object.keys(value);
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
const thisKey = keys[keyIndex];
const thisValue = value[thisKey];
if (thisValue) {
outputLine.push(thisKey);
console.log("WARNING: Found multi-choice answer for single-choice question. Writing first answer marked true.", value, question);
break;
}
}
} else {
outputLine.push(value);
}
}
if (question.writeInTextBoxLabel) {
const writeInValue = story.fieldValueWriteIn(question.id);
Expand Down
2 changes: 1 addition & 1 deletion webapp/source/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import kludgeForUseStrict = require("./kludgeForUseStrict");

// Return current versions used by application
const versions = {
narrafirmaApplication: "1.5.14",
narrafirmaApplication: "1.5.15",

questionnaireContentType: "org.workingwithstories.NarraFirmaQuestionnaire",
questionnaireContentVersion: "0.2.0",
Expand Down
4 changes: 2 additions & 2 deletions wordpress-plugin/narrafirma/narrafirma.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://narrafirma.com
Description: Participatory Narrative Inquiry in a box. Gather stories and make sense of challenges and opportunities in your community or organization.
Author: Cynthia F. Kurtz and Paul D. Fernhout
Version: 1.5.14
Version: 1.5.15
Author URI: http://cfkurtz.com
License: GPLv2 or later
*/
Expand All @@ -29,7 +29,7 @@

defined( 'ABSPATH' ) or die( 'Plugin must be run from inside WordPress' );

$NARRAFIRMA_VERSION = '1.5.14';
$NARRAFIRMA_VERSION = '1.5.15';

$pointrelServerVersion = "pointrel20150417-0.0.4-wp";

Expand Down
9 changes: 8 additions & 1 deletion wordpress-plugin/narrafirma/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Requires at least: 4.3.1
Tested up to: 5.9.1
Stable tag: trunk
Version: 1.5.14
Version: 1.5.15
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -106,6 +106,10 @@ We strongly suggest that you set up any web site on which you intend to install

== Changelog ==

= 1.5.15 =

Changed: Dealt more gracefully with situation in which multi-choice question (checkboxes) was changed to single-choice question (select) after data was collected. Was choking on wrong data type during story export.

= 1.5.14 =

Fixed: Bug in printing story cards where story-form question-answers were not appearing.
Expand Down Expand Up @@ -575,6 +579,9 @@ change logs, see the [GitHub repository](https://github.com/pdfernhout/narrafirm

== Upgrade Notice ==

= 1.5.15 =
This minor upgrade deals more gracefully with a situation in which a multi-choice question (checkboxes) was changed to a single-choice question (select) after data was collected.

= 1.5.14 =
This minor upgrade fixes a bug in printing story cards where story-form question-answers were not appearing.

Expand Down

0 comments on commit b8dbc7e

Please sign in to comment.