@doenet/assignment-viewer 0.1.0-alpha-14 → 0.1.0-alpha-15
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.d.ts +103 -0
- package/package.json +5 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** The source for creating an activity */
|
|
4
|
+
export declare type ActivitySource = SingleDocSource | SelectSource | SequenceSource;
|
|
5
|
+
|
|
6
|
+
export declare function ActivityViewer({ source, flags: specifiedFlags, activityId, userId, requestedVariantIndex, maxAttemptsAllowed, itemLevelAttempts, activityLevelAttempts, paginate, showFinishButton, forceDisable, forceShowCorrectness, forceShowSolution, forceUnsuppressCheckwork, addVirtualKeyboard, externalVirtualKeyboardProvided, doenetViewerUrl, fetchExternalDoenetML, darkMode, showAnswerResponseMenu, answerResponseCountsByItem, includeVariantSelector: _includeVariantSelector, showTitle, itemWord, }: {
|
|
7
|
+
source: ActivitySource;
|
|
8
|
+
flags?: DoenetMLFlagsSubset;
|
|
9
|
+
activityId?: string;
|
|
10
|
+
userId?: string | null;
|
|
11
|
+
requestedVariantIndex?: number;
|
|
12
|
+
maxAttemptsAllowed?: number;
|
|
13
|
+
itemLevelAttempts?: boolean;
|
|
14
|
+
activityLevelAttempts?: boolean;
|
|
15
|
+
paginate?: boolean;
|
|
16
|
+
showFinishButton?: boolean;
|
|
17
|
+
forceDisable?: boolean;
|
|
18
|
+
forceShowCorrectness?: boolean;
|
|
19
|
+
forceShowSolution?: boolean;
|
|
20
|
+
forceUnsuppressCheckwork?: boolean;
|
|
21
|
+
addVirtualKeyboard?: boolean;
|
|
22
|
+
externalVirtualKeyboardProvided?: boolean;
|
|
23
|
+
doenetViewerUrl?: string;
|
|
24
|
+
fetchExternalDoenetML?: (arg: string) => Promise<string>;
|
|
25
|
+
darkMode?: "dark" | "light";
|
|
26
|
+
showAnswerResponseMenu?: boolean;
|
|
27
|
+
answerResponseCountsByItem?: Record<string, number>[];
|
|
28
|
+
includeVariantSelector?: boolean;
|
|
29
|
+
showTitle?: boolean;
|
|
30
|
+
itemWord?: string;
|
|
31
|
+
}): JSX.Element | null;
|
|
32
|
+
|
|
33
|
+
declare type DoenetMLFlags = {
|
|
34
|
+
showCorrectness: boolean;
|
|
35
|
+
readOnly: boolean;
|
|
36
|
+
solutionDisplayMode: string;
|
|
37
|
+
showFeedback: boolean;
|
|
38
|
+
showHints: boolean;
|
|
39
|
+
allowLoadState: boolean;
|
|
40
|
+
allowSaveState: boolean;
|
|
41
|
+
allowLocalState: boolean;
|
|
42
|
+
allowSaveSubmissions: boolean;
|
|
43
|
+
allowSaveEvents: boolean;
|
|
44
|
+
autoSubmit: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare type DoenetMLFlagsSubset = Partial<DoenetMLFlags>;
|
|
48
|
+
|
|
49
|
+
export declare function isActivitySource(obj: unknown): obj is ActivitySource;
|
|
50
|
+
|
|
51
|
+
/** The source for creating a select activity */
|
|
52
|
+
declare type SelectSource = {
|
|
53
|
+
type: "select";
|
|
54
|
+
id: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
/** The child activities to select from */
|
|
57
|
+
items: ActivitySource[];
|
|
58
|
+
/** The number of child activities to select (without replacement) for each attempt */
|
|
59
|
+
numToSelect: number;
|
|
60
|
+
/**
|
|
61
|
+
* Whether or not to consider each variant of each child a separate option to select from.
|
|
62
|
+
* If `selectByVariant` is `true`, the selection is from the total set of all variants,
|
|
63
|
+
* meaning selection probabilities is weighted by the number of variants each child has,
|
|
64
|
+
* and, if `numToSelect` > 1, a child could be selected multiple times for a given attempt.
|
|
65
|
+
*/
|
|
66
|
+
selectByVariant: boolean;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** The source for creating a sequence activity */
|
|
70
|
+
declare type SequenceSource = {
|
|
71
|
+
type: "sequence";
|
|
72
|
+
id: string;
|
|
73
|
+
title?: string;
|
|
74
|
+
/** The child activities that form the sequence. */
|
|
75
|
+
items: ActivitySource[];
|
|
76
|
+
/** If `true`, randomly permute the item order on each new attempt. */
|
|
77
|
+
shuffle: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Weights given to the credit achieved of each item
|
|
80
|
+
* when averaging them to determine the credit achieved of the sequence activity.
|
|
81
|
+
* Items missing a weight are given the weight 1.
|
|
82
|
+
*/
|
|
83
|
+
creditWeights?: number[];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** The source for creating a single doc activity */
|
|
87
|
+
declare type SingleDocSource = {
|
|
88
|
+
type: "singleDoc";
|
|
89
|
+
id: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
/**
|
|
92
|
+
* If `isDescription` is `true`, then this activity is not considered one of the scored items
|
|
93
|
+
* and its credit achieved is ignored.
|
|
94
|
+
*/
|
|
95
|
+
isDescription: boolean;
|
|
96
|
+
doenetML: string;
|
|
97
|
+
/** The version of DoenetML that should be used to render this activity. */
|
|
98
|
+
version: string;
|
|
99
|
+
/** The number of variants present in `doenetML` */
|
|
100
|
+
numVariants?: number;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { }
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@doenet/assignment-viewer",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "View assignments from questions written in DoenetML",
|
|
5
|
-
"version": "0.1.0-alpha-
|
|
5
|
+
"version": "0.1.0-alpha-15",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
7
7
|
"homepage": "https://github.com/Doenet/assignment-viewer#readme",
|
|
8
8
|
"type": "module",
|
|
@@ -13,19 +13,22 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"/dist"
|
|
15
15
|
],
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
18
20
|
"import": "./dist/index.js",
|
|
19
21
|
"require": "./dist/index.js"
|
|
20
22
|
},
|
|
21
23
|
"./*": {
|
|
24
|
+
"types": "./dist/*.d.ts",
|
|
22
25
|
"import": "./dist/*",
|
|
23
26
|
"require": "./dist/*"
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
"scripts": {
|
|
27
30
|
"dev": "vite",
|
|
28
|
-
"build": "
|
|
31
|
+
"build": "vite build",
|
|
29
32
|
"test": "vitest",
|
|
30
33
|
"lint": "eslint .",
|
|
31
34
|
"preview": "vite preview",
|