@jswork/react-questkit 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/dist/index.cjs +6755 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +775 -0
- package/dist/index.d.ts +777 -0
- package/dist/index.mjs +6685 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +63 -4
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# react-questkit
|
|
2
|
+
> Mobile-first React component library for interactive homework experiences.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
## installation
|
|
5
|
+
```shell
|
|
6
|
+
pnpm add @jswork/react-questkit
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## usage
|
|
10
|
+
```tsx
|
|
11
|
+
import { QuestConfigProvider, SingleChoice } from '@jswork/react-questkit';
|
|
12
|
+
import '@jswork/react-questkit/style.css';
|
|
13
|
+
|
|
14
|
+
export function Question() {
|
|
15
|
+
return (
|
|
16
|
+
<QuestConfigProvider config={{ sound: false }}>
|
|
17
|
+
<SingleChoice
|
|
18
|
+
data={{
|
|
19
|
+
stem: 'I have ___ apple.',
|
|
20
|
+
options: [{ text: 'a' }, { text: 'an' }, { text: 'the' }],
|
|
21
|
+
answer: 1,
|
|
22
|
+
}}
|
|
23
|
+
onSubmit={(result) => console.log(result)}
|
|
24
|
+
/>
|
|
25
|
+
</QuestConfigProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
13 题型、三态矩阵、数据模型与样式定制见 [docs/questkit/usage.md](../../docs/questkit/usage.md)。
|
|
31
|
+
|
|
32
|
+
## license
|
|
33
|
+
Code released under [the MIT license](https://github.com/afeiship/react-questkit/blob/master/LICENSE.txt).
|