feat: add question bank management, quiz finalization, and related backend/frontend functionality

This commit is contained in:
2026-07-04 20:10:03 +02:00
parent d1d1eb3a24
commit c34c25dff7
37 changed files with 2493 additions and 206 deletions
@@ -0,0 +1,21 @@
import {Controller} from '@hotwired/stimulus';
export default class extends Controller {
static targets = ['collection'];
static values = {prototype: String};
connect() {
this.index = this.collectionTarget.children.length;
}
addItem() {
const item = document.createElement('div');
item.innerHTML = this.prototypeValue.replace(/__name__/g, this.index);
this.collectionTarget.appendChild(item.firstElementChild);
this.index++;
}
removeItem(event) {
event.target.closest('[data-collection-item]').remove();
}
}