@digabi/exam-engine-generator 23.1.2-alpha.0 → 23.1.4-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ export interface GenerateSubQuestionOptions {
26
26
  answers: GenerateAnswerOptions[];
27
27
  }
28
28
  export type GenerateQuestionOptions = GenerateParentQuestionOptions | GenerateSubQuestionOptions;
29
- export type GenerateAnswerOptions = GenerateTextAnswerOptions | GenerateScoredTextAnswerOptions | GenerateChoiceAnswerOptions | GenerateDropdownAnswerOptions;
29
+ export type GenerateAnswerOptions = GenerateTextAnswerOptions | GenerateScoredTextAnswerOptions | GenerateChoiceAnswerOptions | GenerateDropdownAnswerOptions | GenerateDNDAnswerOptions;
30
30
  interface TextAnswerBase {
31
31
  hint?: string;
32
32
  type?: 'rich-text' | 'single-line' | 'integer';
@@ -52,6 +52,10 @@ export interface GenerateChoiceAnswerOptions {
52
52
  name: 'choice-answer';
53
53
  options: GenerateChoiceAnswerOption[];
54
54
  }
55
+ export interface GenerateDNDAnswerOptions {
56
+ name: 'dnd-answer';
57
+ options: GenerateChoiceAnswerOption[];
58
+ }
55
59
  export interface GenerateDropdownAnswerOptions {
56
60
  name: 'dropdown-answer';
57
61
  options: GenerateChoiceAnswerOption[];
@@ -1 +1 @@
1
- {"version":3,"file":"generateExam.d.ts","sourceRoot":"","sources":["../src/generateExam.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAA;AAExC,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,kBAAkB,CAAA;CAC3D;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,WAAW,EAAE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AAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA6BjE"}
@@ -154,6 +154,10 @@ function addQuestion(parent, languages, options) {
154
154
  addChoiceAnswer(question, answer);
155
155
  break;
156
156
  }
157
+ case 'dnd-answer': {
158
+ addDNDAnswer(question, answer);
159
+ break;
160
+ }
157
161
  }
158
162
  }
159
163
  }
@@ -181,6 +185,20 @@ function addChoiceAnswer(question, options) {
181
185
  createElement(answer, optionType, text, { score });
182
186
  }
183
187
  }
