@0m0g1/griot 0.1.20 → 0.1.21
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/package.json +1 -1
- package/src/viewer/Viewer.js +5 -0
package/package.json
CHANGED
package/src/viewer/Viewer.js
CHANGED
|
@@ -44,6 +44,10 @@ export class Viewer {
|
|
|
44
44
|
this._render();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
setOnQuizSubmit(fn) {
|
|
48
|
+
this._options.onQuizSubmit = fn ?? null;
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
/** Scroll to block and briefly highlight it */
|
|
48
52
|
setHighlight(blockId, { scroll = true, behavior = 'smooth' } = {}) {
|
|
49
53
|
clearTimeout(this._hlTimer);
|
|
@@ -119,6 +123,7 @@ export class Viewer {
|
|
|
119
123
|
books: this._books,
|
|
120
124
|
onEventClick: this._options.onEventClick,
|
|
121
125
|
onCiteClick: this._options.onCiteClick,
|
|
126
|
+
onQuizSubmit: this._options.onQuizSubmit, // ← add this
|
|
122
127
|
};
|
|
123
128
|
|
|
124
129
|
for (const block of this._doc.blocks) {
|