-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
patrick
committed
Nov 2, 2023
1 parent
5d578dd
commit 6be2808
Showing
5 changed files
with
56 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { css, html, LitElement } from 'lit'; | ||
|
||
import { customElement, state } from 'lit/decorators.js'; | ||
import { consume } from '@lit/context'; | ||
import { TestContext, testContext } from '../qti-assessment-test.context'; | ||
import { QtiAssessmentTest } from '../qti-assessment-test'; | ||
|
||
@customElement('test-process-response') | ||
export class TestProcessResponse extends LitElement { | ||
@consume({ context: testContext, subscribe: true }) | ||
@state() | ||
public _testContext?: TestContext; | ||
|
||
_processResponse() { | ||
const currentItemIdentifier = this._testContext.items[this._testContext.itemIndex].identifier; | ||
const qtiAssessmentTestEl = this.closest('qti-assessment-test') as QtiAssessmentTest; | ||
const qtiItemEl = qtiAssessmentTestEl.itemRefEls.get(currentItemIdentifier); | ||
const qtiAssessmentItemEl = qtiItemEl.assessmentItem; | ||
qtiAssessmentItemEl.processResponse(); | ||
} | ||
|
||
render() { | ||
return html` | ||
<button part="button" @click=${_ => this._processResponse()} id="process-response"> | ||
<slot></slot> | ||
</button> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters