Creating a quiz in Vue.js with various question types:
- Select one
- Select multiple
- Select image
- Match
The challenge lies in the mixing of question types within the same quiz, leading to the use of different components (<x-select-one-question>
,
<x-select-multiple-question>
, <x-select-image-question>
, <x-match>
, etc.) which prevents straightforward insertion into the quiz.
Is there a way to create a generic component for this purpose? Perhaps something along these lines:
<template>
<div>
<x-question
v-for="(question, index) in questions"
:key="index"
type="question.type"></x-question>
</div>
</template>