Skip to content

Commit

Permalink
fix: check if there are active items
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick de Klein committed Feb 17, 2025
1 parent 0323e35 commit 040087a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/qti-test/components/test-print-item-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class TestPrintVariables extends LitElement {
const activeItems = this.computedContext?.testParts.flatMap(testPart =>
testPart.sections.flatMap(section => section.items).find(item => item.active)
);
if (!activeItems) return html``;
const activeItem = activeItems.length > 0 ? activeItems[0] : null;
if (activeItem) {
const responseVariables: ResponseVariable[] = activeItem.variables?.filter(v => {
Expand Down

0 comments on commit 040087a

Please sign in to comment.