@learnosity/lib-qti-converter 0.12.7 → 0.13.0
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/docs/GETTING_STARTED.md +71 -18
- package/docs/LEARNOSITY_BUNDLE_FORMAT.md +23 -7
- package/package.json +8 -8
- package/packages/cli/dist/{batchProcessors-DU1HwpHY.js → batchProcessors-DgiDpfpP.js} +271 -77
- package/packages/cli/dist/batchProcessors-DgiDpfpP.js.map +1 -0
- package/packages/cli/dist/batchWorker.js +1 -1
- package/packages/cli/dist/{create-prompt-DU9wLVhI.js → create-prompt-DyNnKXYU.js} +63 -53
- package/packages/cli/dist/create-prompt-DyNnKXYU.js.map +1 -0
- package/packages/cli/dist/{dist-DjpU2mIj.js → dist-D3v6G5F8.js} +6 -6
- package/packages/cli/dist/{dist-DjpU2mIj.js.map → dist-D3v6G5F8.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQti-BSbH3jyx.js → learnosityToQti-CIj5603P.js} +4 -4
- package/packages/cli/dist/{learnosityToQti-BSbH3jyx.js.map → learnosityToQti-CIj5603P.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-B0xRzYmy.js → learnosityToQtiPackage-n6nGGr32.js} +7 -7
- package/packages/cli/dist/{learnosityToQtiPackage-B0xRzYmy.js.map → learnosityToQtiPackage-n6nGGr32.js.map} +1 -1
- package/packages/cli/dist/main.js +5 -5
- package/packages/cli/dist/{nodeFileAccess-BkzSHCOh.js → nodeFileAccess-BhCoGDOi.js} +6 -3
- package/packages/cli/dist/{nodeFileAccess-BkzSHCOh.js.map → nodeFileAccess-BhCoGDOi.js.map} +1 -1
- package/packages/cli/dist/{pathUtils-B9yPTlVF.js → pathUtils-mTQZ0wYS.js} +36 -20
- package/packages/cli/dist/pathUtils-mTQZ0wYS.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-C7JaaUDU.js → qtiPackageToLearnosity-B4cD8jUw.js} +13 -7
- package/packages/cli/dist/qtiPackageToLearnosity-B4cD8jUw.js.map +1 -0
- package/packages/cli/dist/{qtiToLearnosity-CYoG2aIX.js → qtiToLearnosity-DDjcpShJ.js} +7 -6
- package/packages/cli/dist/qtiToLearnosity-DDjcpShJ.js.map +1 -0
- package/packages/cli/dist/{resolveOptions-CW80R2EQ.js → resolveOptions-Czapkfc1.js} +22 -8
- package/packages/cli/dist/resolveOptions-Czapkfc1.js.map +1 -0
- package/packages/cli/dist/{table-DjOn2Tsk.js → table-DTSv0atR.js} +619 -236
- package/packages/cli/dist/table-DTSv0atR.js.map +1 -0
- package/packages/core/dist/index.d.ts +197 -184
- package/packages/core/dist/index.js +858 -303
- package/packages/core/dist/node.d.ts +211 -196
- package/packages/core/dist/node.js +889 -310
- package/packages/cli/dist/batchProcessors-DU1HwpHY.js.map +0 -1
- package/packages/cli/dist/create-prompt-DU9wLVhI.js.map +0 -1
- package/packages/cli/dist/pathUtils-B9yPTlVF.js.map +0 -1
- package/packages/cli/dist/qtiPackageToLearnosity-C7JaaUDU.js.map +0 -1
- package/packages/cli/dist/qtiToLearnosity-CYoG2aIX.js.map +0 -1
- package/packages/cli/dist/resolveOptions-CW80R2EQ.js.map +0 -1
- package/packages/cli/dist/table-DjOn2Tsk.js.map +0 -1
|
@@ -53,7 +53,7 @@ type DiagnosticLevel = 'error' | 'warning' | 'info';
|
|
|
53
53
|
/**
|
|
54
54
|
* Common diagnostic codes
|
|
55
55
|
*/
|
|
56
|
-
declare const DiagnosticCode: {
|
|
56
|
+
export declare const DiagnosticCode: {
|
|
57
57
|
readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
|
|
58
58
|
readonly CONFIG_FILE_NOT_FOUND: "CONFIG_FILE_NOT_FOUND";
|
|
59
59
|
readonly CONFIG_FILE_INVALID_JSON: "CONFIG_FILE_INVALID_JSON";
|
|
@@ -189,6 +189,9 @@ declare const DiagnosticCode: {
|
|
|
189
189
|
readonly QTI_PACKAGE_NO_CONTENT: "QTI_PACKAGE_NO_CONTENT";
|
|
190
190
|
readonly QTI_PACKAGE_DUPLICATE_IDENTIFIER: "QTI_PACKAGE_DUPLICATE_IDENTIFIER";
|
|
191
191
|
readonly QTI_ITEM_CONVERSION_FAILED: "QTI_ITEM_CONVERSION_FAILED";
|
|
192
|
+
readonly QTI_ASSET_HREF_UNSAFE: "QTI_ASSET_HREF_UNSAFE";
|
|
193
|
+
readonly QTI_ASSET_FILENAME_CONFLICT: "QTI_ASSET_FILENAME_CONFLICT";
|
|
194
|
+
readonly QTI_ASSET_IDENTITY_BYTES_CONFLICT: "QTI_ASSET_IDENTITY_BYTES_CONFLICT";
|
|
192
195
|
readonly LRN_BUNDLE_WRITTEN: "LRN_BUNDLE_WRITTEN";
|
|
193
196
|
readonly QTI_DOWNGRADE_NAMESPACE: "QTI_DOWNGRADE_NAMESPACE";
|
|
194
197
|
readonly QTI_DOWNGRADE_SCHEMA_LOCATION: "QTI_DOWNGRADE_SCHEMA_LOCATION";
|
|
@@ -271,6 +274,8 @@ interface ConversionOptions {
|
|
|
271
274
|
organisationId?: number;
|
|
272
275
|
mediaVault?: boolean;
|
|
273
276
|
customAssetUrl?: string;
|
|
277
|
+
/** Preserve original QTI asset basenames instead of using hashed names (default: false). */
|
|
278
|
+
preserveAssetFilenames?: boolean;
|
|
274
279
|
itemReferenceSource?: ItemReferenceSource;
|
|
275
280
|
truncateTags?: boolean;
|
|
276
281
|
/**
|
|
@@ -313,7 +318,7 @@ interface FormatDiagnosticsReportOptions {
|
|
|
313
318
|
/**
|
|
314
319
|
* Format diagnostics array into structured report with metadata
|
|
315
320
|
*/
|
|
316
|
-
declare function formatDiagnosticsReport(diagnostics: Diagnostic[], options: FormatDiagnosticsReportOptions): DiagnosticsReport;
|
|
321
|
+
export declare function formatDiagnosticsReport(diagnostics: Diagnostic[], options: FormatDiagnosticsReportOptions): DiagnosticsReport;
|
|
317
322
|
//#endregion
|
|
318
323
|
//#region src/utils/diagnosticHelpers.d.ts
|
|
319
324
|
/**
|
|
@@ -329,7 +334,7 @@ declare function formatDiagnosticsReport(diagnostics: Diagnostic[], options: For
|
|
|
329
334
|
* const contextual = addFileContext(parsed.diagnostics, 'item_001.xml');
|
|
330
335
|
* allDiagnostics.push(...contextual);
|
|
331
336
|
*/
|
|
332
|
-
declare function addFileContext(diagnostics: Diagnostic[], sourceFile: string): Diagnostic[];
|
|
337
|
+
export declare function addFileContext(diagnostics: Diagnostic[], sourceFile: string): Diagnostic[];
|
|
333
338
|
/**
|
|
334
339
|
* Add file context to diagnostics if sourceFile is provided
|
|
335
340
|
* Convenience wrapper for optional file context
|
|
@@ -343,7 +348,7 @@ declare function addFileContext(diagnostics: Diagnostic[], sourceFile: string):
|
|
|
343
348
|
* const contextual = addFileContextIfProvided(parsed.diagnostics, opts.sourceFile);
|
|
344
349
|
* allDiagnostics.push(...contextual);
|
|
345
350
|
*/
|
|
346
|
-
declare function addFileContextIfProvided(diagnostics: Diagnostic[], sourceFile?: string): Diagnostic[];
|
|
351
|
+
export declare function addFileContextIfProvided(diagnostics: Diagnostic[], sourceFile?: string): Diagnostic[];
|
|
347
352
|
/**
|
|
348
353
|
* Check if diagnostics contain any errors
|
|
349
354
|
*
|
|
@@ -355,7 +360,7 @@ declare function addFileContextIfProvided(diagnostics: Diagnostic[], sourceFile?
|
|
|
355
360
|
* return { diagnostics };
|
|
356
361
|
* }
|
|
357
362
|
*/
|
|
358
|
-
declare function hasErrors(diagnostics: Diagnostic[]): boolean;
|
|
363
|
+
export declare function hasErrors(diagnostics: Diagnostic[]): boolean;
|
|
359
364
|
/**
|
|
360
365
|
* Filter diagnostics by level
|
|
361
366
|
*
|
|
@@ -367,7 +372,7 @@ declare function hasErrors(diagnostics: Diagnostic[]): boolean;
|
|
|
367
372
|
* const errors = filterByLevel(diagnostics, 'error');
|
|
368
373
|
* const warnings = filterByLevel(diagnostics, 'warning');
|
|
369
374
|
*/
|
|
370
|
-
declare function filterByLevel(diagnostics: Diagnostic[], level: 'error' | 'warning' | 'info'): Diagnostic[];
|
|
375
|
+
export declare function filterByLevel(diagnostics: Diagnostic[], level: 'error' | 'warning' | 'info'): Diagnostic[];
|
|
371
376
|
/**
|
|
372
377
|
* Filter diagnostics by code
|
|
373
378
|
*
|
|
@@ -379,7 +384,7 @@ declare function filterByLevel(diagnostics: Diagnostic[], level: 'error' | 'warn
|
|
|
379
384
|
* // Filter out redundant diagnostics
|
|
380
385
|
* const filtered = filterOutCodes(diagnostics, ['QTI_UNSUPPORTED_INTERACTION', 'QTI_MISSING_INTERACTION']);
|
|
381
386
|
*/
|
|
382
|
-
declare function filterOutCodes(diagnostics: Diagnostic[], codes: string[]): Diagnostic[];
|
|
387
|
+
export declare function filterOutCodes(diagnostics: Diagnostic[], codes: string[]): Diagnostic[];
|
|
383
388
|
/**
|
|
384
389
|
* Count diagnostics by level
|
|
385
390
|
*
|
|
@@ -390,7 +395,7 @@ declare function filterOutCodes(diagnostics: Diagnostic[], codes: string[]): Dia
|
|
|
390
395
|
* const counts = countByLevel(diagnostics);
|
|
391
396
|
* console.log(`Errors: ${counts.errors}, Warnings: ${counts.warnings}`);
|
|
392
397
|
*/
|
|
393
|
-
declare function countByLevel(diagnostics: Diagnostic[]): {
|
|
398
|
+
export declare function countByLevel(diagnostics: Diagnostic[]): {
|
|
394
399
|
errors: number;
|
|
395
400
|
warnings: number;
|
|
396
401
|
info: number;
|
|
@@ -408,7 +413,7 @@ declare function countByLevel(diagnostics: Diagnostic[]): {
|
|
|
408
413
|
* @example
|
|
409
414
|
* diagnostics.push(createDiagnostic('error', 'QTI_INVALID_XML', 'Malformed XML', 'item.xml'));
|
|
410
415
|
*/
|
|
411
|
-
declare function createDiagnostic(level: 'error' | 'warning' | 'info', code: string, message: string, file: string, context?: Record<string, unknown>): Diagnostic;
|
|
416
|
+
export declare function createDiagnostic(level: 'error' | 'warning' | 'info', code: string, message: string, file: string, context?: Record<string, unknown>): Diagnostic;
|
|
412
417
|
/**
|
|
413
418
|
* Merge multiple diagnostic arrays
|
|
414
419
|
*
|
|
@@ -418,7 +423,7 @@ declare function createDiagnostic(level: 'error' | 'warning' | 'info', code: str
|
|
|
418
423
|
* @example
|
|
419
424
|
* const allDiagnostics = mergeDiagnostics(parseResult.diagnostics, mapResult.diagnostics, serializeResult.diagnostics);
|
|
420
425
|
*/
|
|
421
|
-
declare function mergeDiagnostics(...diagnosticArrays: Diagnostic[][]): Diagnostic[];
|
|
426
|
+
export declare function mergeDiagnostics(...diagnosticArrays: Diagnostic[][]): Diagnostic[];
|
|
422
427
|
//#endregion
|
|
423
428
|
//#region src/learnosity-model/types.d.ts
|
|
424
429
|
/**
|
|
@@ -430,31 +435,31 @@ declare function mergeDiagnostics(...diagnosticArrays: Diagnostic[][]): Diagnost
|
|
|
430
435
|
/**
|
|
431
436
|
* Widget type in item definition
|
|
432
437
|
*/
|
|
433
|
-
type LearnosityWidgetType = 'response' | 'feature';
|
|
438
|
+
export type LearnosityWidgetType = 'response' | 'feature';
|
|
434
439
|
/**
|
|
435
440
|
* Widget blueprint entry
|
|
436
441
|
*/
|
|
437
|
-
interface LearnosityWidgetBlueprint {
|
|
442
|
+
export interface LearnosityWidgetBlueprint {
|
|
438
443
|
reference: string;
|
|
439
444
|
widget_type: LearnosityWidgetType;
|
|
440
445
|
}
|
|
441
446
|
/**
|
|
442
447
|
* Item tag
|
|
443
448
|
*/
|
|
444
|
-
interface LearnosityTag {
|
|
449
|
+
export interface LearnosityTag {
|
|
445
450
|
type: string;
|
|
446
451
|
name: string;
|
|
447
452
|
}
|
|
448
453
|
/**
|
|
449
454
|
* Item definition
|
|
450
455
|
*/
|
|
451
|
-
interface LearnosityItemDefinition {
|
|
456
|
+
export interface LearnosityItemDefinition {
|
|
452
457
|
widgets: LearnosityWidgetBlueprint[];
|
|
453
458
|
}
|
|
454
459
|
/**
|
|
455
460
|
* Item metadata
|
|
456
461
|
*/
|
|
457
|
-
interface LearnosityItemMetadata {
|
|
462
|
+
export interface LearnosityItemMetadata {
|
|
458
463
|
reference: string;
|
|
459
464
|
content: string;
|
|
460
465
|
title?: string | null;
|
|
@@ -468,14 +473,14 @@ interface LearnosityItemMetadata {
|
|
|
468
473
|
/**
|
|
469
474
|
* MCQ option
|
|
470
475
|
*/
|
|
471
|
-
interface LearnosityMcqOption {
|
|
476
|
+
export interface LearnosityMcqOption {
|
|
472
477
|
label: string;
|
|
473
478
|
value: string | number;
|
|
474
479
|
}
|
|
475
480
|
/**
|
|
476
481
|
* MCQ validation
|
|
477
482
|
*/
|
|
478
|
-
interface LearnosityMcqValidation {
|
|
483
|
+
export interface LearnosityMcqValidation {
|
|
479
484
|
scoring_type?: string;
|
|
480
485
|
valid_response?: {
|
|
481
486
|
value?: (string | number)[];
|
|
@@ -486,25 +491,25 @@ interface LearnosityMcqValidation {
|
|
|
486
491
|
/**
|
|
487
492
|
* MCQ UI style
|
|
488
493
|
*/
|
|
489
|
-
interface LearnosityMcqUiStyle {
|
|
494
|
+
export interface LearnosityMcqUiStyle {
|
|
490
495
|
type?: string;
|
|
491
496
|
}
|
|
492
497
|
/**
|
|
493
498
|
* Common metadata for all question types
|
|
494
499
|
*/
|
|
495
|
-
interface LearnosityQuestionMetadata {
|
|
500
|
+
export interface LearnosityQuestionMetadata {
|
|
496
501
|
distractor_rationale?: string;
|
|
497
502
|
}
|
|
498
503
|
/**
|
|
499
504
|
* MCQ metadata for feedback (extends common metadata with per-option feedback)
|
|
500
505
|
*/
|
|
501
|
-
interface LearnosityMcqMetadata extends LearnosityQuestionMetadata {
|
|
506
|
+
export interface LearnosityMcqMetadata extends LearnosityQuestionMetadata {
|
|
502
507
|
distractor_rationale_response_level?: string[] | Record<string, string>;
|
|
503
508
|
}
|
|
504
509
|
/**
|
|
505
510
|
* MCQ question data (only supported type in v1)
|
|
506
511
|
*/
|
|
507
|
-
interface LearnosityMcqData {
|
|
512
|
+
export interface LearnosityMcqData {
|
|
508
513
|
type: 'mcq';
|
|
509
514
|
stimulus?: string;
|
|
510
515
|
instructor_stimulus?: string;
|
|
@@ -520,7 +525,7 @@ interface LearnosityMcqData {
|
|
|
520
525
|
/**
|
|
521
526
|
* Clozetext validation
|
|
522
527
|
*/
|
|
523
|
-
interface LearnosityClozetextValidation {
|
|
528
|
+
export interface LearnosityClozetextValidation {
|
|
524
529
|
scoring_type?: string;
|
|
525
530
|
valid_response?: {
|
|
526
531
|
value?: (string | null)[];
|
|
@@ -531,14 +536,14 @@ interface LearnosityClozetextValidation {
|
|
|
531
536
|
/**
|
|
532
537
|
* Clozetext response container (shared settings for all response fields)
|
|
533
538
|
*/
|
|
534
|
-
interface LearnosityClozetextResponseContainer {
|
|
539
|
+
export interface LearnosityClozetextResponseContainer {
|
|
535
540
|
input_type?: 'text' | 'number';
|
|
536
541
|
max_length?: number;
|
|
537
542
|
}
|
|
538
543
|
/**
|
|
539
544
|
* Clozetext question data (vNext)
|
|
540
545
|
*/
|
|
541
|
-
interface LearnosityClozetextData {
|
|
546
|
+
export interface LearnosityClozetextData {
|
|
542
547
|
type: 'clozetext';
|
|
543
548
|
stimulus?: string;
|
|
544
549
|
instructor_stimulus?: string;
|
|
@@ -557,7 +562,7 @@ interface LearnosityClozetextData {
|
|
|
557
562
|
* Math cloze types that use {{response}} placeholders within a template.
|
|
558
563
|
* Converted to unscored textEntryInteraction in QTI (no scoring equivalent exists).
|
|
559
564
|
*/
|
|
560
|
-
interface LearnosityClozeformulaData {
|
|
565
|
+
export interface LearnosityClozeformulaData {
|
|
561
566
|
type: 'clozeformula' | 'clozeformulaV2' | 'formulaV2';
|
|
562
567
|
stimulus?: string;
|
|
563
568
|
/**
|
|
@@ -592,7 +597,7 @@ interface LearnosityClozeformulaData {
|
|
|
592
597
|
* Image-based math cloze type with positioned response blanks over a background image.
|
|
593
598
|
* Converted to unscored textEntryInteraction in QTI (no scoring equivalent exists).
|
|
594
599
|
*/
|
|
595
|
-
interface LearnosityImageClozeformulaV2Data {
|
|
600
|
+
export interface LearnosityImageClozeformulaV2Data {
|
|
596
601
|
type: 'imageclozeformulaV2';
|
|
597
602
|
stimulus?: string;
|
|
598
603
|
instructor_stimulus?: string;
|
|
@@ -631,13 +636,13 @@ interface LearnosityImageClozeformulaV2Data {
|
|
|
631
636
|
/**
|
|
632
637
|
* LongtextV2 validation
|
|
633
638
|
*/
|
|
634
|
-
interface LearnosityLongtextV2Validation {
|
|
639
|
+
export interface LearnosityLongtextV2Validation {
|
|
635
640
|
max_score?: number;
|
|
636
641
|
}
|
|
637
642
|
/**
|
|
638
643
|
* LongtextV2 question data (vNext, essay/extended response)
|
|
639
644
|
*/
|
|
640
|
-
interface LearnosityLongtextV2Data {
|
|
645
|
+
export interface LearnosityLongtextV2Data {
|
|
641
646
|
type: 'longtextV2';
|
|
642
647
|
stimulus?: string;
|
|
643
648
|
instructor_stimulus?: string;
|
|
@@ -650,7 +655,7 @@ interface LearnosityLongtextV2Data {
|
|
|
650
655
|
/**
|
|
651
656
|
* FormulaessayV2 question data (alias of longtextV2, produces extendedTextInteraction)
|
|
652
657
|
*/
|
|
653
|
-
interface LearnosityFormulaessayV2Data {
|
|
658
|
+
export interface LearnosityFormulaessayV2Data {
|
|
654
659
|
type: 'formulaessayV2';
|
|
655
660
|
stimulus?: string;
|
|
656
661
|
instructor_stimulus?: string;
|
|
@@ -662,7 +667,7 @@ interface LearnosityFormulaessayV2Data {
|
|
|
662
667
|
/**
|
|
663
668
|
* ChemistryessayV2 question data (alias of longtextV2, produces extendedTextInteraction)
|
|
664
669
|
*/
|
|
665
|
-
interface LearnosityChemistryessayV2Data {
|
|
670
|
+
export interface LearnosityChemistryessayV2Data {
|
|
666
671
|
type: 'chemistryessayV2';
|
|
667
672
|
stimulus?: string;
|
|
668
673
|
instructor_stimulus?: string;
|
|
@@ -674,14 +679,14 @@ interface LearnosityChemistryessayV2Data {
|
|
|
674
679
|
/**
|
|
675
680
|
* Plaintext UI style
|
|
676
681
|
*/
|
|
677
|
-
interface LearnosityPlaintextUiStyle {
|
|
682
|
+
export interface LearnosityPlaintextUiStyle {
|
|
678
683
|
min_height?: string;
|
|
679
684
|
max_height?: string;
|
|
680
685
|
}
|
|
681
686
|
/**
|
|
682
687
|
* Plaintext question data (plain text input, no formatting)
|
|
683
688
|
*/
|
|
684
|
-
interface LearnosityPlaintextData {
|
|
689
|
+
export interface LearnosityPlaintextData {
|
|
685
690
|
type: 'plaintext';
|
|
686
691
|
stimulus?: string;
|
|
687
692
|
instructor_stimulus?: string;
|
|
@@ -698,7 +703,7 @@ interface LearnosityPlaintextData {
|
|
|
698
703
|
/**
|
|
699
704
|
* Shorttext validation
|
|
700
705
|
*/
|
|
701
|
-
interface LearnosityShorttextValidation {
|
|
706
|
+
export interface LearnosityShorttextValidation {
|
|
702
707
|
scoring_type?: string;
|
|
703
708
|
valid_response?: {
|
|
704
709
|
value?: string | string[];
|
|
@@ -709,7 +714,7 @@ interface LearnosityShorttextValidation {
|
|
|
709
714
|
/**
|
|
710
715
|
* Shorttext question data (single short answer)
|
|
711
716
|
*/
|
|
712
|
-
interface LearnosityShorttextData {
|
|
717
|
+
export interface LearnosityShorttextData {
|
|
713
718
|
type: 'shorttext';
|
|
714
719
|
stimulus?: string;
|
|
715
720
|
instructor_stimulus?: string;
|
|
@@ -723,7 +728,7 @@ interface LearnosityShorttextData {
|
|
|
723
728
|
/**
|
|
724
729
|
* Clozedropdown validation
|
|
725
730
|
*/
|
|
726
|
-
interface LearnosityClozedropdownValidation {
|
|
731
|
+
export interface LearnosityClozedropdownValidation {
|
|
727
732
|
scoring_type?: string;
|
|
728
733
|
valid_response?: {
|
|
729
734
|
value?: string[];
|
|
@@ -734,7 +739,7 @@ interface LearnosityClozedropdownValidation {
|
|
|
734
739
|
/**
|
|
735
740
|
* Clozedropdown question data (inline dropdown/select menus in text)
|
|
736
741
|
*/
|
|
737
|
-
interface LearnosityClozedropdownData {
|
|
742
|
+
export interface LearnosityClozedropdownData {
|
|
738
743
|
type: 'clozedropdown';
|
|
739
744
|
stimulus?: string;
|
|
740
745
|
instructor_stimulus?: string;
|
|
@@ -748,7 +753,7 @@ interface LearnosityClozedropdownData {
|
|
|
748
753
|
/**
|
|
749
754
|
* Clozeassociation validation
|
|
750
755
|
*/
|
|
751
|
-
interface LearnosityClozeassociationValidation {
|
|
756
|
+
export interface LearnosityClozeassociationValidation {
|
|
752
757
|
scoring_type?: string;
|
|
753
758
|
valid_response?: {
|
|
754
759
|
value?: string[];
|
|
@@ -759,14 +764,14 @@ interface LearnosityClozeassociationValidation {
|
|
|
759
764
|
/**
|
|
760
765
|
* Clozeassociation possible response group (for grouped UI display)
|
|
761
766
|
*/
|
|
762
|
-
interface LearnosityClozeassociationResponseGroup {
|
|
767
|
+
export interface LearnosityClozeassociationResponseGroup {
|
|
763
768
|
title: string;
|
|
764
769
|
responses: string[];
|
|
765
770
|
}
|
|
766
771
|
/**
|
|
767
772
|
* Normalized possible responses for clozeassociation (internal representation)
|
|
768
773
|
*/
|
|
769
|
-
interface NormalizedClozeassociationPossibleResponses {
|
|
774
|
+
export interface NormalizedClozeassociationPossibleResponses {
|
|
770
775
|
mode: 'flat' | 'grouped';
|
|
771
776
|
flat: string[];
|
|
772
777
|
groups?: LearnosityClozeassociationResponseGroup[];
|
|
@@ -777,7 +782,7 @@ interface NormalizedClozeassociationPossibleResponses {
|
|
|
777
782
|
* 1. Flat: possible_responses array (legacy)
|
|
778
783
|
* 2. Grouped: group_possible_responses=true + possible_response_groups array
|
|
779
784
|
*/
|
|
780
|
-
interface LearnosityClozeassociationData {
|
|
785
|
+
export interface LearnosityClozeassociationData {
|
|
781
786
|
type: 'clozeassociation';
|
|
782
787
|
stimulus?: string;
|
|
783
788
|
instructor_stimulus?: string;
|
|
@@ -794,7 +799,7 @@ interface LearnosityClozeassociationData {
|
|
|
794
799
|
/**
|
|
795
800
|
* Sharedpassage feature data (rich text passage)
|
|
796
801
|
*/
|
|
797
|
-
interface LearnositySharedpassageData {
|
|
802
|
+
export interface LearnositySharedpassageData {
|
|
798
803
|
type: 'sharedpassage';
|
|
799
804
|
heading?: string;
|
|
800
805
|
content: string;
|
|
@@ -805,7 +810,7 @@ interface LearnositySharedpassageData {
|
|
|
805
810
|
/**
|
|
806
811
|
* Audioplayer feature data
|
|
807
812
|
*/
|
|
808
|
-
interface LearnosityAudioplayerData {
|
|
813
|
+
export interface LearnosityAudioplayerData {
|
|
809
814
|
type: 'audioplayer';
|
|
810
815
|
src: string;
|
|
811
816
|
player?: string;
|
|
@@ -819,7 +824,7 @@ interface LearnosityAudioplayerData {
|
|
|
819
824
|
/**
|
|
820
825
|
* Videoplayer feature data
|
|
821
826
|
*/
|
|
822
|
-
interface LearnosityVideoplayerData {
|
|
827
|
+
export interface LearnosityVideoplayerData {
|
|
823
828
|
type: 'videoplayer';
|
|
824
829
|
src: string;
|
|
825
830
|
player_type?: 'hosted-video' | 'youtube' | 'vimeo';
|
|
@@ -832,7 +837,7 @@ interface LearnosityVideoplayerData {
|
|
|
832
837
|
/**
|
|
833
838
|
* Orderlist validation
|
|
834
839
|
*/
|
|
835
|
-
interface LearnosityOrderlistValidation {
|
|
840
|
+
export interface LearnosityOrderlistValidation {
|
|
836
841
|
scoring_type?: string;
|
|
837
842
|
valid_response?: {
|
|
838
843
|
value: number[];
|
|
@@ -844,7 +849,7 @@ interface LearnosityOrderlistValidation {
|
|
|
844
849
|
/**
|
|
845
850
|
* Orderlist question data (ordering/sequencing)
|
|
846
851
|
*/
|
|
847
|
-
interface LearnosityOrderlistData {
|
|
852
|
+
export interface LearnosityOrderlistData {
|
|
848
853
|
type: 'orderlist';
|
|
849
854
|
stimulus?: string;
|
|
850
855
|
instructor_stimulus?: string;
|
|
@@ -857,7 +862,7 @@ interface LearnosityOrderlistData {
|
|
|
857
862
|
/**
|
|
858
863
|
* Tokenhighlight validation
|
|
859
864
|
*/
|
|
860
|
-
interface LearnosityTokenhighlightValidation {
|
|
865
|
+
export interface LearnosityTokenhighlightValidation {
|
|
861
866
|
scoring_type?: string;
|
|
862
867
|
valid_response?: {
|
|
863
868
|
value: number[];
|
|
@@ -868,7 +873,7 @@ interface LearnosityTokenhighlightValidation {
|
|
|
868
873
|
/**
|
|
869
874
|
* Tokenhighlight question data (highlight selectable tokens in text)
|
|
870
875
|
*/
|
|
871
|
-
interface LearnosityTokenhighlightData {
|
|
876
|
+
export interface LearnosityTokenhighlightData {
|
|
872
877
|
type: 'tokenhighlight';
|
|
873
878
|
stimulus?: string;
|
|
874
879
|
instructor_stimulus?: string;
|
|
@@ -881,7 +886,7 @@ interface LearnosityTokenhighlightData {
|
|
|
881
886
|
/**
|
|
882
887
|
* Choicematrix validation
|
|
883
888
|
*/
|
|
884
|
-
interface LearnosityChoicematrixValidation {
|
|
889
|
+
export interface LearnosityChoicematrixValidation {
|
|
885
890
|
scoring_type?: 'exactMatch';
|
|
886
891
|
valid_response?: {
|
|
887
892
|
value?: number[][];
|
|
@@ -891,14 +896,14 @@ interface LearnosityChoicematrixValidation {
|
|
|
891
896
|
/**
|
|
892
897
|
* Choicematrix UI style
|
|
893
898
|
*/
|
|
894
|
-
interface LearnosityChoicematrixUiStyle {
|
|
899
|
+
export interface LearnosityChoicematrixUiStyle {
|
|
895
900
|
type?: 'table' | 'inline';
|
|
896
901
|
horizontal_lines?: boolean;
|
|
897
902
|
}
|
|
898
903
|
/**
|
|
899
904
|
* Choicematrix question data (matrix of options per stem/row)
|
|
900
905
|
*/
|
|
901
|
-
interface LearnosityChoicematrixData {
|
|
906
|
+
export interface LearnosityChoicematrixData {
|
|
902
907
|
type: 'choicematrix';
|
|
903
908
|
stimulus?: string;
|
|
904
909
|
instructor_stimulus?: string;
|
|
@@ -912,7 +917,7 @@ interface LearnosityChoicematrixData {
|
|
|
912
917
|
}
|
|
913
918
|
/** * Hotspot image
|
|
914
919
|
*/
|
|
915
|
-
interface LearnosityHotspotImage {
|
|
920
|
+
export interface LearnosityHotspotImage {
|
|
916
921
|
source: string;
|
|
917
922
|
width: number;
|
|
918
923
|
height: number;
|
|
@@ -921,14 +926,14 @@ interface LearnosityHotspotImage {
|
|
|
921
926
|
/**
|
|
922
927
|
* Hotspot polygon point (percentages)
|
|
923
928
|
*/
|
|
924
|
-
interface LearnosityHotspotPoint {
|
|
929
|
+
export interface LearnosityHotspotPoint {
|
|
925
930
|
x: number;
|
|
926
931
|
y: number;
|
|
927
932
|
}
|
|
928
933
|
/**
|
|
929
934
|
* Hotspot validation
|
|
930
935
|
*/
|
|
931
|
-
interface LearnosityHotspotValidation {
|
|
936
|
+
export interface LearnosityHotspotValidation {
|
|
932
937
|
scoring_type?: 'exactMatch';
|
|
933
938
|
valid_response?: {
|
|
934
939
|
value?: (string | number)[];
|
|
@@ -938,7 +943,7 @@ interface LearnosityHotspotValidation {
|
|
|
938
943
|
/**
|
|
939
944
|
* Hotspot question data (click areas on image)
|
|
940
945
|
*/
|
|
941
|
-
interface LearnosityHotspotData {
|
|
946
|
+
export interface LearnosityHotspotData {
|
|
942
947
|
type: 'hotspot';
|
|
943
948
|
stimulus?: string;
|
|
944
949
|
instructor_stimulus?: string;
|
|
@@ -951,7 +956,7 @@ interface LearnosityHotspotData {
|
|
|
951
956
|
}
|
|
952
957
|
/** * Imageclozeassociation image definition
|
|
953
958
|
*/
|
|
954
|
-
interface LearnosityImageclozeassociationV2Image {
|
|
959
|
+
export interface LearnosityImageclozeassociationV2Image {
|
|
955
960
|
src: string;
|
|
956
961
|
width?: number;
|
|
957
962
|
height?: number;
|
|
@@ -961,7 +966,7 @@ interface LearnosityImageclozeassociationV2Image {
|
|
|
961
966
|
/**
|
|
962
967
|
* Imageclozeassociation response container (drop zone)
|
|
963
968
|
*/
|
|
964
|
-
interface LearnosityImageclozeassociationV2ResponseContainer {
|
|
969
|
+
export interface LearnosityImageclozeassociationV2ResponseContainer {
|
|
965
970
|
x: number;
|
|
966
971
|
y: number;
|
|
967
972
|
width: string;
|
|
@@ -971,14 +976,14 @@ interface LearnosityImageclozeassociationV2ResponseContainer {
|
|
|
971
976
|
/**
|
|
972
977
|
* Imageclozeassociation possible response group (for grouped UI display)
|
|
973
978
|
*/
|
|
974
|
-
interface LearnosityImageclozeassociationV2ResponseGroup {
|
|
979
|
+
export interface LearnosityImageclozeassociationV2ResponseGroup {
|
|
975
980
|
title: string;
|
|
976
981
|
responses: string[];
|
|
977
982
|
}
|
|
978
983
|
/**
|
|
979
984
|
* Imageclozeassociation validation
|
|
980
985
|
*/
|
|
981
|
-
interface LearnosityImageclozeassociationV2Validation {
|
|
986
|
+
export interface LearnosityImageclozeassociationV2Validation {
|
|
982
987
|
scoring_type?: 'exactMatch' | 'partialMatch' | 'partialMatchV2' | 'partialMatchPerResponse';
|
|
983
988
|
valid_response?: {
|
|
984
989
|
value?: string[][];
|
|
@@ -989,7 +994,7 @@ interface LearnosityImageclozeassociationV2Validation {
|
|
|
989
994
|
/**
|
|
990
995
|
* Imageclozeassociation question data (drag text onto image zones)
|
|
991
996
|
*/
|
|
992
|
-
interface LearnosityImageclozeassociationV2Data {
|
|
997
|
+
export interface LearnosityImageclozeassociationV2Data {
|
|
993
998
|
type: 'imageclozeassociationV2';
|
|
994
999
|
stimulus?: string;
|
|
995
1000
|
instructor_stimulus?: string;
|
|
@@ -1009,7 +1014,7 @@ interface LearnosityImageclozeassociationV2Data {
|
|
|
1009
1014
|
/**
|
|
1010
1015
|
* Fileupload question data (file upload)
|
|
1011
1016
|
*/
|
|
1012
|
-
interface LearnosityFileuploadData {
|
|
1017
|
+
export interface LearnosityFileuploadData {
|
|
1013
1018
|
type: 'fileupload';
|
|
1014
1019
|
stimulus?: string;
|
|
1015
1020
|
instructor_stimulus?: string;
|
|
@@ -1048,7 +1053,7 @@ interface LearnosityFileuploadData {
|
|
|
1048
1053
|
/**
|
|
1049
1054
|
* Drawing image specification
|
|
1050
1055
|
*/
|
|
1051
|
-
interface LearnosityDrawingImage {
|
|
1056
|
+
export interface LearnosityDrawingImage {
|
|
1052
1057
|
source?: string;
|
|
1053
1058
|
src?: string;
|
|
1054
1059
|
width?: number;
|
|
@@ -1058,7 +1063,7 @@ interface LearnosityDrawingImage {
|
|
|
1058
1063
|
/**
|
|
1059
1064
|
* Drawing question data (freehand drawing with optional background image)
|
|
1060
1065
|
*/
|
|
1061
|
-
interface LearnosityDrawingData {
|
|
1066
|
+
export interface LearnosityDrawingData {
|
|
1062
1067
|
type: 'drawing';
|
|
1063
1068
|
stimulus?: string;
|
|
1064
1069
|
instructor_stimulus?: string;
|
|
@@ -1072,7 +1077,7 @@ interface LearnosityDrawingData {
|
|
|
1072
1077
|
/**
|
|
1073
1078
|
* Classification validation
|
|
1074
1079
|
*/
|
|
1075
|
-
interface LearnosityClassificationValidation {
|
|
1080
|
+
export interface LearnosityClassificationValidation {
|
|
1076
1081
|
scoring_type?: string;
|
|
1077
1082
|
valid_response?: {
|
|
1078
1083
|
score?: number;
|
|
@@ -1082,7 +1087,7 @@ interface LearnosityClassificationValidation {
|
|
|
1082
1087
|
/**
|
|
1083
1088
|
* Classification question data (maps from QTI associationInteraction)
|
|
1084
1089
|
*/
|
|
1085
|
-
interface LearnosityClassificationData {
|
|
1090
|
+
export interface LearnosityClassificationData {
|
|
1086
1091
|
type: 'classification';
|
|
1087
1092
|
instructor_stimulus?: string;
|
|
1088
1093
|
stimulus?: string;
|
|
@@ -1104,19 +1109,19 @@ interface LearnosityClassificationData {
|
|
|
1104
1109
|
/**
|
|
1105
1110
|
* Supported question types
|
|
1106
1111
|
*/
|
|
1107
|
-
type LearnosityQuestionType = 'mcq' | 'clozetext' | 'clozeformula' | 'clozeformulaV2' | 'formulaV2' | 'imageclozeformulaV2' | 'longtextV2' | 'formulaessayV2' | 'chemistryessayV2' | 'plaintext' | 'shorttext' | 'clozedropdown' | 'clozeassociation' | 'orderlist' | 'tokenhighlight' | 'choicematrix' | 'hotspot' | 'imageclozeassociationV2' | 'fileupload' | 'drawing' | 'classification';
|
|
1112
|
+
export type LearnosityQuestionType = 'mcq' | 'clozetext' | 'clozeformula' | 'clozeformulaV2' | 'formulaV2' | 'imageclozeformulaV2' | 'longtextV2' | 'formulaessayV2' | 'chemistryessayV2' | 'plaintext' | 'shorttext' | 'clozedropdown' | 'clozeassociation' | 'orderlist' | 'tokenhighlight' | 'choicematrix' | 'hotspot' | 'imageclozeassociationV2' | 'fileupload' | 'drawing' | 'classification';
|
|
1108
1113
|
/**
|
|
1109
1114
|
* Supported feature types
|
|
1110
1115
|
*/
|
|
1111
|
-
type LearnosityFeatureType = 'sharedpassage' | 'audioplayer' | 'videoplayer' | string;
|
|
1116
|
+
export type LearnosityFeatureType = 'sharedpassage' | 'audioplayer' | 'videoplayer' | string;
|
|
1112
1117
|
/**
|
|
1113
1118
|
* Question data union
|
|
1114
1119
|
*/
|
|
1115
|
-
type LearnosityQuestionData = LearnosityMcqData | LearnosityClozetextData | LearnosityClozeformulaData | LearnosityImageClozeformulaV2Data | LearnosityLongtextV2Data | LearnosityFormulaessayV2Data | LearnosityChemistryessayV2Data | LearnosityPlaintextData | LearnosityShorttextData | LearnosityClozedropdownData | LearnosityClozeassociationData | LearnosityOrderlistData | LearnosityTokenhighlightData | LearnosityChoicematrixData | LearnosityHotspotData | LearnosityImageclozeassociationV2Data | LearnosityFileuploadData | LearnosityDrawingData | LearnosityClassificationData;
|
|
1120
|
+
export type LearnosityQuestionData = LearnosityMcqData | LearnosityClozetextData | LearnosityClozeformulaData | LearnosityImageClozeformulaV2Data | LearnosityLongtextV2Data | LearnosityFormulaessayV2Data | LearnosityChemistryessayV2Data | LearnosityPlaintextData | LearnosityShorttextData | LearnosityClozedropdownData | LearnosityClozeassociationData | LearnosityOrderlistData | LearnosityTokenhighlightData | LearnosityChoicematrixData | LearnosityHotspotData | LearnosityImageclozeassociationV2Data | LearnosityFileuploadData | LearnosityDrawingData | LearnosityClassificationData;
|
|
1116
1121
|
/**
|
|
1117
1122
|
* Question (response widget)
|
|
1118
1123
|
*/
|
|
1119
|
-
interface LearnosityQuestion {
|
|
1124
|
+
export interface LearnosityQuestion {
|
|
1120
1125
|
reference: string;
|
|
1121
1126
|
widget_type: 'response';
|
|
1122
1127
|
type: LearnosityQuestionType;
|
|
@@ -1126,7 +1131,7 @@ interface LearnosityQuestion {
|
|
|
1126
1131
|
/**
|
|
1127
1132
|
* Feature widget (preserved but not interpreted in v1)
|
|
1128
1133
|
*/
|
|
1129
|
-
interface LearnosityFeature {
|
|
1134
|
+
export interface LearnosityFeature {
|
|
1130
1135
|
reference: string;
|
|
1131
1136
|
widget_type: 'feature';
|
|
1132
1137
|
type: LearnosityFeatureType;
|
|
@@ -1135,7 +1140,7 @@ interface LearnosityFeature {
|
|
|
1135
1140
|
/**
|
|
1136
1141
|
* Layout widget reference (for multi-widget items)
|
|
1137
1142
|
*/
|
|
1138
|
-
type LearnosityLayoutWidget = {
|
|
1143
|
+
export type LearnosityLayoutWidget = {
|
|
1139
1144
|
kind: 'question';
|
|
1140
1145
|
ref: string;
|
|
1141
1146
|
} | {
|
|
@@ -1145,20 +1150,20 @@ type LearnosityLayoutWidget = {
|
|
|
1145
1150
|
/**
|
|
1146
1151
|
* Layout column (for multi-widget items)
|
|
1147
1152
|
*/
|
|
1148
|
-
interface LearnosityLayoutColumn {
|
|
1153
|
+
export interface LearnosityLayoutColumn {
|
|
1149
1154
|
index: 1 | 2;
|
|
1150
1155
|
widgets: LearnosityLayoutWidget[];
|
|
1151
1156
|
}
|
|
1152
1157
|
/**
|
|
1153
1158
|
* Item layout (extracted from item.content HTML)
|
|
1154
1159
|
*/
|
|
1155
|
-
interface LearnosityLayout {
|
|
1160
|
+
export interface LearnosityLayout {
|
|
1156
1161
|
columns: LearnosityLayoutColumn[];
|
|
1157
1162
|
}
|
|
1158
1163
|
/**
|
|
1159
1164
|
* Validated and normalized Learnosity Item Model
|
|
1160
1165
|
*/
|
|
1161
|
-
interface LearnosityItemModel {
|
|
1166
|
+
export interface LearnosityItemModel {
|
|
1162
1167
|
item: LearnosityItemMetadata;
|
|
1163
1168
|
questions: LearnosityQuestion[];
|
|
1164
1169
|
features: LearnosityFeature[];
|
|
@@ -1448,14 +1453,14 @@ interface LearnosityImageclozeassociationV2QuestionJson {
|
|
|
1448
1453
|
* @param opts - Conversion options
|
|
1449
1454
|
* @returns Learnosity JSON and diagnostics
|
|
1450
1455
|
*/
|
|
1451
|
-
declare function convertQtiToLearnosity(input: string, opts: ConversionOptions): Promise<ConversionResult<LearnosityItemJson | undefined>>;
|
|
1456
|
+
export declare function convertQtiToLearnosity(input: string, opts: ConversionOptions): Promise<ConversionResult<LearnosityItemJson | undefined>>;
|
|
1452
1457
|
/**
|
|
1453
1458
|
* Convert Learnosity JSON to QTI XML
|
|
1454
1459
|
* @param input - Learnosity JSON object
|
|
1455
1460
|
* @param opts - Conversion options
|
|
1456
1461
|
* @returns QTI XML string and diagnostics
|
|
1457
1462
|
*/
|
|
1458
|
-
declare function convertLearnosityToQti(input: unknown, opts: ConversionOptions): Promise<ConversionResult<string>>;
|
|
1463
|
+
export declare function convertLearnosityToQti(input: unknown, opts: ConversionOptions): Promise<ConversionResult<string>>;
|
|
1459
1464
|
//#endregion
|
|
1460
1465
|
//#region src/qti-package/types.d.ts
|
|
1461
1466
|
/**
|
|
@@ -1464,7 +1469,7 @@ declare function convertLearnosityToQti(input: unknown, opts: ConversionOptions)
|
|
|
1464
1469
|
/**
|
|
1465
1470
|
* Metadata about a ZIP entry
|
|
1466
1471
|
*/
|
|
1467
|
-
interface ZipEntryMeta {
|
|
1472
|
+
export interface ZipEntryMeta {
|
|
1468
1473
|
/** Normalized path (forward slashes, relative, no ..) */
|
|
1469
1474
|
file: string;
|
|
1470
1475
|
/** Entry size in bytes */
|
|
@@ -1475,7 +1480,7 @@ interface ZipEntryMeta {
|
|
|
1475
1480
|
/**
|
|
1476
1481
|
* Reference to an assessment item XML file
|
|
1477
1482
|
*/
|
|
1478
|
-
interface AssessmentItemRef {
|
|
1483
|
+
export interface AssessmentItemRef {
|
|
1479
1484
|
/** Unique identifier for this item */
|
|
1480
1485
|
identifier: string;
|
|
1481
1486
|
/** Path to the .xml file */
|
|
@@ -1484,7 +1489,7 @@ interface AssessmentItemRef {
|
|
|
1484
1489
|
/**
|
|
1485
1490
|
* Reference to an asset (image, CSS, etc.)
|
|
1486
1491
|
*/
|
|
1487
|
-
interface AssetRef {
|
|
1492
|
+
export interface AssetRef {
|
|
1488
1493
|
/** Unique identifier for this asset */
|
|
1489
1494
|
identifier: string;
|
|
1490
1495
|
/** Path to the asset file */
|
|
@@ -1495,7 +1500,7 @@ interface AssetRef {
|
|
|
1495
1500
|
/**
|
|
1496
1501
|
* A resource in the manifest
|
|
1497
1502
|
*/
|
|
1498
|
-
interface ManifestResource {
|
|
1503
|
+
export interface ManifestResource {
|
|
1499
1504
|
/** Unique identifier for this resource */
|
|
1500
1505
|
identifier: string;
|
|
1501
1506
|
/** Resource type (e.g., "imsqti_item_xmlv2p2", "webcontent") */
|
|
@@ -1514,7 +1519,7 @@ interface ManifestResource {
|
|
|
1514
1519
|
/**
|
|
1515
1520
|
* Parsed QTI Content Package
|
|
1516
1521
|
*/
|
|
1517
|
-
interface QtiContentPackage {
|
|
1522
|
+
export interface QtiContentPackage {
|
|
1518
1523
|
/** Path to the ZIP file (for diagnostics) */
|
|
1519
1524
|
zipPath: string;
|
|
1520
1525
|
/** QTI version of the package (drives manifest namespaces/schemaLocation). Defaults to 2.2 when absent. */
|
|
@@ -1544,7 +1549,7 @@ interface QtiContentPackage {
|
|
|
1544
1549
|
* @param entryPath Raw path from ZIP entry
|
|
1545
1550
|
* @returns Normalized safe path, or null if unsafe
|
|
1546
1551
|
*/
|
|
1547
|
-
declare function validateZipEntryPath(entryPath: string): string | null;
|
|
1552
|
+
export declare function validateZipEntryPath(entryPath: string): string | null;
|
|
1548
1553
|
/**
|
|
1549
1554
|
* Checks if a path is safe for extraction
|
|
1550
1555
|
*
|
|
@@ -1557,7 +1562,7 @@ declare function isPathSafe$1(entryPath: string): boolean;
|
|
|
1557
1562
|
/**
|
|
1558
1563
|
* Result of parsing a manifest
|
|
1559
1564
|
*/
|
|
1560
|
-
interface ParseManifestResult {
|
|
1565
|
+
export interface ParseManifestResult {
|
|
1561
1566
|
/** Parsed resources */
|
|
1562
1567
|
resources: ManifestResource[];
|
|
1563
1568
|
/** Diagnostics from parsing */
|
|
@@ -1575,7 +1580,7 @@ interface ParseManifestResult {
|
|
|
1575
1580
|
* @param zipPath Path to ZIP (for diagnostics)
|
|
1576
1581
|
* @returns Parsed resources and diagnostics
|
|
1577
1582
|
*/
|
|
1578
|
-
declare function parseManifest(manifestXml: string, zipPath: string): ParseManifestResult;
|
|
1583
|
+
export declare function parseManifest(manifestXml: string, zipPath: string): ParseManifestResult;
|
|
1579
1584
|
//#endregion
|
|
1580
1585
|
//#region src/qti-package/buildManifest.d.ts
|
|
1581
1586
|
/**
|
|
@@ -1594,7 +1599,7 @@ declare function parseManifest(manifestXml: string, zipPath: string): ParseManif
|
|
|
1594
1599
|
* @param version QTI version of the package ('2.1' or '2.2'). Defaults to '2.2'.
|
|
1595
1600
|
* @returns XML string for imsmanifest.xml
|
|
1596
1601
|
*/
|
|
1597
|
-
declare function buildManifest(resources: ManifestResource[], version?: '2.1' | '2.2'): string;
|
|
1602
|
+
export declare function buildManifest(resources: ManifestResource[], version?: '2.1' | '2.2'): string;
|
|
1598
1603
|
//#endregion
|
|
1599
1604
|
//#region src/qti-package/testDependencies.d.ts
|
|
1600
1605
|
/**
|
|
@@ -1604,7 +1609,7 @@ declare function buildManifest(resources: ManifestResource[], version?: '2.1' |
|
|
|
1604
1609
|
/**
|
|
1605
1610
|
* Extract assessmentItemRef and assessmentStimulusRef hrefs from test XML
|
|
1606
1611
|
*/
|
|
1607
|
-
declare function extractTestDependencies(testXml: string): {
|
|
1612
|
+
export declare function extractTestDependencies(testXml: string): {
|
|
1608
1613
|
itemHrefs: string[];
|
|
1609
1614
|
stimulusHrefs: string[];
|
|
1610
1615
|
};
|
|
@@ -1616,13 +1621,13 @@ declare function extractTestDependencies(testXml: string): {
|
|
|
1616
1621
|
* - "stimuli/stimulus_xyz789.xml" -> "stimulus_xyz789"
|
|
1617
1622
|
* - "../../items/abc123.xml" -> "item_abc123"
|
|
1618
1623
|
*/
|
|
1619
|
-
declare function mapHrefToResourceId(href: string): string | null;
|
|
1624
|
+
export declare function mapHrefToResourceId(href: string): string | null;
|
|
1620
1625
|
//#endregion
|
|
1621
1626
|
//#region src/learnosity-model/parseLearnosityItem.d.ts
|
|
1622
1627
|
/**
|
|
1623
1628
|
* Result of parsing a Learnosity item
|
|
1624
1629
|
*/
|
|
1625
|
-
interface ParseLearnosityItemResult {
|
|
1630
|
+
export interface ParseLearnosityItemResult {
|
|
1626
1631
|
model?: LearnosityItemModel;
|
|
1627
1632
|
diagnostics: Diagnostic[];
|
|
1628
1633
|
}
|
|
@@ -1632,7 +1637,7 @@ interface ParseLearnosityItemResult {
|
|
|
1632
1637
|
* @param input Unknown input (should be Learnosity Item JSON)
|
|
1633
1638
|
* @returns Validated model if successful, diagnostics in all cases
|
|
1634
1639
|
*/
|
|
1635
|
-
declare function parseLearnosityItem(input: unknown): ParseLearnosityItemResult;
|
|
1640
|
+
export declare function parseLearnosityItem(input: unknown): ParseLearnosityItemResult;
|
|
1636
1641
|
//#endregion
|
|
1637
1642
|
//#region src/learnosity-bundle/types.d.ts
|
|
1638
1643
|
/**
|
|
@@ -1642,20 +1647,20 @@ declare function parseLearnosityItem(input: unknown): ParseLearnosityItemResult;
|
|
|
1642
1647
|
/**
|
|
1643
1648
|
* Item reference entry in manifest activity
|
|
1644
1649
|
*/
|
|
1645
|
-
interface LearnosityManifestItemRef {
|
|
1650
|
+
export interface LearnosityManifestItemRef {
|
|
1646
1651
|
reference: string;
|
|
1647
1652
|
id?: string;
|
|
1648
1653
|
}
|
|
1649
1654
|
/**
|
|
1650
1655
|
* Activity entry in manifest
|
|
1651
1656
|
*/
|
|
1652
|
-
interface LearnosityManifestActivity {
|
|
1657
|
+
export interface LearnosityManifestActivity {
|
|
1653
1658
|
items: LearnosityManifestItemRef[];
|
|
1654
1659
|
}
|
|
1655
1660
|
/**
|
|
1656
1661
|
* Validated Learnosity manifest model (from manifest.json)
|
|
1657
1662
|
*/
|
|
1658
|
-
interface LearnosityManifestModel {
|
|
1663
|
+
export interface LearnosityManifestModel {
|
|
1659
1664
|
activities: Record<string, LearnosityManifestActivity>;
|
|
1660
1665
|
items?: unknown;
|
|
1661
1666
|
assets?: unknown;
|
|
@@ -1663,14 +1668,14 @@ interface LearnosityManifestModel {
|
|
|
1663
1668
|
/**
|
|
1664
1669
|
* Activity index entry (ordered item references)
|
|
1665
1670
|
*/
|
|
1666
|
-
interface LearnosityActivityIndexEntry {
|
|
1671
|
+
export interface LearnosityActivityIndexEntry {
|
|
1667
1672
|
activityRef: string;
|
|
1668
1673
|
itemRefs: string[];
|
|
1669
1674
|
}
|
|
1670
1675
|
/**
|
|
1671
1676
|
* Complete Learnosity bundle model (manifest + loaded JSON files + indices)
|
|
1672
1677
|
*/
|
|
1673
|
-
interface LearnosityBundleModel {
|
|
1678
|
+
export interface LearnosityBundleModel {
|
|
1674
1679
|
/** Validated manifest model */
|
|
1675
1680
|
manifest: LearnosityManifestModel;
|
|
1676
1681
|
/** All activity references from manifest */
|
|
@@ -1694,11 +1699,11 @@ interface LearnosityBundleModel {
|
|
|
1694
1699
|
/**
|
|
1695
1700
|
* Interaction type
|
|
1696
1701
|
*/
|
|
1697
|
-
type InteractionType = 'choice' | 'textEntry' | 'extendedText' | 'inlineChoice' | 'gapMatch' | 'order' | 'hottext' | 'hotspot' | 'graphicGapMatch' | 'match' | 'upload' | 'drawing' | 'associate';
|
|
1702
|
+
export type InteractionType = 'choice' | 'textEntry' | 'extendedText' | 'inlineChoice' | 'gapMatch' | 'order' | 'hottext' | 'hotspot' | 'graphicGapMatch' | 'match' | 'upload' | 'drawing' | 'associate';
|
|
1698
1703
|
/**
|
|
1699
1704
|
* Choice in a choice interaction
|
|
1700
1705
|
*/
|
|
1701
|
-
interface QtiChoice {
|
|
1706
|
+
export interface QtiChoice {
|
|
1702
1707
|
identifier: string;
|
|
1703
1708
|
content: string;
|
|
1704
1709
|
feedbackBlockIdentifier?: string;
|
|
@@ -1706,7 +1711,7 @@ interface QtiChoice {
|
|
|
1706
1711
|
/**
|
|
1707
1712
|
* Modal feedback (general feedback shown after submission)
|
|
1708
1713
|
*/
|
|
1709
|
-
interface QtiModalFeedback {
|
|
1714
|
+
export interface QtiModalFeedback {
|
|
1710
1715
|
identifier: string;
|
|
1711
1716
|
outcomeIdentifier: string;
|
|
1712
1717
|
showHide: 'show' | 'hide';
|
|
@@ -1715,7 +1720,7 @@ interface QtiModalFeedback {
|
|
|
1715
1720
|
/**
|
|
1716
1721
|
* Block feedback (per-choice feedback)
|
|
1717
1722
|
*/
|
|
1718
|
-
interface QtiFeedbackBlock {
|
|
1723
|
+
export interface QtiFeedbackBlock {
|
|
1719
1724
|
identifier: string;
|
|
1720
1725
|
showHide: 'show' | 'hide';
|
|
1721
1726
|
content: string;
|
|
@@ -1723,20 +1728,20 @@ interface QtiFeedbackBlock {
|
|
|
1723
1728
|
/**
|
|
1724
1729
|
* Correct response for an interaction
|
|
1725
1730
|
*/
|
|
1726
|
-
interface QtiCorrectResponse {
|
|
1731
|
+
export interface QtiCorrectResponse {
|
|
1727
1732
|
values: string[];
|
|
1728
1733
|
}
|
|
1729
1734
|
/**
|
|
1730
1735
|
* Map entry for partial credit scoring
|
|
1731
1736
|
*/
|
|
1732
|
-
interface QtiMapEntry {
|
|
1737
|
+
export interface QtiMapEntry {
|
|
1733
1738
|
mapKey: string;
|
|
1734
1739
|
mappedValue: number;
|
|
1735
1740
|
}
|
|
1736
1741
|
/**
|
|
1737
1742
|
* Mapping for partial credit scoring
|
|
1738
1743
|
*/
|
|
1739
|
-
interface QtiMapping {
|
|
1744
|
+
export interface QtiMapping {
|
|
1740
1745
|
lowerBound: number;
|
|
1741
1746
|
upperBound: number;
|
|
1742
1747
|
defaultValue: number;
|
|
@@ -1745,7 +1750,7 @@ interface QtiMapping {
|
|
|
1745
1750
|
/**
|
|
1746
1751
|
* Choice interaction (MCQ)
|
|
1747
1752
|
*/
|
|
1748
|
-
interface QtiChoiceInteraction {
|
|
1753
|
+
export interface QtiChoiceInteraction {
|
|
1749
1754
|
type: 'choice';
|
|
1750
1755
|
responseIdentifier: string;
|
|
1751
1756
|
prompt?: string;
|
|
@@ -1760,7 +1765,7 @@ interface QtiChoiceInteraction {
|
|
|
1760
1765
|
/**
|
|
1761
1766
|
* Text entry in a text entry interaction (clozetext)
|
|
1762
1767
|
*/
|
|
1763
|
-
interface QtiTextEntry {
|
|
1768
|
+
export interface QtiTextEntry {
|
|
1764
1769
|
responseIdentifier: string;
|
|
1765
1770
|
correctResponse?: string;
|
|
1766
1771
|
correctResponses?: string[];
|
|
@@ -1774,7 +1779,7 @@ interface QtiTextEntry {
|
|
|
1774
1779
|
* - Clozetext mode: template required, multiple textEntries
|
|
1775
1780
|
* - Shorttext mode: prompt required, single entry in textEntries
|
|
1776
1781
|
*/
|
|
1777
|
-
interface QtiTextEntryInteraction {
|
|
1782
|
+
export interface QtiTextEntryInteraction {
|
|
1778
1783
|
type: 'textEntry';
|
|
1779
1784
|
responseIdentifier: string;
|
|
1780
1785
|
prompt?: string;
|
|
@@ -1787,7 +1792,7 @@ interface QtiTextEntryInteraction {
|
|
|
1787
1792
|
/**
|
|
1788
1793
|
* Extended text interaction (essay/long answer)
|
|
1789
1794
|
*/
|
|
1790
|
-
interface QtiExtendedTextInteraction {
|
|
1795
|
+
export interface QtiExtendedTextInteraction {
|
|
1791
1796
|
type: 'extendedText';
|
|
1792
1797
|
responseIdentifier: string;
|
|
1793
1798
|
prompt?: string;
|
|
@@ -1798,14 +1803,14 @@ interface QtiExtendedTextInteraction {
|
|
|
1798
1803
|
/**
|
|
1799
1804
|
* Inline choice (single option in a dropdown)
|
|
1800
1805
|
*/
|
|
1801
|
-
interface QtiInlineChoice {
|
|
1806
|
+
export interface QtiInlineChoice {
|
|
1802
1807
|
identifier: string;
|
|
1803
1808
|
content: string;
|
|
1804
1809
|
}
|
|
1805
1810
|
/**
|
|
1806
1811
|
* Inline choice entry (dropdown with options)
|
|
1807
1812
|
*/
|
|
1808
|
-
interface QtiInlineChoiceEntry {
|
|
1813
|
+
export interface QtiInlineChoiceEntry {
|
|
1809
1814
|
responseIdentifier: string;
|
|
1810
1815
|
shuffle: boolean;
|
|
1811
1816
|
inlineChoices: QtiInlineChoice[];
|
|
@@ -1815,7 +1820,7 @@ interface QtiInlineChoiceEntry {
|
|
|
1815
1820
|
/**
|
|
1816
1821
|
* Inline choice interaction (dropdown in text, clozedropdown)
|
|
1817
1822
|
*/
|
|
1818
|
-
interface QtiInlineChoiceInteraction {
|
|
1823
|
+
export interface QtiInlineChoiceInteraction {
|
|
1819
1824
|
type: 'inlineChoice';
|
|
1820
1825
|
responseIdentifier: string;
|
|
1821
1826
|
prompt?: string;
|
|
@@ -1826,21 +1831,21 @@ interface QtiInlineChoiceInteraction {
|
|
|
1826
1831
|
/**
|
|
1827
1832
|
* Gap text (draggable option for gapMatch)
|
|
1828
1833
|
*/
|
|
1829
|
-
interface QtiGapText {
|
|
1834
|
+
export interface QtiGapText {
|
|
1830
1835
|
identifier: string;
|
|
1831
1836
|
content: string;
|
|
1832
1837
|
}
|
|
1833
1838
|
/**
|
|
1834
1839
|
* Gap entry (drop zone in gapMatch)
|
|
1835
1840
|
*/
|
|
1836
|
-
interface QtiGapEntry {
|
|
1841
|
+
export interface QtiGapEntry {
|
|
1837
1842
|
identifier: string;
|
|
1838
1843
|
correctResponse?: string;
|
|
1839
1844
|
}
|
|
1840
1845
|
/**
|
|
1841
1846
|
* Gap match interaction (drag and drop into gaps, clozeassociation)
|
|
1842
1847
|
*/
|
|
1843
|
-
interface QtiGapMatchInteraction {
|
|
1848
|
+
export interface QtiGapMatchInteraction {
|
|
1844
1849
|
type: 'gapMatch';
|
|
1845
1850
|
responseIdentifier: string;
|
|
1846
1851
|
prompt?: string;
|
|
@@ -1853,7 +1858,7 @@ interface QtiGapMatchInteraction {
|
|
|
1853
1858
|
/**
|
|
1854
1859
|
* Order interaction (ordering/sequencing, orderlist)
|
|
1855
1860
|
*/
|
|
1856
|
-
interface QtiOrderInteraction {
|
|
1861
|
+
export interface QtiOrderInteraction {
|
|
1857
1862
|
type: 'order';
|
|
1858
1863
|
responseIdentifier: string;
|
|
1859
1864
|
prompt?: string;
|
|
@@ -1866,14 +1871,14 @@ interface QtiOrderInteraction {
|
|
|
1866
1871
|
/**
|
|
1867
1872
|
* Hottext element (selectable text region in hottextInteraction)
|
|
1868
1873
|
*/
|
|
1869
|
-
interface QtiHottext {
|
|
1874
|
+
export interface QtiHottext {
|
|
1870
1875
|
identifier: string;
|
|
1871
1876
|
content: string;
|
|
1872
1877
|
}
|
|
1873
1878
|
/**
|
|
1874
1879
|
* Hottext interaction (highlight/select text regions, tokenhighlight)
|
|
1875
1880
|
*/
|
|
1876
|
-
interface QtiHottextInteraction {
|
|
1881
|
+
export interface QtiHottextInteraction {
|
|
1877
1882
|
type: 'hottext';
|
|
1878
1883
|
responseIdentifier: string;
|
|
1879
1884
|
prompt?: string;
|
|
@@ -1886,7 +1891,7 @@ interface QtiHottextInteraction {
|
|
|
1886
1891
|
/**
|
|
1887
1892
|
* Associable hotspot (drop zone in graphicGapMatch)
|
|
1888
1893
|
*/
|
|
1889
|
-
interface QtiAssociableHotspot {
|
|
1894
|
+
export interface QtiAssociableHotspot {
|
|
1890
1895
|
identifier: string;
|
|
1891
1896
|
shape: 'rect' | 'circle' | 'poly' | 'ellipse' | 'default';
|
|
1892
1897
|
coords: string;
|
|
@@ -1895,7 +1900,7 @@ interface QtiAssociableHotspot {
|
|
|
1895
1900
|
/**
|
|
1896
1901
|
* Gap image (draggable image choice in graphicGapMatch)
|
|
1897
1902
|
*/
|
|
1898
|
-
interface QtiGapImg {
|
|
1903
|
+
export interface QtiGapImg {
|
|
1899
1904
|
identifier: string;
|
|
1900
1905
|
objectData: string;
|
|
1901
1906
|
objectType: string;
|
|
@@ -1905,7 +1910,7 @@ interface QtiGapImg {
|
|
|
1905
1910
|
/**
|
|
1906
1911
|
* Directed pair (zone-choice pairing)
|
|
1907
1912
|
*/
|
|
1908
|
-
interface QtiDirectedPair {
|
|
1913
|
+
export interface QtiDirectedPair {
|
|
1909
1914
|
sourceId: string;
|
|
1910
1915
|
targetId: string;
|
|
1911
1916
|
}
|
|
@@ -1915,7 +1920,7 @@ interface QtiDirectedPair {
|
|
|
1915
1920
|
/**
|
|
1916
1921
|
* Hotspot choice (polygon area on image)
|
|
1917
1922
|
*/
|
|
1918
|
-
interface QtiHotspotChoice {
|
|
1923
|
+
export interface QtiHotspotChoice {
|
|
1919
1924
|
identifier: string;
|
|
1920
1925
|
shape: 'poly';
|
|
1921
1926
|
coords: string;
|
|
@@ -1923,7 +1928,7 @@ interface QtiHotspotChoice {
|
|
|
1923
1928
|
/**
|
|
1924
1929
|
* Hotspot interaction (click areas on image)
|
|
1925
1930
|
*/
|
|
1926
|
-
interface QtiHotspotInteraction {
|
|
1931
|
+
export interface QtiHotspotInteraction {
|
|
1927
1932
|
type: 'hotspot';
|
|
1928
1933
|
responseIdentifier: string;
|
|
1929
1934
|
prompt?: string;
|
|
@@ -1940,7 +1945,7 @@ interface QtiHotspotInteraction {
|
|
|
1940
1945
|
/**
|
|
1941
1946
|
* Graphic gap match interaction (drag-and-drop onto image zones)
|
|
1942
1947
|
*/
|
|
1943
|
-
interface QtiGraphicGapMatchInteraction {
|
|
1948
|
+
export interface QtiGraphicGapMatchInteraction {
|
|
1944
1949
|
type: 'graphicGapMatch';
|
|
1945
1950
|
responseIdentifier: string;
|
|
1946
1951
|
prompt?: string;
|
|
@@ -1960,7 +1965,7 @@ interface QtiGraphicGapMatchInteraction {
|
|
|
1960
1965
|
/**
|
|
1961
1966
|
* Outcome declaration (for scoring)
|
|
1962
1967
|
*/
|
|
1963
|
-
interface QtiOutcomeDeclaration {
|
|
1968
|
+
export interface QtiOutcomeDeclaration {
|
|
1964
1969
|
identifier: string;
|
|
1965
1970
|
baseType: 'float' | 'integer' | 'string' | 'boolean';
|
|
1966
1971
|
cardinality: 'single' | 'multiple' | 'ordered';
|
|
@@ -1969,7 +1974,7 @@ interface QtiOutcomeDeclaration {
|
|
|
1969
1974
|
/**
|
|
1970
1975
|
* Simple associable choice (for matchInteraction)
|
|
1971
1976
|
*/
|
|
1972
|
-
interface QtiSimpleAssociableChoice {
|
|
1977
|
+
export interface QtiSimpleAssociableChoice {
|
|
1973
1978
|
identifier: string;
|
|
1974
1979
|
content: string;
|
|
1975
1980
|
matchMax: number;
|
|
@@ -1977,14 +1982,14 @@ interface QtiSimpleAssociableChoice {
|
|
|
1977
1982
|
/**
|
|
1978
1983
|
* Directed pair (source-target association for matchInteraction correctResponse)
|
|
1979
1984
|
*/
|
|
1980
|
-
interface QtiDirectedPairMatch {
|
|
1985
|
+
export interface QtiDirectedPairMatch {
|
|
1981
1986
|
sourceId: string;
|
|
1982
1987
|
targetId: string;
|
|
1983
1988
|
}
|
|
1984
1989
|
/**
|
|
1985
1990
|
* Match interaction (matrix/matching question, choicematrix)
|
|
1986
1991
|
*/
|
|
1987
|
-
interface QtiMatchInteraction {
|
|
1992
|
+
export interface QtiMatchInteraction {
|
|
1988
1993
|
type: 'match';
|
|
1989
1994
|
responseIdentifier: string;
|
|
1990
1995
|
prompt?: string;
|
|
@@ -1997,7 +2002,7 @@ interface QtiMatchInteraction {
|
|
|
1997
2002
|
/**
|
|
1998
2003
|
* Upload interaction (file upload, fileupload)
|
|
1999
2004
|
*/
|
|
2000
|
-
interface QtiUploadInteraction {
|
|
2005
|
+
export interface QtiUploadInteraction {
|
|
2001
2006
|
type: 'upload';
|
|
2002
2007
|
responseIdentifier: string;
|
|
2003
2008
|
prompt?: string;
|
|
@@ -2009,7 +2014,7 @@ interface QtiUploadInteraction {
|
|
|
2009
2014
|
* Associable choice (for associateInteraction)
|
|
2010
2015
|
* Represents both column/category choices and draggable item choices.
|
|
2011
2016
|
*/
|
|
2012
|
-
interface QtiAssociableChoice {
|
|
2017
|
+
export interface QtiAssociableChoice {
|
|
2013
2018
|
identifier: string;
|
|
2014
2019
|
content: string;
|
|
2015
2020
|
matchMax: number;
|
|
@@ -2017,7 +2022,7 @@ interface QtiAssociableChoice {
|
|
|
2017
2022
|
/**
|
|
2018
2023
|
* Associate interaction (drag-and-drop classification, classification)
|
|
2019
2024
|
*/
|
|
2020
|
-
interface QtiAssociateInteraction {
|
|
2025
|
+
export interface QtiAssociateInteraction {
|
|
2021
2026
|
type: 'associate';
|
|
2022
2027
|
responseIdentifier: string;
|
|
2023
2028
|
prompt?: string;
|
|
@@ -2032,7 +2037,7 @@ interface QtiAssociateInteraction {
|
|
|
2032
2037
|
/**
|
|
2033
2038
|
* Drawing interaction (freehand drawing, drawing)
|
|
2034
2039
|
*/
|
|
2035
|
-
interface QtiDrawingInteraction {
|
|
2040
|
+
export interface QtiDrawingInteraction {
|
|
2036
2041
|
type: 'drawing';
|
|
2037
2042
|
responseIdentifier: string;
|
|
2038
2043
|
prompt?: string;
|
|
@@ -2049,11 +2054,11 @@ interface QtiDrawingInteraction {
|
|
|
2049
2054
|
/**
|
|
2050
2055
|
* Union type for all interactions
|
|
2051
2056
|
*/
|
|
2052
|
-
type QtiInteraction = QtiChoiceInteraction | QtiTextEntryInteraction | QtiExtendedTextInteraction | QtiInlineChoiceInteraction | QtiGapMatchInteraction | QtiOrderInteraction | QtiHottextInteraction | QtiHotspotInteraction | QtiGraphicGapMatchInteraction | QtiMatchInteraction | QtiUploadInteraction | QtiDrawingInteraction | QtiAssociateInteraction;
|
|
2057
|
+
export type QtiInteraction = QtiChoiceInteraction | QtiTextEntryInteraction | QtiExtendedTextInteraction | QtiInlineChoiceInteraction | QtiGapMatchInteraction | QtiOrderInteraction | QtiHottextInteraction | QtiHotspotInteraction | QtiGraphicGapMatchInteraction | QtiMatchInteraction | QtiUploadInteraction | QtiDrawingInteraction | QtiAssociateInteraction;
|
|
2053
2058
|
/**
|
|
2054
2059
|
* Widget reference for layout (question or feature)
|
|
2055
2060
|
*/
|
|
2056
|
-
interface QtiLayoutWidget {
|
|
2061
|
+
export interface QtiLayoutWidget {
|
|
2057
2062
|
kind: 'question' | 'feature';
|
|
2058
2063
|
ref: string;
|
|
2059
2064
|
interaction?: QtiInteraction;
|
|
@@ -2062,39 +2067,39 @@ interface QtiLayoutWidget {
|
|
|
2062
2067
|
/**
|
|
2063
2068
|
* Column in a multi-column layout
|
|
2064
2069
|
*/
|
|
2065
|
-
interface QtiLayoutColumn {
|
|
2070
|
+
export interface QtiLayoutColumn {
|
|
2066
2071
|
index: 1 | 2;
|
|
2067
2072
|
widgets: QtiLayoutWidget[];
|
|
2068
2073
|
}
|
|
2069
2074
|
/**
|
|
2070
2075
|
* Item layout structure
|
|
2071
2076
|
*/
|
|
2072
|
-
interface QtiLayout {
|
|
2077
|
+
export interface QtiLayout {
|
|
2073
2078
|
columns: QtiLayoutColumn[];
|
|
2074
2079
|
contentHtml: string;
|
|
2075
2080
|
}
|
|
2076
2081
|
/**
|
|
2077
2082
|
* LOM classification for a tag type
|
|
2078
2083
|
*/
|
|
2079
|
-
interface QtiLomClassification {
|
|
2084
|
+
export interface QtiLomClassification {
|
|
2080
2085
|
tagType: string;
|
|
2081
2086
|
tagNames: string[];
|
|
2082
2087
|
}
|
|
2083
2088
|
/**
|
|
2084
2089
|
* LOM metadata for an assessment item
|
|
2085
2090
|
*/
|
|
2086
|
-
interface QtiLomMetadata {
|
|
2091
|
+
export interface QtiLomMetadata {
|
|
2087
2092
|
identifier: string;
|
|
2088
2093
|
classifications: QtiLomClassification[];
|
|
2089
2094
|
}
|
|
2090
2095
|
/**
|
|
2091
2096
|
* Response processing strategy
|
|
2092
2097
|
*/
|
|
2093
|
-
type ResponseProcessingStrategy = 'template' | 'ruleGroup';
|
|
2098
|
+
export type ResponseProcessingStrategy = 'template' | 'ruleGroup';
|
|
2094
2099
|
/**
|
|
2095
2100
|
* Response processing configuration
|
|
2096
2101
|
*/
|
|
2097
|
-
interface QtiResponseProcessing {
|
|
2102
|
+
export interface QtiResponseProcessing {
|
|
2098
2103
|
strategy: ResponseProcessingStrategy;
|
|
2099
2104
|
templateUrl?: string;
|
|
2100
2105
|
ruleGroups?: QtiResponseCondition[];
|
|
@@ -2103,7 +2108,7 @@ interface QtiResponseProcessing {
|
|
|
2103
2108
|
/**
|
|
2104
2109
|
* Response condition (if/elseif/else structure)
|
|
2105
2110
|
*/
|
|
2106
|
-
interface QtiResponseCondition {
|
|
2111
|
+
export interface QtiResponseCondition {
|
|
2107
2112
|
responseIf: QtiResponseIf;
|
|
2108
2113
|
responseElseIf?: QtiResponseElseIf[];
|
|
2109
2114
|
responseElse?: QtiResponseElse;
|
|
@@ -2111,31 +2116,31 @@ interface QtiResponseCondition {
|
|
|
2111
2116
|
/**
|
|
2112
2117
|
* Response if block
|
|
2113
2118
|
*/
|
|
2114
|
-
interface QtiResponseIf {
|
|
2119
|
+
export interface QtiResponseIf {
|
|
2115
2120
|
condition: QtiExpression;
|
|
2116
2121
|
actions: QtiAction[];
|
|
2117
2122
|
}
|
|
2118
2123
|
/**
|
|
2119
2124
|
* Response else-if block
|
|
2120
2125
|
*/
|
|
2121
|
-
interface QtiResponseElseIf {
|
|
2126
|
+
export interface QtiResponseElseIf {
|
|
2122
2127
|
condition: QtiExpression;
|
|
2123
2128
|
actions: QtiAction[];
|
|
2124
2129
|
}
|
|
2125
2130
|
/**
|
|
2126
2131
|
* Response else block
|
|
2127
2132
|
*/
|
|
2128
|
-
interface QtiResponseElse {
|
|
2133
|
+
export interface QtiResponseElse {
|
|
2129
2134
|
actions: QtiAction[];
|
|
2130
2135
|
}
|
|
2131
2136
|
/**
|
|
2132
2137
|
* QTI expression (for conditions)
|
|
2133
2138
|
*/
|
|
2134
|
-
type QtiExpression = QtiStringMatch | QtiVariable | QtiCorrect | QtiBaseValue | QtiSubtract | QtiMax;
|
|
2139
|
+
export type QtiExpression = QtiStringMatch | QtiVariable | QtiCorrect | QtiBaseValue | QtiSubtract | QtiMax;
|
|
2135
2140
|
/**
|
|
2136
2141
|
* String match expression
|
|
2137
2142
|
*/
|
|
2138
|
-
interface QtiStringMatch {
|
|
2143
|
+
export interface QtiStringMatch {
|
|
2139
2144
|
type: 'stringMatch';
|
|
2140
2145
|
caseSensitive: boolean;
|
|
2141
2146
|
variable: string;
|
|
@@ -2144,21 +2149,21 @@ interface QtiStringMatch {
|
|
|
2144
2149
|
/**
|
|
2145
2150
|
* Variable reference
|
|
2146
2151
|
*/
|
|
2147
|
-
interface QtiVariable {
|
|
2152
|
+
export interface QtiVariable {
|
|
2148
2153
|
type: 'variable';
|
|
2149
2154
|
identifier: string;
|
|
2150
2155
|
}
|
|
2151
2156
|
/**
|
|
2152
2157
|
* Correct response reference
|
|
2153
2158
|
*/
|
|
2154
|
-
interface QtiCorrect {
|
|
2159
|
+
export interface QtiCorrect {
|
|
2155
2160
|
type: 'correct';
|
|
2156
2161
|
identifier: string;
|
|
2157
2162
|
}
|
|
2158
2163
|
/**
|
|
2159
2164
|
* Base value (literal)
|
|
2160
2165
|
*/
|
|
2161
|
-
interface QtiBaseValue {
|
|
2166
|
+
export interface QtiBaseValue {
|
|
2162
2167
|
type: 'baseValue';
|
|
2163
2168
|
baseType: 'float' | 'integer' | 'string' | 'boolean';
|
|
2164
2169
|
value: string | number | boolean;
|
|
@@ -2166,25 +2171,25 @@ interface QtiBaseValue {
|
|
|
2166
2171
|
/**
|
|
2167
2172
|
* Subtract expression
|
|
2168
2173
|
*/
|
|
2169
|
-
interface QtiSubtract {
|
|
2174
|
+
export interface QtiSubtract {
|
|
2170
2175
|
type: 'subtract';
|
|
2171
2176
|
operands: [QtiExpression, QtiExpression];
|
|
2172
2177
|
}
|
|
2173
2178
|
/**
|
|
2174
2179
|
* Max expression
|
|
2175
2180
|
*/
|
|
2176
|
-
interface QtiMax {
|
|
2181
|
+
export interface QtiMax {
|
|
2177
2182
|
type: 'max';
|
|
2178
2183
|
operands: QtiExpression[];
|
|
2179
2184
|
}
|
|
2180
2185
|
/**
|
|
2181
2186
|
* QTI action (outcome updates)
|
|
2182
2187
|
*/
|
|
2183
|
-
type QtiAction = QtiSetOutcomeValue;
|
|
2188
|
+
export type QtiAction = QtiSetOutcomeValue;
|
|
2184
2189
|
/**
|
|
2185
2190
|
* Set outcome value action
|
|
2186
2191
|
*/
|
|
2187
|
-
interface QtiSetOutcomeValue {
|
|
2192
|
+
export interface QtiSetOutcomeValue {
|
|
2188
2193
|
type: 'setOutcomeValue';
|
|
2189
2194
|
identifier: string;
|
|
2190
2195
|
expression: QtiExpression;
|
|
@@ -2192,7 +2197,7 @@ interface QtiSetOutcomeValue {
|
|
|
2192
2197
|
/**
|
|
2193
2198
|
* Assessment item AST
|
|
2194
2199
|
*/
|
|
2195
|
-
interface QtiAssessmentItem {
|
|
2200
|
+
export interface QtiAssessmentItem {
|
|
2196
2201
|
identifier: string;
|
|
2197
2202
|
title?: string;
|
|
2198
2203
|
adaptive: boolean;
|
|
@@ -2214,7 +2219,7 @@ interface QtiAssessmentItem {
|
|
|
2214
2219
|
* Assessment stimulus AST (QTI 2.2 shared stimulus)
|
|
2215
2220
|
* Used for sharedpassage features
|
|
2216
2221
|
*/
|
|
2217
|
-
interface QtiAssessmentStimulus {
|
|
2222
|
+
export interface QtiAssessmentStimulus {
|
|
2218
2223
|
identifier: string;
|
|
2219
2224
|
title?: string;
|
|
2220
2225
|
instructorStimulus?: string;
|
|
@@ -2230,7 +2235,7 @@ interface QtiAssessmentStimulus {
|
|
|
2230
2235
|
/**
|
|
2231
2236
|
* Reference to an assessmentItem in the test
|
|
2232
2237
|
*/
|
|
2233
|
-
interface QtiItemRef {
|
|
2238
|
+
export interface QtiItemRef {
|
|
2234
2239
|
/** Unique identifier for this item reference */
|
|
2235
2240
|
identifier: string;
|
|
2236
2241
|
/** Relative path to the assessmentItem XML file */
|
|
@@ -2239,7 +2244,7 @@ interface QtiItemRef {
|
|
|
2239
2244
|
/**
|
|
2240
2245
|
* Selection constraints for random item selection within a section
|
|
2241
2246
|
*/
|
|
2242
|
-
interface QtiSelection {
|
|
2247
|
+
export interface QtiSelection {
|
|
2243
2248
|
/** Number of items to select */
|
|
2244
2249
|
select: number;
|
|
2245
2250
|
/** Whether to allow selecting the same item multiple times */
|
|
@@ -2248,7 +2253,7 @@ interface QtiSelection {
|
|
|
2248
2253
|
/**
|
|
2249
2254
|
* A section within a test part containing item references
|
|
2250
2255
|
*/
|
|
2251
|
-
interface QtiAssessmentSection {
|
|
2256
|
+
export interface QtiAssessmentSection {
|
|
2252
2257
|
/** Unique identifier for this section */
|
|
2253
2258
|
identifier: string;
|
|
2254
2259
|
/** Human-readable title */
|
|
@@ -2267,7 +2272,7 @@ interface QtiAssessmentSection {
|
|
|
2267
2272
|
/**
|
|
2268
2273
|
* A part of an assessment test
|
|
2269
2274
|
*/
|
|
2270
|
-
interface QtiTestPart {
|
|
2275
|
+
export interface QtiTestPart {
|
|
2271
2276
|
/** Unique identifier for this test part */
|
|
2272
2277
|
identifier: string;
|
|
2273
2278
|
/** Navigation mode (linear or nonlinear) */
|
|
@@ -2280,7 +2285,7 @@ interface QtiTestPart {
|
|
|
2280
2285
|
/**
|
|
2281
2286
|
* Time limits for an assessment test
|
|
2282
2287
|
*/
|
|
2283
|
-
interface QtiTimeLimits {
|
|
2288
|
+
export interface QtiTimeLimits {
|
|
2284
2289
|
/** Maximum time allowed in seconds */
|
|
2285
2290
|
maxTime: number;
|
|
2286
2291
|
/** Whether late submission is allowed after time expires */
|
|
@@ -2289,7 +2294,7 @@ interface QtiTimeLimits {
|
|
|
2289
2294
|
/**
|
|
2290
2295
|
* QTI 2.2 assessmentTest structure
|
|
2291
2296
|
*/
|
|
2292
|
-
interface QtiAssessmentTest {
|
|
2297
|
+
export interface QtiAssessmentTest {
|
|
2293
2298
|
/** Unique identifier for the test */
|
|
2294
2299
|
identifier: string;
|
|
2295
2300
|
/** Human-readable title */
|
|
@@ -2301,7 +2306,7 @@ interface QtiAssessmentTest {
|
|
|
2301
2306
|
}
|
|
2302
2307
|
//#endregion
|
|
2303
2308
|
//#region src/qti-ast/downgradeToQti21.d.ts
|
|
2304
|
-
interface DowngradeResult<T> {
|
|
2309
|
+
export interface DowngradeResult<T> {
|
|
2305
2310
|
/** Downgraded AST (modified in place or cloned) */
|
|
2306
2311
|
ast: T;
|
|
2307
2312
|
/** Diagnostics about lossy conversions */
|
|
@@ -2318,14 +2323,14 @@ interface DowngradeResult<T> {
|
|
|
2318
2323
|
* @param item - QTI 2.2 assessmentItem AST
|
|
2319
2324
|
* @returns { downgraded item, diagnostics }
|
|
2320
2325
|
*/
|
|
2321
|
-
declare function downgradeAssessmentItemToQti21(item: QtiAssessmentItem): DowngradeResult<QtiAssessmentItem>;
|
|
2326
|
+
export declare function downgradeAssessmentItemToQti21(item: QtiAssessmentItem): DowngradeResult<QtiAssessmentItem>;
|
|
2322
2327
|
/**
|
|
2323
2328
|
* Downgrade QTI 2.2 assessmentTest to QTI 2.1
|
|
2324
2329
|
*
|
|
2325
2330
|
* @param test - QTI 2.2 assessmentTest AST
|
|
2326
2331
|
* @returns { downgraded test, diagnostics }
|
|
2327
2332
|
*/
|
|
2328
|
-
declare function downgradeAssessmentTestToQti21(test: QtiAssessmentTest): DowngradeResult<QtiAssessmentTest>;
|
|
2333
|
+
export declare function downgradeAssessmentTestToQti21(test: QtiAssessmentTest): DowngradeResult<QtiAssessmentTest>;
|
|
2329
2334
|
//#endregion
|
|
2330
2335
|
//#region src/learnosity-mapper/mapLearnosityToAst.d.ts
|
|
2331
2336
|
/**
|
|
@@ -2334,27 +2339,27 @@ declare function downgradeAssessmentTestToQti21(test: QtiAssessmentTest): Downgr
|
|
|
2334
2339
|
* @param model - Validated Learnosity Item Model
|
|
2335
2340
|
* @returns { ast?, diagnostics[] }
|
|
2336
2341
|
*/
|
|
2337
|
-
declare function mapLearnosityToAst(model: LearnosityItemModel | null | undefined): {
|
|
2342
|
+
export declare function mapLearnosityToAst(model: LearnosityItemModel | null | undefined): {
|
|
2338
2343
|
ast?: QtiAssessmentItem;
|
|
2339
2344
|
diagnostics: Diagnostic[];
|
|
2340
2345
|
};
|
|
2341
2346
|
//#endregion
|
|
2342
2347
|
//#region src/learnosity-mapper/mapActivityToTest.d.ts
|
|
2343
|
-
interface MapActivityToTestResult {
|
|
2348
|
+
export interface MapActivityToTestResult {
|
|
2344
2349
|
test?: QtiAssessmentTest;
|
|
2345
2350
|
diagnostics: Diagnostic[];
|
|
2346
2351
|
}
|
|
2347
2352
|
/**
|
|
2348
2353
|
* Learnosity section configuration for navigation
|
|
2349
2354
|
*/
|
|
2350
|
-
interface LearnositySectionNavigation {
|
|
2355
|
+
export interface LearnositySectionNavigation {
|
|
2351
2356
|
/** Whether backward navigation is allowed (true = nonlinear, false = linear) */
|
|
2352
2357
|
allowBackward?: boolean;
|
|
2353
2358
|
}
|
|
2354
2359
|
/**
|
|
2355
2360
|
* Learnosity section configuration for time limits
|
|
2356
2361
|
*/
|
|
2357
|
-
interface LearnositySectionTime {
|
|
2362
|
+
export interface LearnositySectionTime {
|
|
2358
2363
|
/** Maximum time in seconds */
|
|
2359
2364
|
maxTime?: number;
|
|
2360
2365
|
/** Time limit type (hard or soft) - maps to allowLateSubmission */
|
|
@@ -2363,7 +2368,7 @@ interface LearnositySectionTime {
|
|
|
2363
2368
|
/**
|
|
2364
2369
|
* Learnosity section configuration
|
|
2365
2370
|
*/
|
|
2366
|
-
interface LearnositySectionConfig {
|
|
2371
|
+
export interface LearnositySectionConfig {
|
|
2367
2372
|
/** Navigation settings */
|
|
2368
2373
|
navigation?: LearnositySectionNavigation;
|
|
2369
2374
|
/** Time limit settings */
|
|
@@ -2374,13 +2379,13 @@ interface LearnositySectionConfig {
|
|
|
2374
2379
|
/**
|
|
2375
2380
|
* A section within a Learnosity activity
|
|
2376
2381
|
*/
|
|
2377
|
-
interface LearnositySection {
|
|
2382
|
+
export interface LearnositySection {
|
|
2378
2383
|
/** Ordered list of item references in this section */
|
|
2379
2384
|
items: string[];
|
|
2380
2385
|
/** Optional section configuration */
|
|
2381
2386
|
config?: LearnositySectionConfig;
|
|
2382
2387
|
}
|
|
2383
|
-
interface ActivityData {
|
|
2388
|
+
export interface ActivityData {
|
|
2384
2389
|
/** Activity reference/identifier */
|
|
2385
2390
|
reference: string;
|
|
2386
2391
|
/** Optional title (deprecated - use data.config.title instead) */
|
|
@@ -2408,10 +2413,10 @@ interface ActivityData {
|
|
|
2408
2413
|
* @param activity - Activity data with reference and item list or sections
|
|
2409
2414
|
* @returns { test?, diagnostics[] }
|
|
2410
2415
|
*/
|
|
2411
|
-
declare function mapActivityToTest(activity: ActivityData): MapActivityToTestResult;
|
|
2416
|
+
export declare function mapActivityToTest(activity: ActivityData): MapActivityToTestResult;
|
|
2412
2417
|
//#endregion
|
|
2413
2418
|
//#region src/learnosity-mapper/convertActivity.d.ts
|
|
2414
|
-
interface ConvertedItem {
|
|
2419
|
+
export interface ConvertedItem {
|
|
2415
2420
|
/** Item reference from Learnosity */
|
|
2416
2421
|
reference: string;
|
|
2417
2422
|
/** QTI XML content */
|
|
@@ -2421,7 +2426,7 @@ interface ConvertedItem {
|
|
|
2421
2426
|
/** Diagnostics from this item's conversion */
|
|
2422
2427
|
diagnostics: Diagnostic[];
|
|
2423
2428
|
}
|
|
2424
|
-
interface ConvertActivityResult {
|
|
2429
|
+
export interface ConvertActivityResult {
|
|
2425
2430
|
/** Generated assessmentTest XML */
|
|
2426
2431
|
testXml?: string;
|
|
2427
2432
|
/** QTI assessmentTest AST */
|
|
@@ -2436,7 +2441,7 @@ interface ConvertActivityResult {
|
|
|
2436
2441
|
/** All diagnostics from conversion */
|
|
2437
2442
|
diagnostics: Diagnostic[];
|
|
2438
2443
|
}
|
|
2439
|
-
interface ConvertActivityOptions {
|
|
2444
|
+
export interface ConvertActivityOptions {
|
|
2440
2445
|
/** Format XML with newlines and indentation */
|
|
2441
2446
|
pretty?: boolean;
|
|
2442
2447
|
/** QTI version (2.1 or 2.2) */
|
|
@@ -2456,7 +2461,7 @@ interface ConvertActivityOptions {
|
|
|
2456
2461
|
* @param options - Conversion options
|
|
2457
2462
|
* @returns { testXml?, test?, items[], diagnostics[] }
|
|
2458
2463
|
*/
|
|
2459
|
-
declare function convertActivity(bundle: LearnosityBundleModel, activityRef: string, options?: ConvertActivityOptions): ConvertActivityResult;
|
|
2464
|
+
export declare function convertActivity(bundle: LearnosityBundleModel, activityRef: string, options?: ConvertActivityOptions): ConvertActivityResult;
|
|
2460
2465
|
//#endregion
|
|
2461
2466
|
//#region src/learnosity-mapper/sanitizeFolderName.d.ts
|
|
2462
2467
|
/**
|
|
@@ -2476,7 +2481,7 @@ declare function convertActivity(bundle: LearnosityBundleModel, activityRef: str
|
|
|
2476
2481
|
* @param fallback - Fallback value if sanitization produces empty string
|
|
2477
2482
|
* @returns Sanitized folder name
|
|
2478
2483
|
*/
|
|
2479
|
-
declare function sanitizeFolderName(input: string, fallback?: string): string;
|
|
2484
|
+
export declare function sanitizeFolderName(input: string, fallback?: string): string;
|
|
2480
2485
|
/**
|
|
2481
2486
|
* Ensure folder name uniqueness by tracking used names
|
|
2482
2487
|
*
|
|
@@ -2484,7 +2489,7 @@ declare function sanitizeFolderName(input: string, fallback?: string): string;
|
|
|
2484
2489
|
* @param usedNames - Set of already-used folder names
|
|
2485
2490
|
* @returns Unique folder name (may have suffix like _2, _3)
|
|
2486
2491
|
*/
|
|
2487
|
-
declare function ensureUniqueFolderName(desiredName: string, usedNames: Set<string>): string;
|
|
2492
|
+
export declare function ensureUniqueFolderName(desiredName: string, usedNames: Set<string>): string;
|
|
2488
2493
|
//#endregion
|
|
2489
2494
|
//#region src/learnosity-mapper/buildPackageFromActivityTypes.d.ts
|
|
2490
2495
|
interface BuildPackageFromActivityOptions {
|
|
@@ -2505,7 +2510,7 @@ interface BuildPackageFromActivityResult {
|
|
|
2505
2510
|
* Rewrite item/stimulus/asset hrefs inside an assessmentTest that has been moved
|
|
2506
2511
|
* into tests/<folderName>/ (two levels deep) so they resolve against the package root.
|
|
2507
2512
|
*/
|
|
2508
|
-
declare function rewriteTestHrefs(testXml: string): string;
|
|
2513
|
+
export declare function rewriteTestHrefs(testXml: string): string;
|
|
2509
2514
|
/**
|
|
2510
2515
|
* Merge one activity's package (`packageResult`) into the combined `pkg`.
|
|
2511
2516
|
*
|
|
@@ -2514,7 +2519,7 @@ declare function rewriteTestHrefs(testXml: string): string;
|
|
|
2514
2519
|
* (normalize CSS first, then stimulus then item resources). Item resources gain a
|
|
2515
2520
|
* dependency on the normalize CSS. Duplicate resources (by identifier) are skipped.
|
|
2516
2521
|
*/
|
|
2517
|
-
declare function mergeActivityPackage(pkg: QtiContentPackage, folderName: string, packageResult: BuildPackageFromActivityResult, addedResourceIds: Set<string>): void;
|
|
2522
|
+
export declare function mergeActivityPackage(pkg: QtiContentPackage, folderName: string, packageResult: BuildPackageFromActivityResult, addedResourceIds: Set<string>): void;
|
|
2518
2523
|
//#endregion
|
|
2519
2524
|
//#region src/qti-serializer/serializeAssessmentItem.d.ts
|
|
2520
2525
|
/**
|
|
@@ -2524,7 +2529,7 @@ declare function mergeActivityPackage(pkg: QtiContentPackage, folderName: string
|
|
|
2524
2529
|
* @param options - Serialization options
|
|
2525
2530
|
* @returns { xml?, diagnostics[] }
|
|
2526
2531
|
*/
|
|
2527
|
-
declare function serializeAssessmentItem(ast: QtiAssessmentItem, options?: {
|
|
2532
|
+
export declare function serializeAssessmentItem(ast: QtiAssessmentItem, options?: {
|
|
2528
2533
|
pretty?: boolean;
|
|
2529
2534
|
version?: QtiVersion;
|
|
2530
2535
|
}): {
|
|
@@ -2533,13 +2538,13 @@ declare function serializeAssessmentItem(ast: QtiAssessmentItem, options?: {
|
|
|
2533
2538
|
};
|
|
2534
2539
|
//#endregion
|
|
2535
2540
|
//#region src/qti-serializer/serializeAssessmentTest.d.ts
|
|
2536
|
-
interface SerializeTestOptions {
|
|
2541
|
+
export interface SerializeTestOptions {
|
|
2537
2542
|
/** Format with newlines and indentation */
|
|
2538
2543
|
pretty?: boolean;
|
|
2539
2544
|
/** QTI version (2.1 or 2.2) */
|
|
2540
2545
|
version?: QtiVersion;
|
|
2541
2546
|
}
|
|
2542
|
-
interface SerializeTestResult {
|
|
2547
|
+
export interface SerializeTestResult {
|
|
2543
2548
|
xml?: string;
|
|
2544
2549
|
diagnostics: Diagnostic[];
|
|
2545
2550
|
}
|
|
@@ -2550,7 +2555,7 @@ interface SerializeTestResult {
|
|
|
2550
2555
|
* @param options - Serialization options
|
|
2551
2556
|
* @returns { xml?, diagnostics[] }
|
|
2552
2557
|
*/
|
|
2553
|
-
declare function serializeAssessmentTest(test: QtiAssessmentTest, options?: SerializeTestOptions): SerializeTestResult;
|
|
2558
|
+
export declare function serializeAssessmentTest(test: QtiAssessmentTest, options?: SerializeTestOptions): SerializeTestResult;
|
|
2554
2559
|
//#endregion
|
|
2555
2560
|
//#region src/qti-to-learnosity/convertShared.d.ts
|
|
2556
2561
|
/**
|
|
@@ -2569,6 +2574,12 @@ interface ConvertOptions {
|
|
|
2569
2574
|
organisationId?: number;
|
|
2570
2575
|
mediaVault?: boolean;
|
|
2571
2576
|
customAssetUrl?: string;
|
|
2577
|
+
/** Preserve original QTI asset basenames instead of using hashed names (default: false). */
|
|
2578
|
+
preserveAssetFilenames?: boolean;
|
|
2579
|
+
/** Final, disambiguated item reference used for item-scoped asset names. */
|
|
2580
|
+
finalItemReference?: string;
|
|
2581
|
+
/** Package-relative source item href used to resolve relative asset URLs. */
|
|
2582
|
+
sourceHrefBase?: string;
|
|
2572
2583
|
itemReferenceSource?: ItemReferenceSource;
|
|
2573
2584
|
truncateTags?: boolean;
|
|
2574
2585
|
fileAccess?: FileAccess;
|
|
@@ -2578,7 +2589,7 @@ interface ConvertOptions {
|
|
|
2578
2589
|
* Convert QTI assessmentItem XML to Learnosity Item JSON
|
|
2579
2590
|
* Supports choiceInteraction (MCQ), textEntryInteraction (clozetext), extendedTextInteraction (longtextV2), matchInteraction (choicematrix), gapMatchInteraction (clozeassociation), inlineChoiceInteraction (clozedropdown), orderInteraction (orderlist), hotspotInteraction (hotspot), hottextInteraction (tokenhighlight), associateInteraction (classification)
|
|
2580
2591
|
*/
|
|
2581
|
-
declare function convertQtiAssessmentItemToLearnosity(inputXml: string, opts?: ConvertOptions): ConvertResult$1;
|
|
2592
|
+
export declare function convertQtiAssessmentItemToLearnosity(inputXml: string, opts?: ConvertOptions): ConvertResult$1;
|
|
2582
2593
|
//#endregion
|
|
2583
2594
|
//#region src/qti-to-learnosity/convertAssessmentTestToActivity.d.ts
|
|
2584
2595
|
type LearnosityActivityJson = {
|
|
@@ -2603,7 +2614,7 @@ interface ConvertResult {
|
|
|
2603
2614
|
* Convert QTI assessmentTest XML to Learnosity Activity JSON
|
|
2604
2615
|
* Supports simple linear tests only (v1)
|
|
2605
2616
|
*/
|
|
2606
|
-
declare function convertAssessmentTestToLearnosityActivity(inputXml: string): ConvertResult;
|
|
2617
|
+
export declare function convertAssessmentTestToLearnosityActivity(inputXml: string): ConvertResult;
|
|
2607
2618
|
//#endregion
|
|
2608
2619
|
//#region src/qti-to-learnosity/convertQtiPackageToLearnosityBundle.d.ts
|
|
2609
2620
|
/** A package entry (ZIP or directory) with raw bytes. Buffer satisfies this too. */
|
|
@@ -2617,6 +2628,8 @@ interface ConvertQtiPackageToLearnosityBundleOptions {
|
|
|
2617
2628
|
organisationId?: number;
|
|
2618
2629
|
mediaVault?: boolean;
|
|
2619
2630
|
customAssetUrl?: string;
|
|
2631
|
+
/** Preserve original QTI asset basenames instead of using hashed names (default: false). */
|
|
2632
|
+
preserveAssetFilenames?: boolean;
|
|
2620
2633
|
itemReferenceSource?: ItemReferenceSource;
|
|
2621
2634
|
itemFilenameSource?: ItemFilenameSource;
|
|
2622
2635
|
packageVersion?: string;
|
|
@@ -2644,14 +2657,14 @@ interface ConvertQtiPackageToLearnosityBundleResult {
|
|
|
2644
2657
|
/**
|
|
2645
2658
|
* Convert QTI Content Package to Learnosity Bundle
|
|
2646
2659
|
*/
|
|
2647
|
-
declare function convertQtiPackageToLearnosityBundle(input: {
|
|
2660
|
+
export declare function convertQtiPackageToLearnosityBundle(input: {
|
|
2648
2661
|
zipBytes: Uint8Array;
|
|
2649
2662
|
} | {
|
|
2650
2663
|
entries: ReadonlyMap<string, PackageEntry>;
|
|
2651
2664
|
}, opts?: ConvertQtiPackageToLearnosityBundleOptions): ConvertQtiPackageToLearnosityBundleResult;
|
|
2652
2665
|
//#endregion
|
|
2653
2666
|
//#region src/qti-to-learnosity/nodeFileAccess.d.ts
|
|
2654
|
-
declare const nodeFileAccess: FileAccess;
|
|
2667
|
+
export declare const nodeFileAccess: FileAccess;
|
|
2655
2668
|
//#endregion
|
|
2656
2669
|
//#region src/qti-package/readZip.d.ts
|
|
2657
2670
|
/**
|
|
@@ -2674,7 +2687,7 @@ interface ReadZipResult {
|
|
|
2674
2687
|
* @param zipPath Path to the ZIP file
|
|
2675
2688
|
* @returns Map of safe entries and diagnostics
|
|
2676
2689
|
*/
|
|
2677
|
-
declare function readZip(zipPath: string): ReadZipResult;
|
|
2690
|
+
export declare function readZip(zipPath: string): ReadZipResult;
|
|
2678
2691
|
//#endregion
|
|
2679
2692
|
//#region src/qti-package/writeZip.d.ts
|
|
2680
2693
|
/**
|
|
@@ -2704,7 +2717,7 @@ interface ZipFileEntry {
|
|
|
2704
2717
|
* @param zipPath Output ZIP file path
|
|
2705
2718
|
* @param files Array of files to include
|
|
2706
2719
|
*/
|
|
2707
|
-
declare function writeZip(zipPath: string, files: ZipFileEntry[]): void;
|
|
2720
|
+
export declare function writeZip(zipPath: string, files: ZipFileEntry[]): void;
|
|
2708
2721
|
//#endregion
|
|
2709
2722
|
//#region src/qti-package/loadPackage.d.ts
|
|
2710
2723
|
/**
|
|
@@ -2728,7 +2741,7 @@ interface LoadPackageResult {
|
|
|
2728
2741
|
* @param zipPath Path to the ZIP file
|
|
2729
2742
|
* @returns Loaded package and diagnostics
|
|
2730
2743
|
*/
|
|
2731
|
-
declare function loadQtiContentPackage(zipPath: string): LoadPackageResult;
|
|
2744
|
+
export declare function loadQtiContentPackage(zipPath: string): LoadPackageResult;
|
|
2732
2745
|
//#endregion
|
|
2733
2746
|
//#region src/qti-package/savePackage.d.ts
|
|
2734
2747
|
/**
|
|
@@ -2750,7 +2763,7 @@ interface SavePackageResult {
|
|
|
2750
2763
|
* @param outputPath Output ZIP file path or directory path
|
|
2751
2764
|
* @returns Diagnostics from saving
|
|
2752
2765
|
*/
|
|
2753
|
-
declare function saveQtiContentPackage(pkg: QtiContentPackage, outputPath: string): SavePackageResult;
|
|
2766
|
+
export declare function saveQtiContentPackage(pkg: QtiContentPackage, outputPath: string): SavePackageResult;
|
|
2754
2767
|
//#endregion
|
|
2755
2768
|
//#region src/learnosity-bundle/loadLearnosityBundle.d.ts
|
|
2756
2769
|
/**
|
|
@@ -2759,7 +2772,7 @@ declare function saveQtiContentPackage(pkg: QtiContentPackage, outputPath: strin
|
|
|
2759
2772
|
* @param bundleDir - Absolute path to bundle directory
|
|
2760
2773
|
* @returns { bundle?, diagnostics[] }
|
|
2761
2774
|
*/
|
|
2762
|
-
declare function loadLearnosityBundle(bundleDir: string): {
|
|
2775
|
+
export declare function loadLearnosityBundle(bundleDir: string): {
|
|
2763
2776
|
bundle?: LearnosityBundleModel;
|
|
2764
2777
|
diagnostics: Diagnostic[];
|
|
2765
2778
|
};
|
|
@@ -2777,7 +2790,7 @@ interface WriteBundleResult {
|
|
|
2777
2790
|
/**
|
|
2778
2791
|
* Write Learnosity Bundle to directory or ZIP
|
|
2779
2792
|
*/
|
|
2780
|
-
declare function writeLearnosityBundle(bundle: {
|
|
2793
|
+
export declare function writeLearnosityBundle(bundle: {
|
|
2781
2794
|
manifest: unknown;
|
|
2782
2795
|
activities: Map<string, unknown>;
|
|
2783
2796
|
items: Map<string, unknown>;
|
|
@@ -2810,7 +2823,7 @@ declare function isPathSafe(relativePath: string, baseDir: string): boolean;
|
|
|
2810
2823
|
* @param fullPath - Absolute path to check
|
|
2811
2824
|
* @returns true if symlink, false otherwise (or if path doesn't exist)
|
|
2812
2825
|
*/
|
|
2813
|
-
declare function isSymlink(fullPath: string): boolean;
|
|
2826
|
+
export declare function isSymlink(fullPath: string): boolean;
|
|
2814
2827
|
/**
|
|
2815
2828
|
* Safely resolve a relative path within a base directory
|
|
2816
2829
|
* Returns null if the path is unsafe or points to a symlink
|
|
@@ -2819,7 +2832,7 @@ declare function isSymlink(fullPath: string): boolean;
|
|
|
2819
2832
|
* @param baseDir - Base directory
|
|
2820
2833
|
* @returns Absolute path if safe, null otherwise
|
|
2821
2834
|
*/
|
|
2822
|
-
declare function safeResolve(relativePath: string, baseDir: string): string | null;
|
|
2835
|
+
export declare function safeResolve(relativePath: string, baseDir: string): string | null;
|
|
2823
2836
|
//#endregion
|
|
2824
2837
|
//#region src/learnosity-mapper/buildPackageFromActivity.d.ts
|
|
2825
2838
|
/**
|
|
@@ -2835,7 +2848,7 @@ declare function safeResolve(relativePath: string, baseDir: string): string | nu
|
|
|
2835
2848
|
* @param options - Build options including bundle directory
|
|
2836
2849
|
* @returns { package?, diagnostics[] }
|
|
2837
2850
|
*/
|
|
2838
|
-
declare function buildPackageFromActivity(conversion: ConvertActivityResult, options: BuildPackageFromActivityOptions): BuildPackageFromActivityResult;
|
|
2851
|
+
export declare function buildPackageFromActivity(conversion: ConvertActivityResult, options: BuildPackageFromActivityOptions): BuildPackageFromActivityResult;
|
|
2839
2852
|
//#endregion
|
|
2840
2853
|
//#region src/qti-to-learnosity/loadPackageDirectory.d.ts
|
|
2841
2854
|
interface LoadPackageDirectoryResult {
|
|
@@ -2847,7 +2860,7 @@ interface LoadPackageDirectoryResult {
|
|
|
2847
2860
|
* Recursively read every file under `dirPath` into an entries map, keyed by the
|
|
2848
2861
|
* forward-slash relative path (matching ZIP entry keys).
|
|
2849
2862
|
*/
|
|
2850
|
-
declare function loadPackageDirectory(dirPath: string): LoadPackageDirectoryResult;
|
|
2863
|
+
export declare function loadPackageDirectory(dirPath: string): LoadPackageDirectoryResult;
|
|
2851
2864
|
//#endregion
|
|
2852
2865
|
//#region src/conversions.node.d.ts
|
|
2853
2866
|
/**
|
|
@@ -2866,6 +2879,8 @@ interface ConvertQtiPackageToLearnosityOptions {
|
|
|
2866
2879
|
mediaVault?: boolean;
|
|
2867
2880
|
/** Custom base URL for assets (overrides default Learnosity CDN and mediaVault) */
|
|
2868
2881
|
customAssetUrl?: string;
|
|
2882
|
+
/** Preserve original QTI asset basenames instead of using hashed names (default: false) */
|
|
2883
|
+
preserveAssetFilenames?: boolean;
|
|
2869
2884
|
/** How to generate item references (default: 'sourceFilename') */
|
|
2870
2885
|
itemReferenceSource?: ItemReferenceSource;
|
|
2871
2886
|
/** How to generate output filenames (defaults to itemReferenceSource) */
|
|
@@ -2906,7 +2921,7 @@ interface ConvertQtiPackageToLearnosityResult {
|
|
|
2906
2921
|
* @param opts - Conversion options including input, output, and conversion settings
|
|
2907
2922
|
* @returns Diagnostics + summary always; `bundle` only when no `outputPath` is given
|
|
2908
2923
|
*/
|
|
2909
|
-
declare function convertQtiPackageToLearnosity(opts: ConvertQtiPackageToLearnosityOptions): Promise<ConvertQtiPackageToLearnosityResult>;
|
|
2924
|
+
export declare function convertQtiPackageToLearnosity(opts: ConvertQtiPackageToLearnosityOptions): Promise<ConvertQtiPackageToLearnosityResult>;
|
|
2910
2925
|
/**
|
|
2911
2926
|
* Options for converting a Learnosity bundle to a QTI Content Package
|
|
2912
2927
|
*/
|
|
@@ -2945,7 +2960,7 @@ interface ConvertLearnosityToQtiPackageResult {
|
|
|
2945
2960
|
* @param opts - Conversion options including input, output, and conversion settings
|
|
2946
2961
|
* @returns The built QTI Content Package (in-memory) and diagnostics
|
|
2947
2962
|
*/
|
|
2948
|
-
declare function convertLearnosityToQtiPackage(opts: ConvertLearnosityToQtiPackageOptions): ConvertLearnosityToQtiPackageResult;
|
|
2963
|
+
export declare function convertLearnosityToQtiPackage(opts: ConvertLearnosityToQtiPackageOptions): ConvertLearnosityToQtiPackageResult;
|
|
2949
2964
|
//#endregion
|
|
2950
|
-
export {
|
|
2965
|
+
export { type ConversionOptions, type ConversionResult, type ConvertLearnosityToQtiPackageOptions, type ConvertLearnosityToQtiPackageResult, type ConvertQtiPackageToLearnosityBundleOptions, type ConvertQtiPackageToLearnosityBundleResult, type ConvertQtiPackageToLearnosityOptions, type ConvertQtiPackageToLearnosityResult, type Diagnostic, type DiagnosticIssue, type DiagnosticLevel, type DiagnosticsOutput, type DiagnosticsReport, type FileAccess, type FormatDiagnosticsReportOptions, type ItemFilenameSource, type ItemReferenceSource, type LearnosityActivityJson, type LearnosityItemJson, type LearnosityQuestionJson, type LoadPackageDirectoryResult, type LoadPackageResult, type OutputFormat, type PackageEntry, type QtiVersion, type ReadZipResult, type ZipFileEntry, isPathSafe as isBundlePathSafe, isPathSafe$1 as isPathSafe };
|
|
2951
2966
|
//# sourceMappingURL=node.d.ts.map
|