coursecode 0.1.51 → 0.1.52

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.
@@ -203,12 +203,29 @@ function resolveSlideId(contentWindow, slideIdOrIndex) {
203
203
  // =============================================================================
204
204
 
205
205
  function doReset() {
206
- // Static/cloud export: clear LMS localStorage and reload (no server route)
207
- const storageKey = config.storageKey;
208
- if (storageKey) {
209
- try { localStorage.removeItem(storageKey); } catch { /* ignore */ }
206
+ // Static/cloud export: unload the AU first so unload/terminate cannot recreate stale LMS state.
207
+ const frame = document.getElementById('stub-player-course-frame');
208
+ let resetStarted = false;
209
+
210
+ const finishReset = () => {
211
+ if (resetStarted) return;
212
+ resetStarted = true;
213
+
214
+ const storageKey = config.storageKey;
215
+ if (storageKey) {
216
+ try { localStorage.removeItem(storageKey); } catch { /* ignore */ }
217
+ }
218
+ window.location.reload();
219
+ };
220
+
221
+ if (frame) {
222
+ frame.addEventListener('load', finishReset, { once: true });
223
+ frame.src = 'about:blank';
224
+ setTimeout(finishReset, 250);
225
+ return;
210
226
  }
211
- window.location.reload();
227
+
228
+ finishReset();
212
229
  }
213
230
 
214
231
  function setupOutsideClickListener(contentPanel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coursecode",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "description": "Multi-format course authoring framework with CLI tools (SCORM 2004, SCORM 1.2, cmi5, LTI 1.3)",
5
5
  "type": "module",
6
6
  "bin": {