[测评系统]--前端(用户答题页面)
linzhijie
2023-04-25 256c35331eceab873acffa43b59aaa179c9167ec
Merge branch 'master' into v13-20230413
5个文件已修改
266 ■■■■ 已修改文件
src/lang/en.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/zh.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/guide.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/values.vue 249 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/en.js
@@ -64,10 +64,13 @@
    values_title:'Pre-Sort Your Response',
    values_title_description:'This is the pre-sorting section of the test. <br/>During this section, you will choose the pictures in which the character is most like you. <br/>All of these pictures will be shown again in later sections for the final sorting process.',
    values_title_description_1:'If you think the main character is like you, click ',
    values_title_description_1_2:' .',
    values_title_description_2:'If you think the main character is not like you, click ',
    values_title_description_2_2:' .',
    values_title_description_3:'If you are not sure, click ',
    values_title_description_3_2:' .',
    values_title_description_4:'Click ',
    values_title_description_4_2:' to zoom in the picture',
    values_title_description_4_2:' to zoom in the picture.',
    next:'Next',
    pre:'Back',
    commit:'Submit',
src/lang/zh.js
@@ -64,10 +64,13 @@
    values_title:'预先排序您的回答',
    values_title_description:'这是测试的预排序部分<br/>在此部分中,您将选择角色最像您的图片<br/>所有这些图片将在后面的部分中再次显示,以便进行最终排序。',
    values_title_description_1:'如果你认为主角和你一样, 点击 ',
    values_title_description_1_2:' 。',
    values_title_description_2:'如果你认为主角和你不一样, 点击 ',
    values_title_description_2_2:' 。',
    values_title_description_3:'如果你不确定, 点击 ',
    values_title_description_3_2:' 。',
    values_title_description_4:'点击 ',
    values_title_description_4_2:' 放大图片',
    values_title_description_4_2:' 放大图片。',
    next:'下一步',
    pre:'上一步',
    commit:'提交',
