xlsform2lstsv 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,6 +78,7 @@ const tsv = await XLSFormParser.convertXLSFileToTSV('survey.xlsx', {
78
78
  | `convertEndNote` | `boolean` | `true` | Promote a `note` named `end` to LimeSurvey's survey end text. |
79
79
  | `convertOtherPattern` | `boolean` | `true` | Auto-detect the `_other` question pattern and set `other=Y`. |
80
80
  | `convertMarkdown` | `boolean` | `true` | Parse labels/hints as Markdown and convert to HTML. |
81
+ | `hideNoAnswer` | `boolean` | `true` | Hide the "no answer" option on non-mandatory questions. |
81
82
 
82
83
  ## Implemented features
83
84
 
@@ -8,6 +8,7 @@ export const defaultConfig = {
8
8
  convertEndNote: true,
9
9
  convertOtherPattern: true,
10
10
  convertMarkdown: true,
11
+ hideNoAnswer: true,
11
12
  defaults: {
12
13
  language: 'en',
13
14
  groupName: 'Questions',
@@ -507,6 +507,12 @@ export class XLSFormToTSVConverter {
507
507
  this.tsvGenerator.addRow(this.row({
508
508
  class: 'S', name: 'format', text: surveyFormat,
509
509
  }));
510
+ // Hide "no answer" option on non-mandatory questions
511
+ if (this.configManager.getConfig().hideNoAnswer !== false) {
512
+ this.tsvGenerator.addRow(this.row({
513
+ class: 'S', name: 'shownoanswer', text: 'N',
514
+ }));
515
+ }
510
516
  // SL rows: survey title + welcome/end text, base language first then others
511
517
  const emitSLRows = (lang) => {
512
518
  this.tsvGenerator.addRow(this.row({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xlsform2lstsv",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Convert XLSForm surveys to LimeSurvey TSV format",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",