diff --git a/api/eduApp/index.js b/api/eduApp/index.js index 2bd41db..a1daf44 100644 --- a/api/eduApp/index.js +++ b/api/eduApp/index.js @@ -1,10 +1,83 @@ -import request from "@/utils/request"; +import request from '@/utils/request' // 我的消息 export function getNoticeAnnoByUserId(data) { - return request({ - 'url': '/app/index/getNoticeAnnoByUserId', - 'method': 'post', - 'data': data - }) + return request({ + url: '/app/index/getNoticeAnnoByUserId', + method: 'post', + data: data + }) +} + +// 考试-列表 /personalCenter/getStudentExamList +export function getStudentExamList(params) { + return request({ + url: '/personalCenter/getStudentExamList', + method: 'post', + data: params + }) +} + +// 考试-题目 /studentExam/getExamQuestionList +export function getExamQuestionList(params) { + return request({ + url: '/studentExam/getExamQuestionList', + method: 'post', + data: params + }) +} + +// 考试-做题 /studentExam/insertQuestionAnswerById +export function insertQuestionAnswerById(params) { + return request({ + url: '/studentExam/insertQuestionAnswerById', + method: 'post', + data: params + }) +} + +// 考试-交卷+结果 /studentExam/commitExamByRecordId +export function commitExamByRecordId(params) { + return request({ + url: '/studentExam/commitExamByRecordId', + method: 'post', + data: params + }) +} + +// 考试-查询结果列表 /studentExam/getExamRecordById +export function getExamRecordById(params) { + return request({ + url: '/studentExam/getExamRecordById', + method: 'get', + data: params + }) +} + +// 考试-结果详情 studentExam/getExamRecordAnswer +export function getExamRecordAnswer(params) { + return request({ + url: '/studentExam/getExamRecordAnswer', + method: 'post', + data: params + }) +} + +// 考试-排名 studentExam/getExamRankById +export function getExamRankById(params) { + return request({ + url: '/studentExam/getExamRankById', + method: 'post', + data: params + }) +} + + +// 练习-列表 /personalCenter/getStudentPracticeList +export function getStudentPracticeList(params) { + return request({ + url: '/personalCenter/getStudentPracticeList', + method: 'post', + data: params + }) } diff --git a/config.js b/config.js index 2844361..aa253f8 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,11 @@ // 应用全局配置 module.exports = { // baseUrl:'/prod-api', - baseUrl:'http://112.29.103.165:1616/ynuw', + // baseUrl:'http://112.29.103.165:1616/ynuw', + baseUrl:'http://192.168.0.32:2900/exam-student', + // 上传文件地址 + uploadUrl: 'http://192.168.0.137:2909/exam-file/file/uploadBase64', + bmwUrl: 'http://192.168.0.137:2911/exam-bmw', // 应用信息 appInfo: { // 应用名称 diff --git a/pages.json b/pages.json index 9971d16..ff2c78d 100644 --- a/pages.json +++ b/pages.json @@ -154,7 +154,10 @@ "path" : "pages/YNEduApp/exam/examination", "style" : { - "navigationStyle" : "custom" + "navigationStyle" : "custom", + "app-plus": { + "popGesture": "none" + } } }, { diff --git a/pages/YNEduApp/exam/beforeExam.vue b/pages/YNEduApp/exam/beforeExam.vue index a340c65..e9c360f 100644 --- a/pages/YNEduApp/exam/beforeExam.vue +++ b/pages/YNEduApp/exam/beforeExam.vue @@ -49,26 +49,46 @@ export default { return { showModal: false, // 标题 - title: '2023年送配电线路架设工模拟考试', + title: '', // 副标题 - subtitle: '不限期', + subtitle: '', // 考试时长 - duration: '120', + duration: '', // 考试次数 count: '不限次', // 切屏次数 - switchCount: '不限次', - content: '是否确认进入考试?' + switchCount: '', + content: '是否确认进入考试?', + examId: '', + examNum: 0, // 考试次数 + examCount: 1, // 1: 不限次 2: 及格终止 3: 自定义 + examCustom: 0, // 自定义次数 } }, + onLoad(opt) { + opt = JSON.parse(opt.params) + console.log('🚀 ~ onLoad ~ opt:', opt) + this.examId = opt.id + this.title = opt.name + this.subtitle = opt.validityDate + this.duration = opt.responseTime + this.switchCount = opt.cutNum.includes('null') || opt.cutNum.includes('undefined') ? '不限次' : opt.cutNum + }, methods: { openModal() { this.showModal = true }, // 进入考试 handleEnterExam() { + const params = { + examId: this.examId, // 考试id + switchCount: this.switchCount, // 切屏次数 + examNum: this.examNum, + examCount: this.examCount, + examCustom: this.examCustom + } uni.navigateTo({ - url: '/pages/YNEduApp/exam/examination' + url: `/pages/YNEduApp/exam/examination?params=${JSON.stringify(params)}` }) } } diff --git a/pages/YNEduApp/exam/exam.vue b/pages/YNEduApp/exam/exam.vue index c966151..96d17bc 100644 --- a/pages/YNEduApp/exam/exam.vue +++ b/pages/YNEduApp/exam/exam.vue @@ -11,22 +11,26 @@
-
{{ item.title }}
+
{{ item.name }}
- {{ item.name }} + {{ item.userName }}
指派
-
{{ item.status }}
+
{{ item.status == 2 ? '已考试' : '未考试' }}
-
{{ item.time }}
+
{{ item.validityDate }}
-
考试{{ item.count }}次
-
总分:{{ item.total }}
+
考试{{ item.examNum }}次
+
总分:{{ item.passScore }}
-
得分:{{ item.score }}
-
开始考试
+
得分:{{ item.examScore }}
+
开始考试
+
+
考试数据
+
重新考试
+
@@ -40,6 +44,8 @@ @@ -104,14 +130,19 @@ export default { margin-bottom: 10px; padding: 10px; + .title { + font-size: 16px; + font-weight: bold; + } + .item-title { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; - .title { - font-size: 16px; - font-weight: bold; + + .item-time { + font-size: 14px; } .item-tip { width: 40px; @@ -126,7 +157,10 @@ export default { } .pass { font-size: 12px; - color: #f0514c; + color: #67c23a; + &.un-pass { + color: #f0514c; + } } } @@ -149,8 +183,8 @@ export default { } .all { - margin: 30px auto; - text-align: center; + margin: 40px auto; + text-align: center; font-size: 13px; color: #8a8a8a; } diff --git a/pages/YNEduApp/exam/examinationResultDetails.vue b/pages/YNEduApp/exam/examinationResultDetails.vue index 4cdf986..457f99a 100644 --- a/pages/YNEduApp/exam/examinationResultDetails.vue +++ b/pages/YNEduApp/exam/examinationResultDetails.vue @@ -44,23 +44,23 @@
-
单选题({{ item.score }}分)
-
多选题({{ item.score }}分)
-
判断题({{ item.score }}分)
+
单选题({{ item.questionScore }}分)
+
多选题({{ item.questionScore }}分)
+
判断题({{ item.questionScore }}分)
-
{{ currentIndex + 1 }}. {{ item.question }}
+
{{ currentIndex + 1 }}. {{ item.examTopic }}
-
{{ option.value }}.
+
{{ option.optionIdent }}.
-
{{ option.label }}
+
{{ option.optionContent }}
@@ -76,29 +76,61 @@
正确选择
-
{{ item.rightAnswer }}
-
{{ item.rightAnswer.join(', ') }}
+
+ {{ item.correctGrade || '' }} +
+
+
+ {{ grade }}{{ gradeIndex + 1 == item.correctGrade.split('').length ? '' : ', ' }} +
+
你的选择
-
- {{ item.userAnswer }} +
+ {{ item.selectAnswer || '' }} +
+
+
+
+ {{ grade }}{{ gradeIndex + 1 == item.selectAnswer.split('').length ? '' : ', ' }} +
+
-
{{ item.userAnswer.join(', ') }}
-
解析
-
{{ item.analysis }}
+
+ + 解析 +
+
{{ item.examAnaly }}
+
+ + +
+
+ +
+
+ +
@@ -101,10 +158,10 @@ export default { display: flex; flex-direction: column; align-items: center; - :nth-child(2) { - margin-top: 10px; - color: #6b6b6b; - } + :nth-child(2) { + margin-top: 10px; + color: #6b6b6b; + } } } .btn { diff --git a/static/images/user.png b/static/images/user.png new file mode 100644 index 0000000..91a4b6b Binary files /dev/null and b/static/images/user.png differ