traitify-widgets 3.0.0-alpha.3 → 3.0.0-alpha.31
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 +18 -6
- package/build/traitify.js +1 -1
- package/build/traitify.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ import traitify, {Components} from "traitify-widgets";
|
|
|
108
108
|
|
|
109
109
|
export default function Personality({id}) {
|
|
110
110
|
return (
|
|
111
|
-
<Components.Container {...traitify.props
|
|
111
|
+
<Components.Container {...traitify.props} assessmentID={id}>
|
|
112
112
|
<Components.Results />
|
|
113
113
|
</Components.Container>
|
|
114
114
|
);
|
|
@@ -119,6 +119,21 @@ export default function Personality({id}) {
|
|
|
119
119
|
|
|
120
120
|
Most components trigger an initialized and updated event. Some components offer additional events. Event handlers must be set before the render command, or they will not be called.
|
|
121
121
|
|
|
122
|
+
The widgets are capable of showing multiple kinds of surveys to users in order to satisfy benchmark requirements, to handle the event when all surveys have been finished you should use this event:
|
|
123
|
+
```
|
|
124
|
+
Traitify.listener.on("Surveys.allFinished", (assessments) => {
|
|
125
|
+
console.log("Surveys.allFinished", assessments);
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
To handle the event when each survey has been finished, maybe to record total progress in a backend system:
|
|
130
|
+
```
|
|
131
|
+
Traitify.listener.on("Survey.finished", ({response}) => {
|
|
132
|
+
console.log("Survey.finished", response);
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Here are some other events that can be handled:
|
|
122
137
|
```
|
|
123
138
|
Traitify.listener.on("Survey.initialized", () => {
|
|
124
139
|
console.log("Survey.initialized");
|
|
@@ -129,14 +144,11 @@ Traitify.listener.on("Survey.updated", () => {
|
|
|
129
144
|
});
|
|
130
145
|
|
|
131
146
|
Traitify.listener.on("Survey.updateSlide", ({response}) => {
|
|
132
|
-
console.log("Survey.
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
Traitify.listener.on("Survey.finished", ({response}) => {
|
|
136
|
-
console.log("Survey.finished", response);
|
|
147
|
+
console.log("Survey.updateSlide", response);
|
|
137
148
|
});
|
|
138
149
|
```
|
|
139
150
|
|
|
151
|
+
|
|
140
152
|
## Options
|
|
141
153
|
|
|
142
154
|
### Internationalization Options
|