@examind/block-sdk 0.1.4 → 0.1.5
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/dist/index.js +18 -18
- package/dist/index.mjs +18 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -93,12 +93,12 @@ var EssayQuestionNodeHandler = class extends NodeHandler {
|
|
|
93
93
|
|
|
94
94
|
// src/typeGuards/isSerializedFillInTheBlankQuestionNode.ts
|
|
95
95
|
function isSerializedFillInTheBlankQuestionNode(node) {
|
|
96
|
-
return node?.type === "fill-in-the-blank-question" && "id" in node && typeof node.id === "string" && "
|
|
96
|
+
return node?.type === "fill-in-the-blank-question" && "id" in node && typeof node.id === "string" && "pointsPerSpace" in node && typeof node.pointsPerSpace === "number" && "content" in node;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// src/typeGuards/isSerializedParagraphNode.ts
|
|
100
100
|
function isSerializedParagraphNode(node) {
|
|
101
|
-
return node?.type === "paragraph" && "
|
|
101
|
+
return node?.type === "paragraph" && "textFormat" in node && typeof node.textFormat === "number" && "textStyle" in node && typeof node.textStyle === "string";
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// src/exportToHtml/createHtmlFromNestedNodes.ts
|
|
@@ -136,7 +136,7 @@ var FillInTheBlankQuestionNodeHandler = class extends NodeHandler {
|
|
|
136
136
|
|
|
137
137
|
// src/typeGuards/isSerializedFillInTheBlankSpaceNode.ts
|
|
138
138
|
function isSerializedFillInTheBlankSpaceNode(node) {
|
|
139
|
-
return node?.type === "space" && "id" in node && typeof node.id === "string" && "
|
|
139
|
+
return node?.type === "space" && "id" in node && typeof node.id === "string" && "spaceName" in node && typeof node.spaceName === "string" && "matches" in node && typeof node.matches === "string" && "spaceType" in node;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// src/exportToHtml/FillInTheBlankSpaceNodeHandler.ts
|
|
@@ -177,7 +177,7 @@ var FillInTheBlankSpaceNodeHandler = class extends NodeHandler {
|
|
|
177
177
|
|
|
178
178
|
// src/typeGuards/isSerializedFinancialStatementQuestionNode.ts
|
|
179
179
|
function isSerializedFinancialStatementQuestionNode(node) {
|
|
180
|
-
return node?.type === "financial-statement-question" && "id" in node && typeof node.id === "string" && "header" in node && "
|
|
180
|
+
return node?.type === "financial-statement-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number" && "header" in node && "columnHeaders" in node && Array.isArray(node.columnHeaders) && "rows" in node && Array.isArray(node.rows) && "distractors" in node && Array.isArray(node.distractors);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
// src/exportToHtml/FinancialStatementQuestionNodeHandler.ts
|
|
@@ -243,7 +243,7 @@ var FinancialStatementQuestionNodeHandler = class extends NodeHandler {
|
|
|
243
243
|
|
|
244
244
|
// src/typeGuards/isSerializedHorizontalRuleNode.ts
|
|
245
245
|
var isSerializedHorizontalRuleNode = (node) => {
|
|
246
|
-
return node
|
|
246
|
+
return node?.type === "horizontalrule";
|
|
247
247
|
};
|
|
248
248
|
|
|
249
249
|
// src/exportToHtml/HorizontalRuleNodeHandler.ts
|
|
@@ -256,7 +256,7 @@ var HorizontalRuleNodeHandler = class extends NodeHandler {
|
|
|
256
256
|
|
|
257
257
|
// src/typeGuards/isSerializedImageNode.ts
|
|
258
258
|
var isSerializedImageNode = (node) => {
|
|
259
|
-
return node
|
|
259
|
+
return node?.type === "image" && "altText" in node && typeof node.altText === "string" && "caption" in node && "showCaption" in node && typeof node.showCaption === "boolean" && "src" in node && typeof node.src === "string" && "width" in node && typeof node.width === "string" && "align" in node && typeof node.align === "string" && "showBorder" in node && typeof node.showBorder === "boolean";
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
// src/exportToHtml/ImageNodeHandler.ts
|
|
@@ -275,7 +275,7 @@ var ImageNodeHandler = class extends NodeHandler {
|
|
|
275
275
|
|
|
276
276
|
// src/typeGuards/isSerializedJournalEntryQuestionNode.ts
|
|
277
277
|
function isSerializedJournalEntryQuestionNode(node) {
|
|
278
|
-
return node?.type === "journal-entry-question" && "id" in node && typeof node.id === "string" && "
|
|
278
|
+
return node?.type === "journal-entry-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number" && "journalType" in node && typeof node.journalType === "string" && "lineItems" in node && Array.isArray(node.lineItems);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// src/exportToHtml/JournalEntryQuestionNodeHandler.ts
|
|
@@ -357,7 +357,7 @@ var LineBreakNodeHandler = class extends NodeHandler {
|
|
|
357
357
|
|
|
358
358
|
// src/typeGuards/isSerializedLinkNode.ts
|
|
359
359
|
var isSerializedLinkNode = (node) => {
|
|
360
|
-
return node
|
|
360
|
+
return node?.type === "link" && "url" in node && typeof node.url === "string";
|
|
361
361
|
};
|
|
362
362
|
|
|
363
363
|
// src/exportToHtml/LinkNodeHandler.ts
|
|
@@ -374,7 +374,7 @@ var LinkNodeHandler = class extends NodeHandler {
|
|
|
374
374
|
|
|
375
375
|
// src/typeGuards/isSerializedListItemNode.ts
|
|
376
376
|
var isSerializedListItemNode = (node) => {
|
|
377
|
-
return node
|
|
377
|
+
return node?.type === "listitem" && "value" in node && typeof node.value === "number";
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
// src/exportToHtml/ListItemNodeHandler.ts
|
|
@@ -397,7 +397,7 @@ var ListItemNodeHandler = class extends NodeHandler {
|
|
|
397
397
|
|
|
398
398
|
// src/typeGuards/isSerializedListNode.ts
|
|
399
399
|
var isSerializedListNode = (node) => {
|
|
400
|
-
return node
|
|
400
|
+
return node?.type === "list" && "listType" in node && typeof node.listType === "string" && "start" in node && typeof node.start === "number" && "tag" in node && typeof node.tag === "string";
|
|
401
401
|
};
|
|
402
402
|
|
|
403
403
|
// src/exportToHtml/ListNodeHandler.ts
|
|
@@ -421,7 +421,7 @@ var ListNodeHandler = class extends NodeHandler {
|
|
|
421
421
|
|
|
422
422
|
// src/typeGuards/isSerializedMatchingQuestionNode.ts
|
|
423
423
|
function isSerializedMatchingQuestionNode(node) {
|
|
424
|
-
return node?.type === "matching-question" && "id" in node && typeof node.id === "string" && "
|
|
424
|
+
return node?.type === "matching-question" && "id" in node && typeof node.id === "string" && "pointsPerMatch" in node && typeof node.pointsPerMatch === "number" && "items" in node && Array.isArray(node.items);
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// src/exportToHtml/MatchingQuestionNodeHandler.ts
|
|
@@ -461,7 +461,7 @@ var MatchingQuestionNodeHandler = class extends NodeHandler {
|
|
|
461
461
|
|
|
462
462
|
// src/typeGuards/isSerializedMultipleOptionQuestionNode.ts
|
|
463
463
|
function isSerializedMultipleOptionQuestionNode(node) {
|
|
464
|
-
return node?.type === "multiple-option-question" && "id" in node && typeof node.id === "string" && "
|
|
464
|
+
return node?.type === "multiple-option-question" && "id" in node && typeof node.id === "string" && "questionType" in node && typeof node.questionType === "string" && "points" in node && typeof node.points === "number" && "options" in node && Array.isArray(node.options);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
// src/exportToHtml/MultipleOptionQuestionNodeHandler.ts
|
|
@@ -530,7 +530,7 @@ function isSerializedShortAnswerQuestionNode(node) {
|
|
|
530
530
|
|
|
531
531
|
// src/typeGuards/isSerializedTableCellNode.ts
|
|
532
532
|
function isSerializedTableCellNode(node) {
|
|
533
|
-
return node?.type === "tablecell";
|
|
533
|
+
return node?.type === "tablecell" && "headerState" in node && typeof node.headerState === "number";
|
|
534
534
|
}
|
|
535
535
|
|
|
536
536
|
// src/exportToHtml/ParagraphNodeHandler.ts
|
|
@@ -594,7 +594,7 @@ var ShortAnswerQuestionNodeHandler = class extends NodeHandler {
|
|
|
594
594
|
|
|
595
595
|
// src/typeGuards/isSerializedSimulationQuestionNode.ts
|
|
596
596
|
function isSerializedSimulationQuestionNode(node) {
|
|
597
|
-
return node?.type === "simulation-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number"
|
|
597
|
+
return node?.type === "simulation-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number";
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
// src/exportToHtml/SimulationQuestionNodeHandler.ts
|
|
@@ -610,7 +610,7 @@ var SimulationQuestionNodeHandler = class extends NodeHandler {
|
|
|
610
610
|
|
|
611
611
|
// src/typeGuards/isSerializedTableRowNode.ts
|
|
612
612
|
function isSerializedTableRowNode(node) {
|
|
613
|
-
return node?.type === "tablerow"
|
|
613
|
+
return node?.type === "tablerow";
|
|
614
614
|
}
|
|
615
615
|
|
|
616
616
|
// src/exportToHtml/TableCellNodeHandler.ts
|
|
@@ -650,7 +650,7 @@ var TableCellNodeHandler = class extends NodeHandler {
|
|
|
650
650
|
|
|
651
651
|
// src/typeGuards/isSerializedTableNode.ts
|
|
652
652
|
function isSerializedTableNode(node) {
|
|
653
|
-
return node?.type === "table"
|
|
653
|
+
return node?.type === "table";
|
|
654
654
|
}
|
|
655
655
|
|
|
656
656
|
// src/exportToHtml/TableNodeHandler.ts
|
|
@@ -730,7 +730,7 @@ var TableRowNodeHandler = class extends NodeHandler {
|
|
|
730
730
|
|
|
731
731
|
// src/typeGuards/isSerializedTextNode.ts
|
|
732
732
|
function isSerializedTextNode(node) {
|
|
733
|
-
return node?.type === "text" && "text" in node && typeof node.text === "string";
|
|
733
|
+
return node?.type === "text" && "detail" in node && typeof node.detail === "number" && "format" in node && typeof node.format === "number" && "mode" in node && typeof node.mode === "string" && "style" in node && typeof node.style === "string" && "text" in node && typeof node.text === "string";
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
// src/exportToHtml/TextNodeHandler.ts
|
|
@@ -813,7 +813,7 @@ var TextNodeHandler = class extends NodeHandler {
|
|
|
813
813
|
|
|
814
814
|
// src/typeGuards/isSerializedVariableNode.ts
|
|
815
815
|
function isSerializedVariableNode(node) {
|
|
816
|
-
return node?.type === "variable" && typeof node.variableName === "string";
|
|
816
|
+
return node?.type === "variable" && "variableName" in node && typeof node.variableName === "string";
|
|
817
817
|
}
|
|
818
818
|
|
|
819
819
|
// src/exportToHtml/VariableNodeHandler.ts
|
package/dist/index.mjs
CHANGED
|
@@ -66,12 +66,12 @@ var EssayQuestionNodeHandler = class extends NodeHandler {
|
|
|
66
66
|
|
|
67
67
|
// src/typeGuards/isSerializedFillInTheBlankQuestionNode.ts
|
|
68
68
|
function isSerializedFillInTheBlankQuestionNode(node) {
|
|
69
|
-
return node?.type === "fill-in-the-blank-question" && "id" in node && typeof node.id === "string" && "
|
|
69
|
+
return node?.type === "fill-in-the-blank-question" && "id" in node && typeof node.id === "string" && "pointsPerSpace" in node && typeof node.pointsPerSpace === "number" && "content" in node;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// src/typeGuards/isSerializedParagraphNode.ts
|
|
73
73
|
function isSerializedParagraphNode(node) {
|
|
74
|
-
return node?.type === "paragraph" && "
|
|
74
|
+
return node?.type === "paragraph" && "textFormat" in node && typeof node.textFormat === "number" && "textStyle" in node && typeof node.textStyle === "string";
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// src/exportToHtml/createHtmlFromNestedNodes.ts
|
|
@@ -109,7 +109,7 @@ var FillInTheBlankQuestionNodeHandler = class extends NodeHandler {
|
|
|
109
109
|
|
|
110
110
|
// src/typeGuards/isSerializedFillInTheBlankSpaceNode.ts
|
|
111
111
|
function isSerializedFillInTheBlankSpaceNode(node) {
|
|
112
|
-
return node?.type === "space" && "id" in node && typeof node.id === "string" && "
|
|
112
|
+
return node?.type === "space" && "id" in node && typeof node.id === "string" && "spaceName" in node && typeof node.spaceName === "string" && "matches" in node && typeof node.matches === "string" && "spaceType" in node;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
// src/exportToHtml/FillInTheBlankSpaceNodeHandler.ts
|
|
@@ -150,7 +150,7 @@ var FillInTheBlankSpaceNodeHandler = class extends NodeHandler {
|
|
|
150
150
|
|
|
151
151
|
// src/typeGuards/isSerializedFinancialStatementQuestionNode.ts
|
|
152
152
|
function isSerializedFinancialStatementQuestionNode(node) {
|
|
153
|
-
return node?.type === "financial-statement-question" && "id" in node && typeof node.id === "string" && "header" in node && "
|
|
153
|
+
return node?.type === "financial-statement-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number" && "header" in node && "columnHeaders" in node && Array.isArray(node.columnHeaders) && "rows" in node && Array.isArray(node.rows) && "distractors" in node && Array.isArray(node.distractors);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// src/exportToHtml/FinancialStatementQuestionNodeHandler.ts
|
|
@@ -216,7 +216,7 @@ var FinancialStatementQuestionNodeHandler = class extends NodeHandler {
|
|
|
216
216
|
|
|
217
217
|
// src/typeGuards/isSerializedHorizontalRuleNode.ts
|
|
218
218
|
var isSerializedHorizontalRuleNode = (node) => {
|
|
219
|
-
return node
|
|
219
|
+
return node?.type === "horizontalrule";
|
|
220
220
|
};
|
|
221
221
|
|
|
222
222
|
// src/exportToHtml/HorizontalRuleNodeHandler.ts
|
|
@@ -229,7 +229,7 @@ var HorizontalRuleNodeHandler = class extends NodeHandler {
|
|
|
229
229
|
|
|
230
230
|
// src/typeGuards/isSerializedImageNode.ts
|
|
231
231
|
var isSerializedImageNode = (node) => {
|
|
232
|
-
return node
|
|
232
|
+
return node?.type === "image" && "altText" in node && typeof node.altText === "string" && "caption" in node && "showCaption" in node && typeof node.showCaption === "boolean" && "src" in node && typeof node.src === "string" && "width" in node && typeof node.width === "string" && "align" in node && typeof node.align === "string" && "showBorder" in node && typeof node.showBorder === "boolean";
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
// src/exportToHtml/ImageNodeHandler.ts
|
|
@@ -248,7 +248,7 @@ var ImageNodeHandler = class extends NodeHandler {
|
|
|
248
248
|
|
|
249
249
|
// src/typeGuards/isSerializedJournalEntryQuestionNode.ts
|
|
250
250
|
function isSerializedJournalEntryQuestionNode(node) {
|
|
251
|
-
return node?.type === "journal-entry-question" && "id" in node && typeof node.id === "string" && "
|
|
251
|
+
return node?.type === "journal-entry-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number" && "journalType" in node && typeof node.journalType === "string" && "lineItems" in node && Array.isArray(node.lineItems);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
// src/exportToHtml/JournalEntryQuestionNodeHandler.ts
|
|
@@ -330,7 +330,7 @@ var LineBreakNodeHandler = class extends NodeHandler {
|
|
|
330
330
|
|
|
331
331
|
// src/typeGuards/isSerializedLinkNode.ts
|
|
332
332
|
var isSerializedLinkNode = (node) => {
|
|
333
|
-
return node
|
|
333
|
+
return node?.type === "link" && "url" in node && typeof node.url === "string";
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
// src/exportToHtml/LinkNodeHandler.ts
|
|
@@ -347,7 +347,7 @@ var LinkNodeHandler = class extends NodeHandler {
|
|
|
347
347
|
|
|
348
348
|
// src/typeGuards/isSerializedListItemNode.ts
|
|
349
349
|
var isSerializedListItemNode = (node) => {
|
|
350
|
-
return node
|
|
350
|
+
return node?.type === "listitem" && "value" in node && typeof node.value === "number";
|
|
351
351
|
};
|
|
352
352
|
|
|
353
353
|
// src/exportToHtml/ListItemNodeHandler.ts
|
|
@@ -370,7 +370,7 @@ var ListItemNodeHandler = class extends NodeHandler {
|
|
|
370
370
|
|
|
371
371
|
// src/typeGuards/isSerializedListNode.ts
|
|
372
372
|
var isSerializedListNode = (node) => {
|
|
373
|
-
return node
|
|
373
|
+
return node?.type === "list" && "listType" in node && typeof node.listType === "string" && "start" in node && typeof node.start === "number" && "tag" in node && typeof node.tag === "string";
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
// src/exportToHtml/ListNodeHandler.ts
|
|
@@ -394,7 +394,7 @@ var ListNodeHandler = class extends NodeHandler {
|
|
|
394
394
|
|
|
395
395
|
// src/typeGuards/isSerializedMatchingQuestionNode.ts
|
|
396
396
|
function isSerializedMatchingQuestionNode(node) {
|
|
397
|
-
return node?.type === "matching-question" && "id" in node && typeof node.id === "string" && "
|
|
397
|
+
return node?.type === "matching-question" && "id" in node && typeof node.id === "string" && "pointsPerMatch" in node && typeof node.pointsPerMatch === "number" && "items" in node && Array.isArray(node.items);
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
// src/exportToHtml/MatchingQuestionNodeHandler.ts
|
|
@@ -434,7 +434,7 @@ var MatchingQuestionNodeHandler = class extends NodeHandler {
|
|
|
434
434
|
|
|
435
435
|
// src/typeGuards/isSerializedMultipleOptionQuestionNode.ts
|
|
436
436
|
function isSerializedMultipleOptionQuestionNode(node) {
|
|
437
|
-
return node?.type === "multiple-option-question" && "id" in node && typeof node.id === "string" && "
|
|
437
|
+
return node?.type === "multiple-option-question" && "id" in node && typeof node.id === "string" && "questionType" in node && typeof node.questionType === "string" && "points" in node && typeof node.points === "number" && "options" in node && Array.isArray(node.options);
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
// src/exportToHtml/MultipleOptionQuestionNodeHandler.ts
|
|
@@ -503,7 +503,7 @@ function isSerializedShortAnswerQuestionNode(node) {
|
|
|
503
503
|
|
|
504
504
|
// src/typeGuards/isSerializedTableCellNode.ts
|
|
505
505
|
function isSerializedTableCellNode(node) {
|
|
506
|
-
return node?.type === "tablecell";
|
|
506
|
+
return node?.type === "tablecell" && "headerState" in node && typeof node.headerState === "number";
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
// src/exportToHtml/ParagraphNodeHandler.ts
|
|
@@ -567,7 +567,7 @@ var ShortAnswerQuestionNodeHandler = class extends NodeHandler {
|
|
|
567
567
|
|
|
568
568
|
// src/typeGuards/isSerializedSimulationQuestionNode.ts
|
|
569
569
|
function isSerializedSimulationQuestionNode(node) {
|
|
570
|
-
return node?.type === "simulation-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number"
|
|
570
|
+
return node?.type === "simulation-question" && "id" in node && typeof node.id === "string" && "points" in node && typeof node.points === "number";
|
|
571
571
|
}
|
|
572
572
|
|
|
573
573
|
// src/exportToHtml/SimulationQuestionNodeHandler.ts
|
|
@@ -583,7 +583,7 @@ var SimulationQuestionNodeHandler = class extends NodeHandler {
|
|
|
583
583
|
|
|
584
584
|
// src/typeGuards/isSerializedTableRowNode.ts
|
|
585
585
|
function isSerializedTableRowNode(node) {
|
|
586
|
-
return node?.type === "tablerow"
|
|
586
|
+
return node?.type === "tablerow";
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
// src/exportToHtml/TableCellNodeHandler.ts
|
|
@@ -623,7 +623,7 @@ var TableCellNodeHandler = class extends NodeHandler {
|
|
|
623
623
|
|
|
624
624
|
// src/typeGuards/isSerializedTableNode.ts
|
|
625
625
|
function isSerializedTableNode(node) {
|
|
626
|
-
return node?.type === "table"
|
|
626
|
+
return node?.type === "table";
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
// src/exportToHtml/TableNodeHandler.ts
|
|
@@ -703,7 +703,7 @@ var TableRowNodeHandler = class extends NodeHandler {
|
|
|
703
703
|
|
|
704
704
|
// src/typeGuards/isSerializedTextNode.ts
|
|
705
705
|
function isSerializedTextNode(node) {
|
|
706
|
-
return node?.type === "text" && "text" in node && typeof node.text === "string";
|
|
706
|
+
return node?.type === "text" && "detail" in node && typeof node.detail === "number" && "format" in node && typeof node.format === "number" && "mode" in node && typeof node.mode === "string" && "style" in node && typeof node.style === "string" && "text" in node && typeof node.text === "string";
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
// src/exportToHtml/TextNodeHandler.ts
|
|
@@ -786,7 +786,7 @@ var TextNodeHandler = class extends NodeHandler {
|
|
|
786
786
|
|
|
787
787
|
// src/typeGuards/isSerializedVariableNode.ts
|
|
788
788
|
function isSerializedVariableNode(node) {
|
|
789
|
-
return node?.type === "variable" && typeof node.variableName === "string";
|
|
789
|
+
return node?.type === "variable" && "variableName" in node && typeof node.variableName === "string";
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
// src/exportToHtml/VariableNodeHandler.ts
|