diff --git a/src/api/courseRecord.js b/src/api/courseRecord.js
index b47d471f..c589a54c 100644
--- a/src/api/courseRecord.js
+++ b/src/api/courseRecord.js
@@ -27,6 +27,26 @@ export const queryPracticeHis = (data) => {
};
/**考试*/
+export const queryCrsExamRecordPaging = (data) => {
+ return request({
+ url: base_url + '/traRecord/queryCrsExamRecordPaging',
+ method: 'post',
+ toastErrors: true,
+ data
+ });
+};
+// 考试每一项列表
+export const queryCrsExamHisByExamId = (data) => {
+ return request({
+ url: base_url + '/traRecord/queryCrsExamHisByExamId',
+ method: 'post',
+ toastErrors: true,
+ data
+ });
+};
+
+
+/**考试中心考试*/
// 考试列表页
export const queryExamRecordPaging = (data) => {
return request({
diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue
index f77f9da1..d6b175d4 100644
--- a/src/components/examination/question.vue
+++ b/src/components/examination/question.vue
@@ -3,7 +3,7 @@
- {{voiceTime}}
+ {{ voiceTime }}
{{ showContent }}
@@ -14,13 +14,25 @@
-
-
-
+
+
+ 文
+
+ 重答
+ 完成
+
+
@@ -31,14 +43,23 @@
-
-
-
- 重答
-
+
+
+ 重答
+ 完成
@@ -49,143 +70,142 @@
\ No newline at end of file
+
diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue
index d173fb47..8dfb45ba 100644
--- a/src/components/examination/subject.vue
+++ b/src/components/examination/subject.vue
@@ -28,9 +28,9 @@
@@ -119,8 +119,10 @@
// result.anserResult
let answerText = props.item?.my_answer || props.item.anserResult || [];
+
console.log('answerText', props.item.anserResult);
- const item_answer = ref(typeof answerText === 'string' ? answerText.split(',') : []);
+ // item_answer 是答题结果,可以是对象 数组 字符串类型
+ const item_answer = ref(typeof answerText === 'string' ? answerText.split(',') : answerText);
const feedback_click = () => {
emit('subject_click', 'feedback', props.item);
};
@@ -163,17 +165,22 @@
},
set: (val) => {}
});
-
- // const subject_data = reactive({
- // qnsId: props.item.qnsId,
- // qnsContent: props.item.qnsContent,
- // qnsTyp: props.item.qnsTyp,
- // analyContent: props.item.analyContent,
- // itemVos: (props.item.itemVos ?? []).map((res) => ({
- // ...res,
- // correctFlag: props.clearResult ? '' : res.correctFlag
- // }))
- // });
+ // 按钮
+ const questionBuuttonClick = (type, submitObj) => {
+ console.log('type', type, submitObj);
+ // 判断点击的是什么
+ if(type === 'complete') { // 完成
+
+ }else if(type === 'again') { // 重答
+
+ }
+ emit('subject_click', type, {
+ qnsTyp: props.item.qnsTyp,
+ qnsId: props.item.qnsId,
+ answer: item_answer.value,
+ answerItems: []
+ });
+ };
// 题类型
const subject_type_text = computed(() => SUBJECT_TYPE.find((res) => qnsTyp.value === res.value)?.label || '');
diff --git a/src/components/examination/touchBtn.vue b/src/components/examination/touchBtn.vue
index 0561e714..a1b9739a 100644
--- a/src/components/examination/touchBtn.vue
+++ b/src/components/examination/touchBtn.vue
@@ -1,17 +1,20 @@
-
- 按住说话
-
-
+
+
+ 按住说话
+
+
+
+
recordingStatus.value = 'not_started');
+ nextTick(() => (recordingStatus.value = 'not_started'));
};
-
+
onMounted(async () => {
// #ifdef APP-PLUS
recorderManager.onStop(function (res) {
@@ -168,8 +176,8 @@
const recordDuration = endTime - startTime;
console.log('说话时长', recordDuration);
if (props.minRecordDuration > recordDuration) {
- nextTick(()=>common.msg('说话时间太短,没有听清!'))
- return ;
+ nextTick(() => common.msg('说话时间太短,没有听清!'));
+ return;
}
console.log('录音结束,时长:', recordDuration, '秒');
emit('submit', 'voice', res.tempFilePath);
@@ -185,7 +193,7 @@
});
// #endif
});
-
+
const touchY = ref(0);
const windowInfo = uni.getWindowInfo();
// 安全区域信息
@@ -199,6 +207,12 @@
const handleMove = (obj) => {
touchY.value = obj.changedTouches[0].pageY;
};
+ const clearinputText = (text = '') => {
+ const old_text = inputText.value;
+ inputText.value = text;
+ return old_text;
+ };
+ defineExpose({ clearinputText });
// 发送文本
const showKeyboard = () => {
if (keyboardIsShow.value) {
@@ -218,6 +232,11 @@
keyboardIsShow.value = !keyboardIsShow.value;
inputText.value = '';
};
+ // 禁用时点击给的提示
+ const disabled_click = () => {
+ console.log('禁用时点击给的提示');
+ if (props.isDisabled) common.msg(props.disabledText);
+ };
\ No newline at end of file
+
diff --git a/src/pages/courseRecord/components/item.vue b/src/pages/courseRecord/components/item.vue
new file mode 100644
index 00000000..863d8aef
--- /dev/null
+++ b/src/pages/courseRecord/components/item.vue
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+
+
+ {{ item.examName }}
+
+
+
+ {{ item.highestGrade || 0 }}
+ 历史最高分
+
+
+
+
+ {{ item.examCnt || 0 }}
+
+
+ 考试次数
+
+
+
+
+
+
+
+
+
+ 考试时间:{{ item_list.examStartTm }}
+
+
+
+ 考试得分:{{ item_list.examGrade }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/courseRecord/components/practiceRecordItem.vue b/src/pages/courseRecord/components/practiceRecordItem.vue
index a57b10ab..24917d24 100644
--- a/src/pages/courseRecord/components/practiceRecordItem.vue
+++ b/src/pages/courseRecord/components/practiceRecordItem.vue
@@ -17,7 +17,7 @@
}}阿斯顿萨达萨达阿斯顿萨达萨达萨达萨达萨达萨达
-
+
答题正确率:30
@@ -40,11 +40,11 @@
import { setPageCache } from '@/common/common';
import common from '@/common/common';
import { ref, reactive, onMounted, nextTick } from 'vue';
-
- import { queryPracticeRecordPaging, queryPracticeHis } from '@/api/courseRecord.js';
+
+ import { queryPracticeRecordPaging, queryPracticeHis, queryCrsExamRecordPaging } from '@/api/courseRecord.js';
import { studyDurationIcon, studyTimeIcon } from '@/common/imgSvg';
const props = defineProps({});
-
+
const getData = (from = '', searchText = '') => {
if (from == 'first') {
if (total.value !== -1) {
diff --git a/src/pages/courseRecord/courseStudyRecordDetail.vue b/src/pages/courseRecord/courseStudyRecordDetail.vue
new file mode 100644
index 00000000..02409e35
--- /dev/null
+++ b/src/pages/courseRecord/courseStudyRecordDetail.vue
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/courseRecord/index.vue b/src/pages/courseRecord/index.vue
index 497b4dfc..17471aaf 100644
--- a/src/pages/courseRecord/index.vue
+++ b/src/pages/courseRecord/index.vue
@@ -49,7 +49,7 @@
import common from '@/common/common.js';
const listItemRefs = ref([]);
const taskRef = ref(null);
- const tabAct = ref(1);
+ const tabAct = ref(2);
const tabList = ref([
{
name: '学习记录'
@@ -103,12 +103,11 @@
/*
状态栏 var(--status-bar-height)
标题高度88rpx
- 搜索栏高度80rpx
tab切换栏高度88rpx
下方滑动区域上下边距各10共20rpx
**/
- height: calc(100vh - var(--status-bar-height) - 88rpx - 80rpx - 88rpx - 20rpx);
+ height: calc(100vh - var(--status-bar-height) - 88rpx - 88rpx - 30rpx);
}
.swiper-item {
diff --git a/src/pages/practice/index.vue b/src/pages/practice/index.vue
index 1cfd7617..316d5536 100644
--- a/src/pages/practice/index.vue
+++ b/src/pages/practice/index.vue
@@ -61,11 +61,13 @@
@@ -92,7 +94,7 @@
const answerIsOver = ref(true);
const feedbackRef = ref(null);
const dialogRef = ref(null);
- const popupRef = ref(null);
+ const touchBtnRef = ref(null);
const mode = ref('practice'); // 考试 examination 练习practice
const paperData = reactive({
@@ -105,11 +107,22 @@
const popup_input_bottom = ref('0px');
const questionNumber = ref(0); // 题号
const systemInfo = uni.getSystemInfoSync();
+ const topic = computed({
+ get: () => topicList[questionNumber.value],
+ set: (val) => topicList[questionNumber.value] = val
+ });
const showTouchBtn = computed(() => {
- return topicList[questionNumber.value]['qnsTyp'] === 'ES';
+ return topic.value?.qnsTyp === 'ES';
});
- const progress = computed(() => {
+ // 下面语音组件的禁用状态判断
+ const touchIsDisabled = computed(() => {
+
+ return topic.value?.es_status !== '' && topic.value?.es_status !== undefined
+ })
+
+
+ const progress = computed(() => {
// 计算进度百分比(保留两位小数)
const total = storageTopicList.value.length;
if (total === 0) return 0;
@@ -141,33 +154,39 @@
if (['JD', 'SN'].includes(params.qnsTyp)) {
submitProblem({ anserResult: params.answer.join(',') });
}
+ } else if (type === 'complete') {
+ // 问答题点击完成
+ } else if (type === 'again') {
+ // 问答题点击重答
+ // const topic = topicList[questionNumber.value];
+ topic.value.isPreview = false;
+ topic.value.es_status = ''; // 取消转圈
}
};
// 单题回答(没有问答题)
const submitProblem = (answer) => {
- const topic = topicList[questionNumber.value];
console.log('答题内容', answer);
console.log('答单题', topic);
common.loading('答题中');
practiceAnswer({
exrId: paperData.exrId,
ossKey: '',
- qnsId: topic.qnsId,
+ qnsId: topic.value.qnsId,
...answer
})
.then((res) => {
common.hideLoading();
const body = res.body;
console.log('body', body);
- topic.isPreview = true; // 不能在点击了,打开预览模式
- topic.clearResult = false; // 不清除正确答案了
+ topic.value.isPreview = true; // 不能在点击了,打开预览模式
+ topic.value.clearResult = false; // 不清除正确答案了
const traQnsInfoVo = body.traQnsInfoVo;
- topic.analyContent = traQnsInfoVo.analyContent; // 答案解析
+ topic.value.analyContent = traQnsInfoVo.analyContent; // 答案解析
console.log('答题结果', traQnsInfoVo);
// 更新选项正确项目
- topic.itemVos = traQnsInfoVo.itemVos; // 答案选项(todo应该不这样替换)
- topic.anserResult = traQnsInfoVo.anserResult; // 正确答案字符串分割
+ topic.value.itemVos = traQnsInfoVo.itemVos; // 答案选项(todo应该不这样替换)
+ topic.value.anserResult = traQnsInfoVo.anserResult; // 正确答案字符串分割
const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
if (!addProblem()) {
// 返回false说明到了最后一题
@@ -179,13 +198,16 @@
// ['JD', 'SN', 'MU'].includes(topic.qnsTyp) && // 条件2.单选多选判断(这里改成了单选多选判断专属,所有不用判断这一条了)
topicList.length < storageTopicList.value.length // 条件3.不是最后一题(暂定这样判断)
) {
-
questionNumber.value++;
} else {
console.log('为什么没自动跳转', judgeResultStatus);
- console.log('22', topicList.length < storageTopicList.value.length, topicList.length , storageTopicList.value.length);
+ console.log(
+ '22',
+ topicList.length < storageTopicList.value.length,
+ topicList.length,
+ storageTopicList.value.length
+ );
}
-
})
.catch(() => {
common.hideLoading();
@@ -197,10 +219,10 @@
if (maxRetries <= 0) {
return Promise.reject(new Error('超过最大重试次数,查询失败'));
}
-
+
return queryCrsPracticeAnswerResult({ execLogId }).then((resl) => {
const isWait = resl.body.isWait;
- if (isWait === 'Y') {
+ if (isWait === 'N') {
// 如果是Y,延迟2秒后重试,重试次数减1
return new Promise((resolve) => {
setTimeout(() => {
@@ -217,7 +239,9 @@
// 单题回答(问答题专属)
const submitProblemEssayQuestion = (answer) => {
const topic = topicList[questionNumber.value];
+ const old_text = touchBtnRef.value?.clearinputText(); // 清除发送框数据
console.log('答题内容', answer);
+
console.log('答单题问答题专属', topic);
practiceAnswer({
exrId: paperData.exrId,
@@ -227,6 +251,8 @@
})
.then((res) => {
topic.isPreview = true; // 不能在点击了,打开预览模式
+
+ // touchBtnRef.value.clearinputText()
// topic.clearResult = false; // 不清除正确答案了
// 使用方式
queryWithRetry(res.body.execLogId)
@@ -234,31 +260,31 @@
console.log('查询成功', result);
const body = result.body;
const traQnsInfoVo = body.traQnsInfoVo;
- topic.analyContent = traQnsInfoVo.analyContent; // 答案解析
- topic.anserResult = traQnsInfoVo.anserResult // 正确答案文字内容
- const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
+ topic.analyContent = traQnsInfoVo?.analyContent || ''; // 答案解析
+ topic.anserResult = traQnsInfoVo?.anserResult || answer.anserResult; // 正确答案文字内容
+ const judgeResultStatus = traQnsInfoVo?.judgeResult === 'P'; // P为正确U为错误
// 判断是语音回答还是文字回答, 通过是否存在语音地址判断 // todo 后续可能改成ossid判断
if (answer.voicePath) {
- topic.es_status = '02'
- } else { // 纯文字
- topic.es_status = '01'
+ topic.es_status = '02';
+ } else {
+ // 纯文字
+ topic.es_status = '01';
}
-
+
// 处理成功结果
})
.catch((error) => {
console.log('查询失败', error);
- topic.isPreview = false
- topic.es_status = ''
+ topic.isPreview = false;
+ topic.es_status = ''; // 取消转圈
+ touchBtnRef.value?.clearinputText(old_text); // 清除发送框数据
// 处理失败情况
});
-
+
// const traQnsInfoVo = body.traQnsInfoVo;
// topic.analyContent = traQnsInfoVo.analyContent; // 答案解析
// console.log('答题结果', traQnsInfoVo);
-
-
// const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
// if (!addProblem()) {
@@ -268,44 +294,55 @@
})
.catch(() => {
topic.es_status = ''; // 取消转圈
+
});
};
- // 录音按钮提交
+ // 录音组件提交
const touchBtnSubmit = (type, submitObj) => {
- const topic = topicList[questionNumber.value];
- topic.es_status = '00'; // 00转圈
+
+ const old_text = touchBtnRef.value?.clearinputText(); // 清除发送框数据
+
if (type === 'voice') {
- uploadRecordNow(submitObj);
+ topic.value.es_status = '00'; // 00转圈
+ const voicePath = submitObj;
+ commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
+ .then((res) => {
+ let _res = JSON.parse(res.data);
+ console.log('res小行星', _res);
+ if (_res.rtnCode === '0000') {
+ topic.value.es_status = '02'
+ topic.value.my_answer = {
+ anserResult: _res.body.transContent,
+ ossKey: _res.body.fileId,
+ ossAddr: _res.body.ossFileAddr,
+ voicePath: voicePath
+ }
+ // {
+ // "chatId":"CHAT025018122068202508232000590000000000000000000000000000000060",
+ // "fileId":"S3F0250181220722025082320005900000676612",
+ // "ossFileAddr":"http://25.18.122.66::9786/traoss/show//S3F0250181220722025082320005900000676612",
+ // "transContent":"一二三四。"
+ // }
+ // submitProblemEssayQuestion({
+ // anserResult: _res.body.transContent,
+ // ossKey: _res.body.fileId,
+ // ossAddr: _res.body.ossFileAddr,
+ // voicePath: voicePath
+ // });
+ }
+ })
+ .catch((err) => {
+ topic.value.es_status = ''; // 取消转圈
+ // 失败了再把发送框数据还原回去
+ touchBtnRef.value?.clearinputText(old_text); // 清除发送框数据
+ common.msg('系统异常,请联系管理员');
+ });
} else if (type === 'text') {
- submitProblemEssayQuestion({ anserResult: submitObj });
+ topic.value.es_status = '01';
+ topic.value.anserResult = submitObj; // 正确答案文字内容
+ // submitProblemEssayQuestion({ anserResult: submitObj });
}
};
- // 发送语音
- const uploadRecordNow = (voicePath) => {
- //发送语音的时候就应该拿出转圈
- commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
- .then((res) => {
- let _res = JSON.parse(res.data);
- if (_res.rtnCode === '0000') {
- // {
- // "chatId":"CHAT025018122068202508232000590000000000000000000000000000000060",
- // "fileId":"S3F0250181220722025082320005900000676612",
- // "ossFileAddr":"http://25.18.122.66::9786/traoss/show//S3F0250181220722025082320005900000676612",
- // "transContent":"一二三四。"
- // }
- submitProblemEssayQuestion({
- anserResult: _res.body.transContent,
- ossKey: _res.body.fileId,
- ossAddr: _res.body.ossFileAddr,
- voicePath: voicePath
- });
- }
- })
- .catch((err) => {
- topic.es_status = ''; // 取消转圈
- common.msg('系统异常,请联系管理员');
- });
- };
// 发送文本
const submitAnswerNow = (val, cb = null) => {};
@@ -314,6 +351,7 @@
const addProblem = () => {
if (topicList.length >= storageTopicList.value.length) return false;
topicList.push(storageTopicList.value[topicList.length]);
+ console.log('topicList', topicList);
return true;
};
// 初始化时检查
@@ -330,7 +368,7 @@
...res,
isPreview: false,
clearResult: true,
- es_status: '', // 预设一下问答题的结果,'' 空为没有 00 转圈 01 播放,其他暂定
+ es_status: '', // 预设一下问答题的状态,'' 空为没有 00 转圈 01 播放,其他暂定
my_answer: []
}));
addProblem();
diff --git a/src/pagesA.json b/src/pagesA.json
index d06a95d5..c7d9c314 100644
--- a/src/pagesA.json
+++ b/src/pagesA.json
@@ -197,6 +197,15 @@
"titleNView": false
}
}
+ },
+ {
+ "path": "pages/courseRecord/courseStudyRecordDetail",
+ "style": {
+ "navigationBarTitleText": "课程记录学习记录详情",
+ "app-plus": {
+ "titleNView": false
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/src/static/images/courseRecord/duration.png b/src/static/images/courseRecord/duration.png
new file mode 100644
index 00000000..a4febe9d
Binary files /dev/null and b/src/static/images/courseRecord/duration.png differ
diff --git a/src/static/images/courseRecord/learn.png b/src/static/images/courseRecord/learn.png
new file mode 100644
index 00000000..233ba2ba
Binary files /dev/null and b/src/static/images/courseRecord/learn.png differ
diff --git a/src/static/images/courseRecord/time.png b/src/static/images/courseRecord/time.png
new file mode 100644
index 00000000..3b260027
Binary files /dev/null and b/src/static/images/courseRecord/time.png differ