traitify-widgets 3.0.0-alpha.30 → 3.0.0-alpha.32

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 CHANGED
@@ -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", (surveys) => {
125
+ console.log("Surveys.allFinished", surveys);
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.finished", response);
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