src/store/modules/user.js
@@ -41,6 +41,11 @@
  },
  setLangType (state, paraLangType) {
    state.langType = paraLangType
        if(paraLangType == 'Chinese'){
            Cookies.set('language', 'zh', { expires: 30 })
        } else {
            Cookies.set('language', 'en', { expires: 30 })
        }
  },
  getLangType () {
    let language = (navigator.language || navigator.browserLanguage).toLowerCase()
src/views/exam/paper/guide.vue
@@ -2,7 +2,7 @@
  <div>
    <el-container class="app-item-contain">
      <el-header class="align-center" style="height: 50px;padding: 1%;">
        <H2 v-html="$t('guide')" v-if="formDo.questionTemplateId !== 'job'"></H2>
        <H2 v-html="$t('guide')" v-if="formDo.questionTemplateId !== 'job' || formDo.questionTemplateId !== 'values'"></H2>
      </el-header>
      <el-main style="padding-top:0%">
        <div v-html="formDo.guide"></div>
src/views/exam/paper/values.vue
@@ -18,10 +18,10 @@
            <el-main class="">
                <div>
                    <div v-html="$t('values_title_description')"></div>
                    <div>{{$t('values_title_description_1')}}<img class="tools-button" src="@/assets/exam-paper/good.png" style="width: 15px;"/></div>
                    <div>{{$t('values_title_description_2')}}<img class="tools-button" src="@/assets/exam-paper/nogood.png" style="width: 15px;"/></div>
                    <div>{{$t('values_title_description_3')}}<img class="tools-button" src="@/assets/exam-paper/question.png" style="width: 15px;"/></div>
                    <div>{{$t('values_title_description_4')}}<img class="tools-button" src="@/assets/exam-paper/scale.png" style="width: 15px;"/>{{$t('values_title_description_4_2')}}</div>
                    <div>{{$t('values_title_description_1')}}<img class="tools-button" src="@/assets/exam-paper/good.png" style="width: 15px;position: absolute;margin-top: 2px"/><span style="margin-left: 20px;">{{$t('values_title_description_1_2')}}</span></div>
                    <div>{{$t('values_title_description_2')}}<img class="tools-button" src="@/assets/exam-paper/nogood.png" style="width: 15px;position: absolute;margin-top: 2px"/><span style="margin-left: 20px;">{{$t('values_title_description_2_2')}}</span></div>
                    <div>{{$t('values_title_description_3')}}<img class="tools-button" src="@/assets/exam-paper/question.png" style="width: 15px;position: absolute;margin-top: 2px"/><span style="margin-left: 20px;">{{$t('values_title_description_3_2')}}</span></div>
                    <div>{{$t('values_title_description_4')}}<img class="tools-button" src="@/assets/exam-paper/scale.png" style="width: 15px;height: 15px;position: absolute;margin-top: 2px"/><span style="margin-left: 20px;">{{$t('values_title_description_4_2')}}</span></div>
                </div>
                
                <div style="display: flex;justify-content: flex-start;padding: 10px 0;">
@@ -89,10 +89,10 @@
                        <div style="line-height: 50px;text-indent: 2em;">
                            <div
                                v-if="(step2SubStep == step2ScoreRanges.length) && (step2ScoreRanges.length % 2 == 1)">
                                {{$t('values_step_tips_for_3').replace('%N',getStep2StepItem(step2SubStep).quantity).replace('%C',getStep2StepItem(step2SubStep).stepName)}}
                                {{$t('values_step_tips_for_3').replace('%N',getStep2StepItem(step2SubStep).quantity).replace('%C',getStep2StepItem(step2SubStep).stepName.toUpperCase())}}
                            </div>
                            <div v-else>
                                {{$t('values_step_tips_for_1').replace('%N',getStep2StepItem(step2SubStep).quantity).replace('%C',getStep2StepItem(step2SubStep).stepName)}}
                                {{$t('values_step_tips_for_1').replace('%N',getStep2StepItem(step2SubStep).quantity).replace('%C',getStep2StepItem(step2SubStep).stepName.toUpperCase())}}
                            </div>
                            <div style="color: red;">
                                {{$t('values_step_tips')}}
@@ -275,210 +275,7 @@
                    "subjectId": null,
                },
                step3EWEIArea: [1],
                form: {
                    "id": 92,
                    "level": 1,
                    "subjectId": null,
                    "paperType": 1,
                    "name": "VAQ",
                    "suggestTime": null,
                    "limitDateTime": null,
                    "titleItems": [{
                        "guide": "",
                        "name": "",
                        "description": "",
                        "permanentId": null,
                        "questionOrder": 0,
                        "questionReport": null,
                        "questionItems": [{
                                "id": 786,
                                "questionType": 1,
                                "subjectId": null,
                                "title": "麻将桌",
                                "gradeLevel": null,
                                "items": [{
                                    "prefix": "1",
                                    "content": "0",
                                    "score": "0"
                                }],
                                "analyze": null,
                                "correctArray": null,
                                "correct": null,
                                "score": "0",
                                "difficult": null,
                                "itemOrder": 1,
                                "questionOrder": 0,
                                "permanentId": "VAQ00001",
                                "questionReport": null,
                                "startTime": null,
                                "endTime": null,
                                "partOrder": 1,
                                "parentQuestionId": null,
                                "template": null,
                                "questionNumber": null,
                                "content": null,
                                "imgUrl": "http://127.0.0.1:8090/profile/images/2022/12/26/b698d623e7c9a55d9017ffa08477b121.jpg"
                            },
                            {
                                "id": 787,
                                "questionType": 1,
                                "subjectId": null,
                                "title": "麻将桌2",
                                "gradeLevel": null,
                                "items": [{
                                    "prefix": "1",
                                    "content": "0",
                                    "score": "0"
                                }],
                                "analyze": null,
                                "correctArray": null,
                                "correct": null,
                                "score": "0",
                                "difficult": null,
                                "itemOrder": 2,
                                "questionOrder": 1,
                                "permanentId": "VAQ00002",
                                "questionReport": null,
                                "startTime": null,
                                "endTime": null,
                                "partOrder": 2,
                                "parentQuestionId": null,
                                "template": null,
                                "questionNumber": null,
                                "content": null,
                                "imgUrl": "http://127.0.0.1:8090/profile/images/2022/12/26/123f79ad0cc38507368c22b8a7ec9b09.jpg"
                            },
                            {
                                "id": 788,
                                "questionType": 1,
                                "subjectId": null,
                                "title": "测试1",
                                "gradeLevel": null,
                                "items": [{
                                    "prefix": "1",
                                    "content": "0",
                                    "score": "0"
                                }],
                                "analyze": null,
                                "correctArray": null,
                                "correct": null,
                                "score": "0",
                                "difficult": null,
                                "itemOrder": 3,
                                "questionOrder": 2,
                                "permanentId": "VAQ00003",
                                "questionReport": null,
                                "startTime": null,
                                "endTime": null,
                                "partOrder": 3,
                                "parentQuestionId": null,
                                "template": null,
                                "questionNumber": null,
                                "content": null,
                                "imgUrl": "http://127.0.0.1:8090/profile/images/2023/01/09/6b80baab47a9eba6ceeec5a723397109.jpg"
                            },
                            {
                                "id": 789,
                                "questionType": 1,
                                "subjectId": null,
                                "title": "测试2",
                                "gradeLevel": null,
                                "items": [{
                                    "prefix": "1",
                                    "content": "0",
                                    "score": "0"
                                }],
                                "analyze": null,
                                "correctArray": null,
                                "correct": null,
                                "score": "0",
                                "difficult": null,
                                "itemOrder": 4,
                                "questionOrder": 3,
                                "permanentId": "VAQ00004",
                                "questionReport": null,
                                "startTime": null,
                                "endTime": null,
                                "partOrder": 4,
                                "parentQuestionId": null,
                                "template": null,
                                "questionNumber": null,
                                "content": null,
                                "imgUrl": "http://127.0.0.1:8090/profile/images/2023/01/09/3f8e18280f1d47362c69b18e80ddf1a3.jpg"
                            },
                            {
                                "id": 790,
                                "questionType": 1,
                                "subjectId": null,
                                "title": "测试3",
                                "gradeLevel": null,
                                "items": [{
                                    "prefix": "1",
                                    "content": "0",
                                    "score": "0"
                                }],
                                "analyze": null,
                                "correctArray": null,
                                "correct": null,
                                "score": "0",
                                "difficult": null,
                                "itemOrder": 5,
                                "questionOrder": 4,
                                "permanentId": "VAQ00005",
                                "questionReport": null,
                                "startTime": null,
                                "endTime": null,
                                "partOrder": 5,
                                "parentQuestionId": null,
                                "template": null,
                                "questionNumber": null,
                                "content": null,
                                "imgUrl": "http://127.0.0.1:8090/profile/images/2023/01/09/447616cb14745241f0ac700b56d0770b.jpg"
                            }
                        ],
                        "startTime": null,
                        "endTime": null,
                        "parts": [],
                        "scoreRanges": [{
                                "itemOrder": 1,
                                "quantity": 2,
                                "score": 5,
                                "completed": false,
                                "questionReports": null
                            },
                            {
                                "itemOrder": 2,
                                "quantity": 1,
                                "score": 10,
                                "completed": false,
                                "questionReports": null
                            },
                            {
                                "itemOrder": 3,
                                "quantity": 2,
                                "score": 5,
                                "completed": false,
                                "questionReports": null
                            }
                        ]
                    }],
                    "score": null,
                    "guide": "VAQ",
                    "questionOrder": [
                        0,
                        1,
                        2,
                        3,
                        4
                    ],
                    "parts": [],
                    "questionTemplateId": "values",
                    "reportTemplateId": "61",
                    "memberName": "test4",
                    "optionOrder": null,
                    "timeOut": null,
                    "jobDescriptionFile": null
                },
                form:{},
                formLoading: false,
                answer: {
                    questionId: null,
@@ -514,7 +311,9 @@
            }
        },
        created: function() {
        //created: function() {
        mounted: function() {
            console.log(".....................mounted start......................")
            //console.log(".....................Test. config start......................")
            //if(this.memberToken == '' || this.memberToken == undefined) this.setMemberTocken("4bdcf437-185c-4f4e-9528-382c99509ea6")
            //console.log(".....................Test. config ednd.......................")
@@ -540,12 +339,14 @@
                _this.initStep2ScoreRanges(_this.form.titleItems[0].scoreRanges)
            } else {
                console.log(".....................mounted 刷新......................")
                _this.formLoading = true
                // 防止刷新成了不同的语言
                demographyApi.queryDemographyParamInfo(_this.memberToken).then(
                    re => {
                        if (re.response[0].langType !== null || re.response[0].langType.trim() !== '') {
                            _this.setLangType(re.response[0].langType)
                            console.log("lang type",re.response[0].langType,_this.langType)
                        }
                        // 加载题目
                        examPaperApi.select(_this.memberToken, _this.langType).then(re => {
@@ -620,14 +421,19 @@
                    }
                ).catch(e => {})
            }
        },
        mounted() {
            //console.log("mounted......")
            document.body.ondrop = function(event) {
                event.preventDefault();
                event.stopPropagation();
            }
        },
        // mounted() {
        //     //console.log("mounted......")
        //     document.body.ondrop = function(event) {
        //         event.preventDefault();
        //         event.stopPropagation();
        //     }
        // },
        beforeDestroy() {
            window.clearInterval(this.timer)
        },
@@ -898,9 +704,9 @@
            sortQuestions() {
                let type = this.getLikeType(this.step2SubStep)
                switch (type) {
                    case 0: //0:最像我
                        this.questionItems.sort(function(i2, i1) {
                            return (i2.content == 0) ? -1 : 1
                    case 0: //0:最像我 数字排序(数字和升序)
                        this.questionItems.sort(function(a, b) {
                            return a.content - b.content
                        })
                        break
                    case 1: //1:有疑问
@@ -908,9 +714,9 @@
                            return (i2.content == 1) ? -1 : 1
                        })
                        break
                    case 2: //2:最不像我
                        this.questionItems.sort(function(i2, i1) {
                            return (i2.content == 2) ? -1 : 1
                    case 2: //2:最不像我 数字排序(数字和降序)
                        this.questionItems.sort(function(a, b) {
                            return b.content - a.content
                        })
                        break
                }
@@ -1082,7 +888,7 @@
                    //设置每项已选择的数量
                    _this.step2ScoreRanges[i]['selected'] = 0
                }
                console.log('initStep2ScoreRanges...e', this.step2ScoreRanges)
                //console.log('initStep2ScoreRanges...e', this.step2ScoreRanges)
                _this.initStep2ScoreRangesStepName()
                _this.initQuestionItems()
            },
@@ -1093,6 +899,7 @@
                if(_this.$t('values_step_names').indexOf(",")>=0){
                    splitChar = ","
                }
                //console.log('lang type',_this.langType)
                let names = _this.$t('values_step_names').split(splitChar)
                console.log('initStep2ScoreRangesStepName',names)
                for (let i = 0; i < _this.step2ScoreRanges.length; i++) {