阳洁
2024-02-23 8f685b98d924cabe0026163398e1867b54b3a988
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<template>
  <div>
    <el-container  class="app-item-contain">
00      <el-main style="padding-top: 3%;">
        <el-form :model="form" ref="form" label-width="100%">
          <el-row :key="index"  v-for="(titleItem,index) in titleItems">
            <div class="q-content">{{titleItem.description}}</div>
            <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0"  style="border:2px solid #2b90ff;">
              <div class="align-center"><span style="font-size: small; float: left">{{$t('examinee')}}{{memberName}}</span><span style="margin-top: 0px;padding-right: 11%">●{{form.name}}●</span></div>
              <hr style="border : 1px dashed #b3d8ff;" />
              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.note }}</el-row>
              <el-row style="margin-left:7px;margin-bottom:10px;">{{ questionItem.guide }}</el-row>
              <el-form-item :key="itemOrder" label-width="1px">
                <QuestionEdit @callNextSubject="nextSubject" :qType="questionItem.questionType" :question="questionItem"
                              :answer="answer.answerItems[questionItem.itemOrder-1]" :qLabel="itemOrder+'/'+itemSize"/>
              </el-form-item>
              <hr style="border : 0.5px dashed #b3d8ff;" />
              <div style="color: red;font-size: smaller">{{$t('pleaseAnswerCarefully_exercise')}}</div>
              
              <el-row class="do-align-center" v-if="itemOrder > 1">
                <el-button @click="doExam" type="success" round>{{$t('startDo_apifan')}}</el-button>
                <el-button @click="preSubject" type="warning" round>{{$t('lastQuestion')}}</el-button>
              </el-row>
              <el-row class="do-align-center" v-if="itemOrder <= 1">
                <el-button @click="doExam" type="success" round>{{$t('startDo_apifan')}}</el-button>
                <el-button @click="nextSubject" type="primary" round>{{$t('nextQuestion')}}</el-button>
              </el-row>
            </el-card>
          </el-row>
        </el-form>
 
      </el-main>
    </el-container>
    <el-row class="do-exam-title footer">
      <el-col :span="24">
        <!--<el-popover placement="top" title="题目列表" width="200" trigger="click" ref="popovertag">-->
          <!--<el-tag type="success" slot="reference">题目</el-tag>-->
          <!--<span :key="item.itemOrder" v-for="(item) in answer.answerItems">-->
             <!--<el-tag :type="questionCompleted(item.completed)" class="do-exam-title-tag"-->
                     <!--&gt;{{item.itemOrder}}</el-tag>-->
        <!--</span>-->
        <!--</el-popover>-->
        <span class="do-exam-time">
          <!--<label>{{$t('remainingTime')}}</label>-->
          <!--<label>{{formatSecondsG(remainTime,$t('hour'),$t('min'),$t('second'))}}</label>-->
        </span>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
import { mapState, mapGetters, mapMutations } from 'vuex'
import { formatSeconds, formatSecondsG, formatDate } from '@/utils'
import QuestionEdit from '../components/QuestionEdit'
import examPaperApi from '@/api/examPaper'
import examPaperAnswerApi from '@/api/examPaperAnswer'
import demographyApi from '@/api/demography'
 
export default {
  name: 'exercise',
  components: { QuestionEdit },
  data () {
    return {
      memberName: this.$route.query.formDo.memberName,
      form: {
        name: this.$route.query.formDo.name
      },
      itemOrder: 1,
      itemSize: 2,
      description: '',
      guide: '',
      questionItem: {
        title: '我善于主动和陌生人交谈。',
        items: [
          { content: '非常不同意', prefix: '1', score: 0 },
          { content: '不同意', prefix: '2', score: 0 },
          { content: '不确定', prefix: '3', score: 0 },
          { content: '同意', prefix: '4', score: 0 },
          { content: '非常同意', prefix: '5', score: 0 }
        ],
        questionType: 1,
        note: '以下为工作行为/题目风格的例子',
        guide: '请仔细阅读下面的陈述,判断您在多大程度上同意每一陈述对您的描述,然后点击相应的选项。'
      },
      answer: {
        questionId: null,
        doTime: 0,
        answerItems: [],
        verifyStatus: 2
      },
      titleItems: [
        {
          questionItems: [
            {
              title: '我善于主动和陌生人交谈。',
              items: [
                { content: '非常不同意', prefix: '1', score: 0 },
                { content: '不同意', prefix: '2', score: 0 },
                { content: '不确定', prefix: '3', score: 0 },
                { content: '同意', prefix: '4', score: 0 },
                { content: '非常同意', prefix: '5', score: 0 }
              ],
              questionType: 1
            },
            {
              title: '使用复印机。',
              items: [
                { content: '从来没有', prefix: '1', score: 0 },
                { content: '1-2次', prefix: '2', score: 0 },
                { content: '好几次', prefix: '3', score: 0 },
                { content: '经常', prefix: '4', score: 0 }
              ],
              questionType: 1
            }
          ]
        }
      ],
      isSubmit: false
    }
  },
  created: function () {
  },
  mounted () {
  },
  beforeDestroy () {
  },
  watch: {
  },
  methods: {
    nextSubject () {
      if (this.itemOrder === 2) {
        this.isSubmit = true
        return
      }
      this.questionItem = {
        title: '使用复印机。',
        items: [
          { content: '从来没有', prefix: '1', score: 0 },
          { content: '1-2次', prefix: '2', score: 0 },
          { content: '好几次', prefix: '3', score: 0 },
          { content: '经常', prefix: '4', score: 0 }
        ],
        questionType: 1,
        note: '以下为基本技能过往经验题目的例子',
        guide: '您在过去一年中使用过这些基本技能的频度,并点击相应的选项。'
 
      }
      this.itemOrder = 2
    },
    preSubject () {
      this.isSubmit = false
      this.questionItem = {
        title: '我善于主动和陌生人交谈。',
        items: [
          { content: '非常不同意', prefix: '1', score: 0 },
          { content: '不同意', prefix: '2', score: 0 },
          { content: '不确定', prefix: '3', score: 0 },
          { content: '同意', prefix: '4', score: 0 },
          { content: '非常同意', prefix: '5', score: 0 }
        ],
        questionType: 1,
        note: '以下为工作行为/题目风格的例子',
        guide: '请仔细阅读下面的陈述,判断您在多大程度上同意每一陈述对您的描述,然后点击相应的选项。'
      }
      this.itemOrder = 1
    },
    doExam () {
      let _this = this
      examPaperApi.updateTestMemberStatus(_this.memberToken).then(re => {
        _this.$router.push({ path: '/exam/' + _this.doUrl, query: { formDo: _this.$route.query.formDo } })
      }).catch(re => {
        _this.$message.error(re.message + ' 更新状态失败')
      })
    }
  },
  computed: {
    ...mapState('exam', { doUrl: state => state.doUrl }),
    ...mapState('user', { memberToken: state => state.memberToken })
  }
}
</script>
 
<style lang="scss" scoped>
  .align-center {
    text-align: center;
  }
 
  .exam-question-item {
    padding: 10px;
    font-size: large;
 
    .el-form-item__label {
      font-size: large !important;
    }
  }
 
  .question-title-padding {
    padding-left: 25px;
    padding-right: 25px;
  }
  .footer {
    position: absolute;
    position: fixed;
    z-index: 1000;
    bottom: 0px;
  }
</style>