|
|
@@ -1,27 +1,33 @@
|
|
|
<template>
|
|
|
- <div class="quiz-list-item"
|
|
|
- :class="question.studentAnswer ? question.studentAnswer.correct === false ? 'wrong' : '' : ''">
|
|
|
- <div class="quiz-list-item__index">{{ index + 1 }}.</div>
|
|
|
- <div>
|
|
|
- <markdown-section class="quiz-list-item-title" :raw="question.stem"/>
|
|
|
- <div v-if="question.type === QuestionKind.choice && question.studentAnswer">
|
|
|
- <label class="option" :key="index" v-for="(item, index) in question.options">
|
|
|
- <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="index"/>
|
|
|
- <b class="mr-8">{{ index }}.</b>
|
|
|
- <markdown-section style="display: inline" :raw="item"/>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div v-else-if="question.type === QuestionKind.trueOrFalse && question.studentAnswer">
|
|
|
- <label class="option">
|
|
|
- <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="true"/>
|
|
|
- <c-icon>check</c-icon>
|
|
|
- </label>
|
|
|
- <label class="option">
|
|
|
- <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="false"/>
|
|
|
- <c-icon>close</c-icon>
|
|
|
- </label>
|
|
|
+ <div class="do-quiz-question-card">
|
|
|
+ <div class="quiz-list-item"
|
|
|
+ :class="question.studentAnswer ? question.studentAnswer.correct === false ? 'wrong' : '' : ''">
|
|
|
+ <div class="quiz-list-item__index">{{ index + 1 }}.</div>
|
|
|
+ <div>
|
|
|
+ <markdown-section class="quiz-list-item-title" :raw="question.stem"/>
|
|
|
+ <div v-if="question.type === QuestionKind.choice && question.studentAnswer">
|
|
|
+ <label class="option" :key="index" v-for="(item, index) in question.options">
|
|
|
+ <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="index"/>
|
|
|
+ <b class="mr-8">{{ index }}.</b>
|
|
|
+ <markdown-section style="display: inline" :raw="item"/>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="question.type === QuestionKind.trueOrFalse && question.studentAnswer">
|
|
|
+ <label class="option">
|
|
|
+ <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="true"/>
|
|
|
+ <c-icon>check</c-icon>
|
|
|
+ </label>
|
|
|
+ <label class="option">
|
|
|
+ <input @click.stop="emitChoice" v-model="question.studentAnswer.answer" type="radio" :value="false"/>
|
|
|
+ <c-icon>close</c-icon>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="action-bar">
|
|
|
+ <c-stars :level="5" v-model="star"></c-stars>
|
|
|
+ <icon-button no-bold :left="12" theme="green">bookmark_border</icon-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -29,10 +35,12 @@
|
|
|
import CIcon from '@/components/Basic/CIcon'
|
|
|
import MarkdownSection from '@/views/quiz/components/MarkdownSection'
|
|
|
import QuestionKind from '@/enums/question-kind'
|
|
|
+import CStars from '@/components/Basic/CStars'
|
|
|
+import IconButton from '@/components/Basic/IconButton'
|
|
|
|
|
|
// fixme: 通过几层reference传值可能会造成一点困惑 - 咕咕咕
|
|
|
export default {
|
|
|
- components: { CIcon, MarkdownSection },
|
|
|
+ components: { IconButton, CStars, CIcon, MarkdownSection },
|
|
|
props: {
|
|
|
questionProp: Object,
|
|
|
index: Number
|
|
|
@@ -46,6 +54,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
question: null,
|
|
|
+ star: 0,
|
|
|
QuestionKind
|
|
|
}
|
|
|
},
|
|
|
@@ -61,7 +70,7 @@ export default {
|
|
|
@import "~@/style/theme.scss";
|
|
|
|
|
|
.quiz-list-item {
|
|
|
- padding: 24px 8px;
|
|
|
+ padding: 32px 16px 0 16px;
|
|
|
display: flex;
|
|
|
|
|
|
&__index {
|
|
|
@@ -88,4 +97,29 @@ export default {
|
|
|
color: $theme-red;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.do-quiz-question-card {
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.action-bar {
|
|
|
+ opacity: 0.4;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 16px 6px 16px;
|
|
|
+ position: relative;
|
|
|
+ border-top: 100px;
|
|
|
+ transition: .2s;
|
|
|
+ backdrop-filter: saturate(200%);
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@media (max-width: 500px) {
|
|
|
+ .action-bar {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|