188
+ function addDNDAnswer(question, options) {
189
+ const container = createElement(question, 'dnd-answer-container');
190
+ for (const { text, score } of options.options) {
191
+ const optionType = 'dnd-answer-option';
192
+ if (score === 0) {
193
+ createElement(container, optionType, text);
194
+ }
195
+ else {
196
+ const answer = createElement(container, options.name, '', { 'max-score': score });
197
+ createElement(answer, 'dnd-answer-title', `Title for ${text}`);
198
+ createElement(answer, optionType, text, { score });
199
+ }
200
+ }
201
+ }
184
202
  function createElement(parent, localName, content, attrs) {
185
203
  const element = parent.node(localName, content).namespace('e', 'http://ylioppilastutkinto.fi/exam.xsd');
186
204
  if (attrs) {
@@ -1 +1 @@
1
- {"version":3,"file":"generateExam.js","sourceRoot":"","sources":["../src/generateExam.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4IA,oCA6BC;AAzKD,kDAAmC;AAmFnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,SAAgB,YAAY,CAAC,OAA4B;;IACvD,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAA;IACjC,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EA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B,CAAC,CAAC;SAChE,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAEpF,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { GenerateAnswerOptions, GenerateChoiceAnswerOptions, GenerateDropdownAnswerOptions, GenerateQuestionOptions, GenerateScoredTextAnswerOptions, GenerateTextAnswerOptions } from './generateExam';
1
+ import { GenerateAnswerOptions, GenerateChoiceAnswerOptions, GenerateDNDAnswerOptions, GenerateDropdownAnswerOptions, GenerateQuestionOptions, GenerateScoredTextAnswerOptions, GenerateTextAnswerOptions } from './generateExam';
2
2
  /**
3
3
  * A shorthand version of the function for creating a question containing the specified answers.
4
4
  *
@@ -24,4 +24,5 @@ export declare function textAnswer(options?: Partial<GenerateTextAnswerOptions>)
24
24
  export declare function scoredTextAnswer(options?: Partial<GenerateScoredTextAnswerOptions>): GenerateScoredTextAnswerOptions;
25
25
  export declare function choiceAnswer(options?: Partial<GenerateChoiceAnswerOptions>): GenerateChoiceAnswerOptions;
26
26
  export declare function dropdownAnswer(options?: Partial<GenerateDropdownAnswerOptions>): GenerateDropdownAnswerOptions;
27
+ export declare function dndAnswer(options?: Partial<GenerateDNDAnswerOptions>): GenerateDNDAnswerOptions;
27
28
  //# sourceMappingURL=generateExamOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateExamOptions.d.ts","sourceRoot":"","sources":["../src/generateExamOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,gBAAgB,CAAA;AAEvB;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,qBAAqB,EAAE,GAAG,uBAAuB,CAAA;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BAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAAG,2BAA2B,CAmBxG;AAED,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG,6BAA6B,CAmB9G;AACD,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,wBAAwB,CAe/F"}
@@ -5,6 +5,7 @@ exports.textAnswer = textAnswer;
5
5
  exports.scoredTextAnswer = scoredTextAnswer;
6
6
  exports.choiceAnswer = choiceAnswer;
7
7
  exports.dropdownAnswer = dropdownAnswer;
8
+ exports.dndAnswer = dndAnswer;
8
9
  function question(args) {
9
10
  if (Array.isArray(args)) {
10
11
  if ('answers' in args[0] || 'questions' in args[0]) {
@@ -84,4 +85,20 @@ function dropdownAnswer(options) {
84
85
  ...options
85
86
  };
86
87
  }
88
+ function dndAnswer(options) {
89
+ return {
90
+ name: 'dnd-answer',
91
+ options: [
92
+ {
93
+ text: 'Answer 1',
94
+ score: 3
95
+ },
96
+ {
97
+ text: 'Wrong answer',
98
+ score: 0
99
+ }
100
+ ],
101
+ ...options
102
+ };
103
+ }
87
104
  //# sourceMappingURL=generateExamOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateExamOptions.js","sourceRoot":"","sources":["../src/generateExamOptions.ts"],"names":[],"mappings":";;AA8BA,4BAYC;AAED,gCAOC;AAED,4CAiBC;AAED,oCAmBC;AAED,wCAmBC;AAlFD,SAAgB,QAAQ,CACtB,IAAmF;IAEnF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,OAAO,EAAE,SAAS,EAAE,IAAiC,EAAE,CAAA;QACzD,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,OAAO,EAAE,IAA+B,EAAE,CAAA;QACrD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAgB,UAAU,CAAC,OAA4C;IACrE,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,WAAW;QACjB,GAAG,OAAO;KACX,CAAA;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,OAAkD;IACjF,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,OAAO;QACb,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD,+EAA+E;YAC/E;gBACE,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,CAAC;aACT;SACF;QACD,GAAG,OAAO;KACX,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,OAA8C;IACzE,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;SACF;QACD,GAAG,OAAO;KACX,CAAA;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,OAAgD;IAC7E,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;SACF;QACD,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"generateExamOptions.js","sourceRoot":"","sources":["../src/generate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,OAAO;KACX,CAAA;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,OAAgD;IAC7E,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,CAAC;aACT;SACF;QACD,GAAG,OAAO;KACX,CAAA;AACH,CAAC;AACD,SAAgB,SAAS,CAAC,OAA2C;IACnE,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,CAAC;aACT;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,CAAC;aACT;SACF;QACD,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digabi/exam-engine-generator",
3
- "version": "23.1.2-alpha.0",
3
+ "version": "23.1.4-alpha.0",
4
4
  "main": "dist/index.js",
5
5
  "author": "Matriculation Examination Board, Finland",
6
6
  "license": "EUPL-1.1",
@@ -8,9 +8,9 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@digabi/exam-engine-core": "23.1.2-alpha.0",
11
+ "@digabi/exam-engine-core": "23.1.4-alpha.0",
12
12
  "libxmljs2": "^0.35.0",
13
13
  "lodash": "^4.17.15"
14
14
  },
15
- "gitHead": "d7fc0de6912e79510f549f4391a29424ec337944"
15
+ "gitHead": "79f06fa1b98ba90969b246ddee0aa934fd69b9a0"
16
16
  }