Created
February 7, 2025 17:49
-
-
Save lovemycodesnippets/1d6e0c783ccb1119b97002ecc8f913a9 to your computer and use it in GitHub Desktop.
<script src="https://gist.github.com/lovemycodesnippets/7678c9a620c424bcdce830f8e66c961f.js"></script>
This file contains hidden or 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
… | |
<template> | |
<div class="questions-ctr"> | |
<div class="progress"> | |
<div | |
class="bar" | |
:style="{ | |
width: `${(questionsAnswered / questions.length) * 100}%`, | |
}"></div> | |
<div class="status"> | |
{{ questionsAnswered }} out of {{ questions.length }} questions answered | |
</div> | |
</div> | |
<div | |
class="single-question" | |
v-for="(question, qi) in questions" | |
:key="question.id" | |
v-show="questionsAnswered === qi"> | |
<div class="question">{{ question.question_text }}</div> | |
<div class="answers"> | |
<div | |
class="answer" | |
v-for="answer in getAnswersForQuestion(question.id)" | |
:key="answer.answer_text" | |
@click.prevent="selectAnswer(answer.is_correct)"> | |
{{ answer.answer_text }} | |
</div> | |
</div> | |
</div> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment