Skip to content

Reload old-asset tabs that load QTI assessment items - #6481

Open
rtibblesbot wants to merge 3 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-6338-02394c
Open

rtibblesbot wants to merge 3 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-6338-02394c

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Loading an exercise's questions reloads the page if any is a QTI item.
  • The reload waits for open questions to close and for saves and uploads to finish.
  • At most one reload per minute per tab.
  • A tab that can't reload shows QTI questions locked like Perseus ones, without type label, answers or validation errors.

References

Fixes #6338. Parent: #6337. Removed by: #6339.

Reviewer guidance

Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.

Engineer review

  • A background refresh can request reload after the assessment load returns only legacy rows at assessmentItem/actions.js:60.
  • An untouched or hidden question in Questions holds reload while it stays open.
  • Reload can discard unsubmitted selections in Import, Move, Trash, Related resources, Clipboard, and Staging previews.
  • Closing either of two ResourcePanels for the same exercise cancels reload for both.
  • The preview keeps its type label and answers for rows with a legacy type and QTI raw data.
Engineer evidence

Tabs opened from Related resources, the resource panel, or a recommended resource can inherit the opener’s cooldown.
If session storage cannot read or write the cooldown, assessmentItem/qtiReload.js:47 skips reload.
Closing a question can release the hold during its image upload.
Reload can discard an unsubmitted Quick Edit draft.
Reload can discard an unsaved thumbnail crop after the upload settles.
The hold at assessmentItem/qtiReload.js:65 can end before queued IndexedDB writes settle.
Switching exercises closes the open legacy question and enables its validation at AssessmentEditor.vue:233.
Hovering over a Perseus card no longer shows a pointer cursor.
Clicking a Perseus card no longer records an Open analytics event.
Confirm that the temporary refresh observer belongs in the shared Resource API at shared/data/resources.js:909.
Confirm that every exercise in the bulk edit list can request reload until removed at EditModal.vue:349.
Confirm file/actions.js:171 is the shared tracking boundary for uploads started outside Uploader.vue.

Open questions:

  • Should the background-refresh callback live in the shared Resource.where (shared/data/resources.js) rather than only in loadAssessmentItems?
  • Is file/actions.js the right place to count uploads that start outside Uploader.vue?
  • The reload is unexercised against real new assets.

QA review

  • After deploying the QTI assets, open a QTI exercise in two independent tabs still running the old assets and verify both reach the new editor.
  • Type a title in Details during the hold and verify it survives reload without a Leave site prompt.
  • In offline Questions, use the keyboard to move, delete, and add beside a locked question at desktop and narrow widths.
  • Use browser Back from the edit modal during the hold and verify the channel tree restores its scroll position without reloading.
  • Drop a thumbnail just before the hold expires and verify the upload completes before reload.
Manual QA steps

QA team: opening an exercise with a QTI question reloads the page once, else locks that question. Look hardest at unsaved edits and uploads.

Requires: an exercise whose question 2 is QTI, added by a developer. Wait 60 seconds between items.

  1. Reload on open. Open the exercise's QUESTIONS tab. The page reloads once, with no "Leave site?" prompt.
  2. Locked QTI question. Click question 2. Nothing opens. Move it up. It moves, and shows no answers or incomplete count.
  3. Unsaved edit. Edit question 1 within 2 seconds of opening. The page does not reload. Click Close. The page reloads and keeps the edit.
  4. Upload. Upload a large thumbnail within 2 seconds of opening. The page reloads after the upload ends.
  5. Close before the reload. Close the exercise within 2 seconds. The page does not reload.

Look out for:

  • Open the exercise, then go offline. Look out for a reload, or a lost edit after you reconnect.
Captures (11)
Before After
Before: QTI question opens as a blank editable question After: QTI question stays closed and locked

Reload on open

s1-first-open-reloads.webm

Locked QTI question

Step Screenshot
Locked
Tree: no error icon
s3-reorder-add-delete.webm

Unsaved edit

Step Screenshot
Unsaved edit, no reload
Edit kept after reload

Close before the reload

s7-open-then-close-panel-no-reload.webm

Offline

Step Screenshot
Offline, locked, no reload

Another tab adds a QTI question

s9-remote-add-appears-locked.webm

AI usage

Used Claude Code to implement the reload, the lock and their Jest tests from the issue's plan. Verified with the Jest suite, ESLint and a browser harness with axe.


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

WAITING · for review
Last updated: 2026-11-27 01:05 UTC

rtibblesbot and others added 3 commits November 26, 2026 15:27
- QTI items can't be opened, show no type label or answers, and pass validation
- The editor reports when a question opens or closes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Reloads once changes are saved, uploads finish, the tab is online and no question is open
- At most once a minute per tab; can be cancelled
- The file store counts uploads in progress, from file drop to storage upload

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- loadAssessmentItems requests it for QTI rows, cached or from the background fetch
- Closing the exercise cancels it; an open question holds it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rtibblesbot
rtibblesbot marked this pull request as ready for review November 27, 2026 01:02
@rtibblesbot
rtibblesbot requested review from a team and leq-bot November 27, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant