From 3c196dec4909e0107292a481fdbafdec450d3249 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Thu, 21 May 2026 15:29:33 -0700 Subject: [PATCH 01/10] Reformat lines 3 - 5 to fit style guide --- scripts/output.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 3de8f008..a72101b0 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -1,7 +1,8 @@ /* * Filename : output.js - * Functions : now, today, sanitizeString, getSubgoalInfo, getActionInfo, createCSV, - * downloadCSV, downloadURI, create_zip, parseSubgoalArray, createOldCSV + * Functions : now, today, sanitizeString, getSubgoalInfo, getActionInfo, + * createCSV, downloadCSV, downloadURI, create_zip, + * parseSubgoalArray, createOldCSV * Description : Generates the data that will be in the output.csv file */ From c8099914c4d7881a34410dd046f9016dde7607d8 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Thu, 21 May 2026 15:40:55 -0700 Subject: [PATCH 02/10] Reformat through line 98 to fit column limit style guide, getExportMetadata under discussion --- scripts/output.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index a72101b0..811de296 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -25,7 +25,8 @@ function getSessionStateForExport() { function getExportSubgoalList() { var sessionState = getSessionStateForExport(); - if (sessionState && Array.isArray(sessionState.subgoals) && sessionState.subgoals.length > 0) { + if (sessionState && Array.isArray(sessionState.subgoals) + && sessionState.subgoals.length > 0) { return sessionState.subgoals; } return getSubgoalArrayFromLocal() || []; @@ -33,7 +34,8 @@ function getExportSubgoalList() { function getExportDraftAction() { var sessionState = getSessionStateForExport(); - if (sessionState && sessionState.draftAction && sessionState.currentStep !== "finished") { + if (sessionState && sessionState.draftAction + && sessionState.currentStep !== "finished") { return sessionState.draftAction; } @@ -78,7 +80,8 @@ function getActionImageUrl(action) { function getExportActionName(action) { var actionName = action && action.name ? String(action.name) : ""; - if (actionName.length > 1 && actionName[0] === "\"" && actionName[actionName.length - 1] === "\"") { + if (actionName.length > 1 && actionName[0] === "\"" + && actionName[actionName.length - 1] === "\"") { return actionName.slice(1, -1); } From d911085b3e81011f6f1756e201da5c1fdd4e99b6 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Fri, 22 May 2026 20:49:45 -0700 Subject: [PATCH 03/10] Reformat through line 198 --- scripts/output.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 811de296..12505977 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -112,17 +112,21 @@ function appendFacetSection(entry, heading, facetValues) { function buildCustomFacetMetadataRows(metadata) { var rows = []; - rows.push(["Persona Pronoun", metadata.personaPronoun || "", "Persona Possessive", metadata.personaPossessive || ""]); + rows.push(["Persona Pronoun", metadata.personaPronoun || "", + "Persona Possessive", metadata.personaPossessive || ""]); if (metadata.personaDescription) { - rows.push(["Persona Description", sanitizeString(metadata.personaDescription)]); + rows.push(["Persona Description", + sanitizeString(metadata.personaDescription)]); } - if (metadata.personaType === DIY_PERSONA_TYPE && metadata.customFacets && metadata.customFacets.length > 0) { + if (metadata.personaType === DIY_PERSONA_TYPE && metadata.customFacets + && metadata.customFacets.length > 0) { rows.push(["Custom Facets"]); rows.push(["Facet Name", "Scale", "Description"]); metadata.customFacets.forEach(function (facet) { - rows.push([facet.name, facet.scale, sanitizeString(facet.description)]); + rows.push([facet.name, facet.scale, + sanitizeString(facet.description)]); }); } @@ -139,7 +143,8 @@ function formatExportCell(value) { function buildPrimaryExportMetadataRows(metadata, todayString, currentTime) { var rows = []; - var hasDiyFacets = metadata.personaType === DIY_PERSONA_TYPE && metadata.customFacets && metadata.customFacets.length > 0; + var hasDiyFacets = metadata.personaType === DIY_PERSONA_TYPE + && metadata.customFacets && metadata.customFacets.length > 0; rows.push(["Date:", todayString, "Time:", currentTime]); rows.push([]); From 780abdb61ee0e66e7c0a1241cf4c10db99c4a7b7 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Sun, 24 May 2026 13:43:54 -0700 Subject: [PATCH 04/10] Adjust reformat through line 98 for readability --- scripts/output.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 12505977..aa94b1ef 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -25,8 +25,8 @@ function getSessionStateForExport() { function getExportSubgoalList() { var sessionState = getSessionStateForExport(); - if (sessionState && Array.isArray(sessionState.subgoals) - && sessionState.subgoals.length > 0) { + if (sessionState && Array.isArray(sessionState.subgoals) && + sessionState.subgoals.length > 0) { return sessionState.subgoals; } return getSubgoalArrayFromLocal() || []; @@ -34,8 +34,8 @@ function getExportSubgoalList() { function getExportDraftAction() { var sessionState = getSessionStateForExport(); - if (sessionState && sessionState.draftAction - && sessionState.currentStep !== "finished") { + if (sessionState && + sessionState.draftAction && sessionState.currentStep !== "finished") { return sessionState.draftAction; } @@ -80,8 +80,8 @@ function getActionImageUrl(action) { function getExportActionName(action) { var actionName = action && action.name ? String(action.name) : ""; - if (actionName.length > 1 && actionName[0] === "\"" - && actionName[actionName.length - 1] === "\"") { + if (actionName.length > 1 && actionName[0] === "\"" && + actionName[actionName.length - 1] === "\"") { return actionName.slice(1, -1); } From 5a809489df5bce6112aecfe8694be14dd8ec376e Mon Sep 17 00:00:00 2001 From: Mina Go Date: Sun, 24 May 2026 13:50:26 -0700 Subject: [PATCH 05/10] Adjust reformat through line 198 --- scripts/output.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index aa94b1ef..646228ff 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -113,20 +113,21 @@ function buildCustomFacetMetadataRows(metadata) { var rows = []; rows.push(["Persona Pronoun", metadata.personaPronoun || "", - "Persona Possessive", metadata.personaPossessive || ""]); + "Persona Possessive", metadata.personaPossessive || ""]); if (metadata.personaDescription) { rows.push(["Persona Description", - sanitizeString(metadata.personaDescription)]); + sanitizeString(metadata.personaDescription)]); } - if (metadata.personaType === DIY_PERSONA_TYPE && metadata.customFacets - && metadata.customFacets.length > 0) { + if (metadata.personaType === DIY_PERSONA_TYPE && metadata.customFacets && + metadata.customFacets.length > 0) { rows.push(["Custom Facets"]); rows.push(["Facet Name", "Scale", "Description"]); metadata.customFacets.forEach(function (facet) { - rows.push([facet.name, facet.scale, - sanitizeString(facet.description)]); + rows.push( + [facet.name, facet.scale, sanitizeString(facet.description)] + ); }); } @@ -143,8 +144,8 @@ function formatExportCell(value) { function buildPrimaryExportMetadataRows(metadata, todayString, currentTime) { var rows = []; - var hasDiyFacets = metadata.personaType === DIY_PERSONA_TYPE - && metadata.customFacets && metadata.customFacets.length > 0; + var hasDiyFacets = metadata.personaType === DIY_PERSONA_TYPE && + metadata.customFacets && metadata.customFacets.length > 0; rows.push(["Date:", todayString, "Time:", currentTime]); rows.push([]); From 646f1749a08d4157c8614ad745ca9dff07736fe8 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Sun, 24 May 2026 13:58:17 -0700 Subject: [PATCH 06/10] Reformat through line 303 --- scripts/output.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 646228ff..02c052eb 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -203,7 +203,8 @@ function buildPrimaryExportMetadataRows(metadata, todayString, currentTime) { */ function now() { var date = new Date(); - return String(date.getHours()).padStart(2, '0') + ":" + String(date.getMinutes()).padStart(2, '0'); + return String(date.getHours()).padStart(2, '0') + + ":" + String(date.getMinutes()).padStart(2, '0'); } /* * Function: today @@ -233,8 +234,8 @@ function sanitizeString(unsafeWord){ /* * Function: getSubgoalInfo * Ret: string (ready for csv) - * Formats the subgoal information for the csv file. Also makes call to getActionInfo - * so that each subgoal includes the actions associate with it + * Formats the subgoal information for the csv file. Also makes call to + * getActionInfo so that each subgoal includes the actions associate with it */ function getSubgoalInfo(){ var subgoalList= getExportSubgoalList(); From 7cbb26db9e1344f234f8991ef235a12ccecf500e Mon Sep 17 00:00:00 2001 From: Mina Go Date: Sun, 24 May 2026 14:26:04 -0700 Subject: [PATCH 07/10] Reformat through line 395 --- scripts/output.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 02c052eb..94e7831b 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -249,7 +249,8 @@ function getSubgoalInfo(){ subgoalEntry.push("Subgoal " + (parseInt(j)+1)); subgoalEntry.push(sanitizeString(currSubgoal.name)); subgoalEntry.push("\n"); // new row - subgoalEntry.push("Will the persona have formed this subgoal as a step to their overall goal?"); + subgoalEntry.push("Will the persona have formed this subgoal as a "+ + "step to their overall goal?"); subgoalEntry.push("\n"); // new row // subgoalEntry.push(currSubgoal.ynm["yes"].localeCompare("TRUE")); if(currSubgoal.ynm["yes"] === true){ @@ -341,7 +342,8 @@ function getActionInfo(actionList, j){ actionEntry.push("Why?"); actionEntry.push(sanitizeString(actionList[i].preAction.why)); actionEntry.push("\n"); //new row - appendFacetSection(actionEntry, "PreAction Facets:", actionList[i].preAction.facetValues); + appendFacetSection(actionEntry, "PreAction Facets:", + actionList[i].preAction.facetValues); actionEntry.push("\n"); //new row actionEntry.push("\n"); //new row @@ -372,13 +374,16 @@ function getActionInfo(actionList, j){ actionEntry.push(sanitizeString(actionList[i].postAction.why)); actionEntry.push("\n"); //new actionEntry.push("\n"); //new row - appendFacetSection(actionEntry, "Post action facets:", actionList[i].postAction.facetValues); + appendFacetSection(actionEntry, "Post action facets:", + actionList[i].postAction.facetValues); actionEntry.push("\n"); actionEntry.push("\n"); actionEntry.push("Action Image Name:"); var exportActionName = getExportActionName(actionList[i]); - var exportActionImageName = "S"+(1 + parseInt(j))+"A"+(parseInt(actionList[i].id))+"_"+exportActionName; + var exportActionImageName = "S"+(1 + parseInt(j))+"A"+ + (parseInt(actionList[i].id))+"_"+ + exportActionName; actionEntry.push(exportActionImageName); actionEntry.push("\n"); From 0f5de2c0a04b82ae47da29967b6efea7c61d7cc1 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Tue, 26 May 2026 22:29:15 -0700 Subject: [PATCH 08/10] Finish initial reformat --- scripts/output.js | 54 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 94e7831b..246d3273 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -410,7 +410,10 @@ function createCSV() { var dd = String(today.getDate()).padStart(2, '0'); var mm = today.getMonth(); var yyyy = today.getFullYear(); - var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var months = [ + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + ]; var todayString = months[mm] + " " + dd + " " + yyyy; var DTTPS = [teamName, personaName, scenarioName]; resetExportArtifacts(); @@ -419,9 +422,9 @@ function createCSV() { globName += DTTPS[0]; globName += DTTPS[2]; globName += "GenderMagSession"; - buildPrimaryExportMetadataRows(metadata, todayString, now()).forEach(function (row) { - csvContent += row.join(",") + "\n"; - }); + buildPrimaryExportMetadataRows(metadata, todayString, now()).forEach( + function (row) { csvContent += row.join(",") + "\n"; } + ); var fullContent = getSubgoalInfo(); csvContent += fullContent; @@ -444,9 +447,11 @@ function downloadCSV(csvContent, old) { var hr = today.getHours(); var min = today.getMinutes(); if(old){ - zip.file("OldFormatGenderMagSession-on-" + mm + "-" + dd + "-" + yyyy + "-at-" + hr + "-" + min + ".csv", csvContent); + zip.file("OldFormatGenderMagSession-on-" + mm + "-" + dd + "-" + yyyy + + "-at-" + hr + "-" + min + ".csv", csvContent); } else { - zip.file("GenderMagSession-on-" + mm + "-" + dd + "-" + yyyy + "-at-" + hr + "-" + min + ".csv", csvContent); + zip.file("GenderMagSession-on-" + mm + "-" + dd + "-" + yyyy + "-at-" + + hr + "-" + min + ".csv", csvContent); } var img = zip.folder("images"); console.log(imgList + "HHH"); @@ -468,7 +473,8 @@ function downloadURI(uri, name) { //checks to see if the uri or name is null if (uri === null || name === null) throw "The uri or name for your image is null."; var safeName = name; - //uri must be converted to string in order to perform slice function to shorten the uri + //uri must be converted to string in order to perform slice function to + //shorten the uri toString(uri); var safeUri = uri.slice(22); console.log("in image", safeUri); @@ -533,7 +539,9 @@ function parseSubgoalArray(){ currI.facetValues["selfE"], currI.facetValues["risk"], currI.facetValues["tinker"], - sanitizeString(getFacetLabelsForExport(currI.facetValues).join("; ")), + sanitizeString( + getFacetLabelsForExport(currI.facetValues).join("; ") + ), ]; for(var i in currI.actions){ //get new line and to the right part of csv @@ -548,10 +556,13 @@ function parseSubgoalArray(){ entry.push(currI.actions[i].preAction.ynm["maybe"]); entry.push(currI.actions[i].preAction.facetValues["motiv"]); entry.push(currI.actions[i].preAction.facetValues["info"]); - entry.push(currI.actions[i].preAction.facetValues["self"] || currI.actions[i].preAction.facetValues["selfE"]); + entry.push(currI.actions[i].preAction.facetValues["self"] || + currI.actions[i].preAction.facetValues["selfE"]); entry.push(currI.actions[i].preAction.facetValues["risk"]); entry.push(currI.actions[i].preAction.facetValues["tinker"]); - entry.push(sanitizeString(getFacetLabelsForExport(currI.actions[i].preAction.facetValues).join("; "))); + entry.push(sanitizeString( + getFacetLabelsForExport(currI.actions[i].preAction.facetValues).join("; ") + )); //post action question entry.push(sanitizeString(currI.actions[i].postAction.why)); @@ -560,16 +571,21 @@ function parseSubgoalArray(){ entry.push(currI.actions[i].postAction.ynm["maybe"]); entry.push(currI.actions[i].postAction.facetValues["motiv"]); entry.push(currI.actions[i].postAction.facetValues["info"]); - entry.push(currI.actions[i].postAction.facetValues["self"] || currI.actions[i].postAction.facetValues["selfE"]); + entry.push(currI.actions[i].postAction.facetValues["self"] || + currI.actions[i].postAction.facetValues["selfE"]); entry.push(currI.actions[i].postAction.facetValues["risk"]); entry.push(currI.actions[i].postAction.facetValues["tinker"]); entry.push(sanitizeString(getFacetLabelsForExport(currI.actions[i].postAction.facetValues).join("; "))); - //url currently is about 4X as long as longest cell allowed in excel, so instead just downloading image as part of zip + //url currently is about 4X as long as longest cell allowed in excel + //so instead just downloading image as part of zip //entry.push('\"' +currI.actions[i].imgURL+'\"'); var newName = getExportActionName(currI.actions[i]); - downloadURI(getActionImageUrl(currI.actions[i]), "S"+(1 + parseInt(j))+"A"+(parseInt(i))+"_"+newName); + downloadURI( + getActionImageUrl(currI.actions[i]), + "S"+(1 + parseInt(j))+"A"+(parseInt(i))+"_"+newName + ); } if (entry.length != 0) { @@ -603,7 +619,8 @@ function createOldCSV() { }); - var header2 = ["Subgoal", + var header2 = [ + "Subgoal", "Will the persona have formed this subgoal as a step to their overall goal?", "Yes", "No", "Maybe", "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", "Selected Facets", @@ -611,9 +628,14 @@ function createOldCSV() { "Will the persona know what to do at this step?", "Yes", "No", "Maybe", "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", "Selected Facets", - sanitizeString("If the persona does the right thing, will they know that they did the right thing and is making progress toward their goal?"), + sanitizeString( + "If the persona does the right thing, will they know that they" + + " did the right thing and is making progress toward their goal?" + ), "Yes", "No", "Maybe", - "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", "Selected Facets"]; + "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", + "Selected Facets" + ]; csvContent += header2.join(",") + "\n"; entries.forEach(function(entry, index){ From d1e1377d95972c333e49213c47f265779beb0bff Mon Sep 17 00:00:00 2001 From: Mina Go Date: Wed, 27 May 2026 21:32:38 -0700 Subject: [PATCH 09/10] Review reformatting --- scripts/output.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 246d3273..09f82176 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -34,8 +34,8 @@ function getExportSubgoalList() { function getExportDraftAction() { var sessionState = getSessionStateForExport(); - if (sessionState && - sessionState.draftAction && sessionState.currentStep !== "finished") { + if (sessionState && sessionState.draftAction && + sessionState.currentStep !== "finished") { return sessionState.draftAction; } @@ -125,9 +125,8 @@ function buildCustomFacetMetadataRows(metadata) { rows.push(["Custom Facets"]); rows.push(["Facet Name", "Scale", "Description"]); metadata.customFacets.forEach(function (facet) { - rows.push( - [facet.name, facet.scale, sanitizeString(facet.description)] - ); + rows.push([facet.name, facet.scale, + sanitizeString(facet.description)]); }); } @@ -410,10 +409,9 @@ function createCSV() { var dd = String(today.getDate()).padStart(2, '0'); var mm = today.getMonth(); var yyyy = today.getFullYear(); - var months = [ - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December" - ]; + var months = ["January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", + "December"]; var todayString = months[mm] + " " + dd + " " + yyyy; var DTTPS = [teamName, personaName, scenarioName]; resetExportArtifacts(); @@ -557,7 +555,7 @@ function parseSubgoalArray(){ entry.push(currI.actions[i].preAction.facetValues["motiv"]); entry.push(currI.actions[i].preAction.facetValues["info"]); entry.push(currI.actions[i].preAction.facetValues["self"] || - currI.actions[i].preAction.facetValues["selfE"]); + currI.actions[i].preAction.facetValues["selfE"]); entry.push(currI.actions[i].preAction.facetValues["risk"]); entry.push(currI.actions[i].preAction.facetValues["tinker"]); entry.push(sanitizeString( @@ -572,7 +570,7 @@ function parseSubgoalArray(){ entry.push(currI.actions[i].postAction.facetValues["motiv"]); entry.push(currI.actions[i].postAction.facetValues["info"]); entry.push(currI.actions[i].postAction.facetValues["self"] || - currI.actions[i].postAction.facetValues["selfE"]); + currI.actions[i].postAction.facetValues["selfE"]); entry.push(currI.actions[i].postAction.facetValues["risk"]); entry.push(currI.actions[i].postAction.facetValues["tinker"]); entry.push(sanitizeString(getFacetLabelsForExport(currI.actions[i].postAction.facetValues).join("; "))); @@ -582,10 +580,8 @@ function parseSubgoalArray(){ //entry.push('\"' +currI.actions[i].imgURL+'\"'); var newName = getExportActionName(currI.actions[i]); - downloadURI( - getActionImageUrl(currI.actions[i]), - "S"+(1 + parseInt(j))+"A"+(parseInt(i))+"_"+newName - ); + downloadURI(getActionImageUrl(currI.actions[i]), + "S"+(1 + parseInt(j))+"A"+(parseInt(i))+"_"+newName); } if (entry.length != 0) { From 4500973d45ef595fa62f802f7fe675af76318795 Mon Sep 17 00:00:00 2001 From: Mina Go Date: Fri, 29 May 2026 10:09:53 -0700 Subject: [PATCH 10/10] Undo str wrapping --- scripts/output.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/output.js b/scripts/output.js index 09f82176..1e90b9f3 100644 --- a/scripts/output.js +++ b/scripts/output.js @@ -248,8 +248,7 @@ function getSubgoalInfo(){ subgoalEntry.push("Subgoal " + (parseInt(j)+1)); subgoalEntry.push(sanitizeString(currSubgoal.name)); subgoalEntry.push("\n"); // new row - subgoalEntry.push("Will the persona have formed this subgoal as a "+ - "step to their overall goal?"); + subgoalEntry.push("Will the persona have formed this subgoal as a step to their overall goal?"); subgoalEntry.push("\n"); // new row // subgoalEntry.push(currSubgoal.ynm["yes"].localeCompare("TRUE")); if(currSubgoal.ynm["yes"] === true){ @@ -347,9 +346,7 @@ function getActionInfo(actionList, j){ actionEntry.push("\n"); //new row actionEntry.push("\n"); //new row //post action question - actionEntry.push(sanitizeString("If the persona does the right thing, will" + - " they know that they did the right thing and is making " + - "progress toward their goal?")); + actionEntry.push(sanitizeString("If the persona does the right thing, will they know that they did the right thing and is making progress toward their goal?")); actionEntry.push("\n"); //new row if(actionList[i].postAction.ynm["yes"] === true){ actionEntry.push("Yes"); @@ -624,10 +621,7 @@ function createOldCSV() { "Will the persona know what to do at this step?", "Yes", "No", "Maybe", "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", "Selected Facets", - sanitizeString( - "If the persona does the right thing, will they know that they" + - " did the right thing and is making progress toward their goal?" - ), + sanitizeString("If the persona does the right thing, will they know that they did the right thing and is making progress toward their goal?"), "Yes", "No", "Maybe", "Motivation", "Info Processing", "Self-Efficacy", "Risk", "Tinker", "Selected Facets"