yangg пре 2 месеци
родитељ
комит
94c7344430

+ 4 - 0
api/user.js

@@ -124,5 +124,9 @@ export const getInterviewDetail = (params) => {
   return http.get('/system/interview_question/detail', params);
 };
 
+/* 提交答案 */
+export const submitAnswer = (params) => {
+  return http.post('/api/job/submit_answer', params);
+};
 
 

+ 246 - 77
pages/camera/camera.vue

@@ -47,7 +47,25 @@
 					</view>
 
 					<view class="options">
-						<view v-for="(option, index) in currentQuestion.options" :key="index" class="option-item"
+						<!-- 开放问题 (question_form: 0) - 显示文本输入框 -->
+							<!-- {{ currentQuestion }} -->
+						<view v-if="currentQuestion.questionType == 0" class="open-question-container">
+						
+							<textarea 
+								class="open-question-input" 
+								v-model="openQuestionAnswer" 
+								placeholder="请输入您的回答..."
+								maxlength="500"
+							></textarea>
+							<view class="word-count">{{openQuestionAnswer.length}}/500</view>
+						</view>
+						
+						<!-- 单选题和多选题 (question_form: 1 或 2) -->
+						<view 
+							v-else
+							v-for="(option, index) in currentQuestion.options" 
+							:key="index" 
+							class="option-item"
 							:class="{
 								'option-selected': currentQuestion.questionType === 1 ? selectedOption === index : selectedOptions.includes(index),
 								'option-correct': showResult && (
@@ -60,17 +78,22 @@
 								)
 							}" 
 							@click="selectOption(index)">
-							<!-- {{JSON.parse(option) }} -->
+							<!-- 选项前添加单选/多选标识 -->
+							<text class="option-prefix">{{currentQuestion.questionType === 1 ? '●' : '☐'}}</text>
 							<text class="option-text">{{ option.option_text || (typeof option === 'string' ? option : JSON.stringify(option)) }}</text>
 						</view>
 					</view>
 
-					<view class="timer-container">
+					<!-- <view class="timer-container">
 						<text class="timer-text">本题剩余时间 {{remainingTime}}</text>
-					</view>
+					</view> -->
 					
 					<button class="next-button" @click="nextQuestion" 
-						:disabled="currentQuestion.questionType === 1 ? selectedOption === null : selectedOptions.length === 0">
+						:disabled="
+							(currentQuestion.questionType === 0 && openQuestionAnswer.trim() === '') || 
+							(currentQuestion.questionType === 1 && selectedOption === null) || 
+							(currentQuestion.questionType === 2 && selectedOptions.length === 0)
+						">
 						{{showResult ? '下一题' : '提交答案'}}
 					</button>
 				</view>
@@ -87,8 +110,8 @@
 		<view class="interview-end-modal" v-if="showEndModal">
 			<view class="modal-content">
 				<view class="modal-title">测试已完成</view>
-				<view class="score-display">{{score}}/{{totalQuestions}}</view>
-				<view class="modal-message">您在本次中国传统文化测试中答了{{score}}道题目,共{{totalQuestions}}道题目。</view>
+				<!-- <view class="score-display">{{score}}/{{totalQuestions}}</view>
+				<view class="modal-message">您在本次测试中答了{{score}}道题目,共{{totalQuestions}}道题目。</view> -->
 				<view class="modal-buttons">
 					<button type="default" class="modal-button" @click="restartTest">重新测试</button>
 					<button type="primary" class="modal-button" @click="back">返回首页</button>
@@ -154,7 +177,11 @@
 				digitalHumanUrl: '', // 数字人URL
 				loading: true, // 添加加载状态
 				loadError: false, // 添加加载错误状态
-				errorMessage: '' // 添加错误消息
+				errorMessage: '', // 添加错误消息
+				answers: [], // 存储用户的所有答案
+				currentQuestionDetail: null, // 当前题目详情
+				isSubmitting: false, // 是否正在提交答案
+				openQuestionAnswer: '', // 存储开放问题的答案
 			}
 		},
 		computed: {
@@ -192,8 +219,8 @@
 					const res = await getInterviewList();
 					console.log(res);
 										// 使用第一个面试
-					this.interviewId = res.items[0].id;
-					this.fetchInterviewData();
+					this.interviewId = res.items//[0].id;
+					this.fetchInterviewData(res.items);
 				} catch (error) {
 					console.error('获取面试列表失败:', error);
 					this.handleLoadError('获取面试列表失败');
@@ -201,23 +228,23 @@
 			},
 			
 			// 获取面试详情数据
-			async fetchInterviewData() {
+			async fetchInterviewData(data) {
 				try {
 					this.loading = true;
-					const res = await getInterviewDetail({ id: this.interviewId });
-					console.log('API返回数据:', res);
+					// const res = await getInterviewDetail({ id: this.interviewId });
+					// console.log('API返回数据:', res);
 					
 					// 如果返回的是问题列表
-					if (res && Array.isArray(res.items)) {
+					if (data && Array.isArray(data)) {
 						// 处理多个问题
-						this.questions = res.items.map((q, index) => ({
+						this.questions =data.map((q, index) => ({
 							id: q.id || index + 1,
 							text: q.question || '未知问题',
 							options:q.options || [],
 							correctAnswer: q.correctAnswer || 0,
 							isImportant: q.is_system || false,
 							explanation: q.explanation || '',
-							questionType: q.question_form || 1,
+							questionType: q.question_form,
 							questionTypeName: q.question_form_name || '单选题',
 							correctAnswers: q.correct_answers || [],
 							difficulty: q.difficulty || 1,
@@ -258,7 +285,7 @@
 						correctAnswer: data.correctAnswer || 0,
 						isImportant: data.is_system || false,
 						explanation: data.explanation || '',
-						questionType: data.question_form || 1, // 1-单选题,2-多选题
+						questionType: data.question_form, // 1-单选题,2-多选题
 						questionTypeName: data.question_form_name || '单选题',
 						correctAnswers: data.correct_answers || [],
 						difficulty: data.difficulty || 1,
@@ -329,7 +356,7 @@
 						// 否则添加到已选中数组
 						this.selectedOptions.push(index);
 					}
-				} else { // 单选题
+				} else if (this.currentQuestion.questionType === 1) { // 单选题
 					this.selectedOption = index;
 				}
 				
@@ -346,98 +373,208 @@
 				}
 				
 				// 根据题目类型检查答案是否正确
-				if (this.currentQuestion.questionType === 2) { // 多选题
-					// 对于多选题,需要比较选中的选项数组和正确答案数组
-					// 先排序以确保顺序一致
+				if (this.currentQuestion.questionType === 0) { // 开放问题
+					// 开放问题没有标准答案,可以根据需要设置为正确或待评估
+					this.isAnswerCorrect = true; // 或者设置为 null 表示待评估
+				} else if (this.currentQuestion.questionType === 2) { // 多选题
 					const sortedSelected = [...this.selectedOptions].sort();
 					const sortedCorrect = [...this.currentQuestion.correctAnswers].sort();
 					
-					// 检查长度是否相同
 					if (sortedSelected.length !== sortedCorrect.length) {
 						this.isAnswerCorrect = false;
 					} else {
-						// 检查每个元素是否相同
 						this.isAnswerCorrect = sortedSelected.every((value, index) => value === sortedCorrect[index]);
 					}
 				} else { // 单选题
 					this.isAnswerCorrect = this.selectedOption === this.currentQuestion.correctAnswer;
 				}
 				
-				// 更新分数
-				if (this.isAnswerCorrect) {
-					this.score++;
-				}
-				
 				// 显示结果
 				this.showResult = true;
+			},
+
+			nextQuestion() {
+				// 如果还没有显示结果,先检查答案
+				if (!this.showResult) {
+					this.checkAnswer();
+					return;
+				}
 				
-				// 检查是否是最后一题
-				if (this.currentQuestionIndex === this.questions.length - 1) {
-					// 显示AI面试结束页面
-					setTimeout(() => {
-						// this.showEndModal = true;
-						this.interviewCompleted = false;
-					}, 1500);
+				// 保存当前题目的答案
+				this.saveAnswer();
+				
+				// 如果是最后一题,提交所有答案
+				if (this.currentQuestionIndex >= this.questions.length - 1) {
+					// 显示结果页面
+					this.showEndModal = true;
 					return;
 				}
 				
-				// 不是最后一题,延迟后进入下一题
-				setTimeout(() => {
-					this.goToNextQuestion();
-				}, 1500);
+				// 前往下一题
+				this.goToNextQuestion();
 			},
 
-			nextQuestion() {
-				// 如果还没有显示结果,先检查答案
-				if (this.currentQuestion.questionType === 2) { // 多选题
-					if (this.selectedOptions.length > 0 && !this.showResult) {
-						this.checkAnswer();
-					}
-				} else { // 单选题
-					if (this.selectedOption !== null && !this.showResult) {
-						this.checkAnswer();
-					} else if (this.showResult) {
-						// 如果已经显示结果,进入下一题
-						this.goToNextQuestion();
-					}
+			// 保存当前题目的答案
+			saveAnswer() {
+				let answer;
+				
+				if (this.currentQuestion.questionType === 0) { // 开放问题
+					answer = {
+						questionId: this.currentQuestion.id,
+						questionType: this.currentQuestion.questionType,
+						answer: this.openQuestionAnswer
+					};
+				} else { // 单选或多选
+					answer = {
+						questionId: this.currentQuestion.id,
+						questionType: this.currentQuestion.questionType,
+						answer: this.currentQuestion.questionType === 1 ? 
+							this.selectedOption : this.selectedOptions
+					};
 				}
+				
+				// 检查是否已存在该题目的答案,如果存在则更新
+				const existingIndex = this.answers.findIndex(a => a.questionId === answer.questionId);
+				if (existingIndex > -1) {
+					this.answers[existingIndex] = answer;
+				} else {
+					this.answers.push(answer);
+				}
+				
+				console.log('已保存答案:', this.answers);
 			},
-
-			// 新增方法,处理进入下一题的逻辑
-			goToNextQuestion() {
+			
+			// 提交所有答案
+			async submitAllAnswers() {
+				if (this.isSubmitting) return;
+				
+				try {
+					this.isSubmitting = true;
+					
+					// 显示提交中提示
+					uni.showLoading({
+						title: '正在提交答案...'
+					});
+					
+					// 构建提交数据
+					const submitData = {
+						interviewId: this.interviewId,
+						answers: this.answers
+					};
+					
+					// 这里需要添加您的API调用
+					// const res = await submitInterviewAnswers(submitData);
+					
+					// 模拟API调用
+					await new Promise(resolve => setTimeout(resolve, 1000));
+					
+					// 隐藏加载提示
+					uni.hideLoading();
+					
+					// 显示成功提示
+					uni.showToast({
+						title: '提交成功',
+						icon: 'success'
+					});
+					
+					// 关闭结果页面,可以选择跳转到其他页面
+					setTimeout(() => {
+						this.back();
+					}, 1500);
+					
+				} catch (error) {
+					console.error('提交答案失败:', error);
+					uni.showToast({
+						title: '提交答案失败,请重试',
+						icon: 'none'
+					});
+				} finally {
+					this.isSubmitting = false;
+				}
+			},
+			
+			// 修改 goToNextQuestion 方法,添加 async 关键字
+			async goToNextQuestion() {
 				// 重置状态
 				this.showResult = false;
 				this.selectedOption = null;
-				this.selectedOptions = []; // 重置多选题选项
+				this.selectedOptions = [];
+				this.openQuestionAnswer = ''; // 重置开放问题答案
 				
 				// 前往下一题
 				this.currentQuestionIndex++;
 				
-				// 检查是否已完成所有题目
-				if (this.currentQuestionIndex >= this.questions.length) {
-					// 显示AI面试结束页面,确保弹窗不显示
-					this.showEndModal = true;
-					this.interviewCompleted = false;
+				// 如果已经有下一题的详情,直接使用
+				if (this.questions[this.currentQuestionIndex]) {
+					// 更新进度
+					this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
+					
+					// 重置计时器
+					this.resetTimer();
+					
+					// 播放AI介绍下一题
+					this.playAiSpeaking();
+					
+					setTimeout(() => {
+						this.pauseAiSpeaking();
+					}, 2000);
 					
-					// 确保清除计时器
-					if (this.timerInterval) {
-						clearInterval(this.timerInterval);
-					}
 					return;
 				}
 				
-				// 重置计时器
-				this.resetTimer();
-				
-				// 更新进度
-				this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
-
-				// 播放AI介绍下一题
-				this.playAiSpeaking();
-
-				setTimeout(() => {
-					this.pauseAiSpeaking();
-				}, 2000);
+				// 否则请求下一题详情
+				try {
+					this.loading = true;
+					
+					// 假设您有一个获取单个题目详情的API
+					// const res = await getQuestionDetail({ 
+					//   interviewId: this.interviewId,
+					//   questionIndex: this.currentQuestionIndex 
+					// });
+					
+					// 模拟API调用
+					await new Promise(resolve => setTimeout(resolve, 1000));
+					const res = { /* 模拟的题目数据 */ };
+					
+					// 处理题目数据
+					if (res) {
+						const formattedQuestion = {
+							id: res.id || this.currentQuestionIndex + 1,
+							text: res.question || '未知问题',
+							options: res.options || [],
+							correctAnswer: res.correctAnswer || 0,
+							isImportant: res.is_system || false,
+							explanation: res.explanation || '',
+							questionType: res.question_form || 1,
+							questionTypeName: res.question_form_name || '单选题',
+							correctAnswers: res.correct_answers || [],
+							difficulty: res.difficulty || 1,
+							difficultyName: res.difficulty_name || '初级'
+						};
+						
+						// 添加到问题列表
+						this.questions.push(formattedQuestion);
+					}
+					
+				} catch (error) {
+					console.error('获取题目详情失败:', error);
+					uni.showToast({
+						title: '获取题目失败,请重试',
+						icon: 'none'
+					});
+					
+					// 出错时回到上一题
+					this.currentQuestionIndex--;
+					
+				} finally {
+					this.loading = false;
+					
+					// 更新进度
+					this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
+					
+					// 重置计时器
+					this.resetTimer();
+				}
 			},
 
 			toggleSettings() {
@@ -1005,4 +1142,36 @@
 		border-radius: 6rpx;
 		margin-right: 10rpx;
 	}
+
+	/* 新增的开放问题样式 */
+	.open-question-container {
+		display: flex;
+		flex-direction: column;
+		width: 100%;
+		margin-bottom: 20rpx;
+	}
+
+	.open-question-input {
+		width: 100%;
+		height: 300rpx;
+		background-color: #f9f9f9;
+		border: 1px solid #e0e0e0;
+		border-radius: 10rpx;
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #333;
+	}
+
+	.word-count {
+		text-align: right;
+		font-size: 24rpx;
+		color: #999;
+		margin-top: 10rpx;
+	}
+
+	.option-prefix {
+		margin-right: 10rpx;
+		color: #6c5ce7;
+		font-weight: bold;
+	}
 </style>

+ 0 - 4
unpackage/dist/dev/mp-weixin/api/user.js

@@ -54,11 +54,7 @@ const fillUserInfo = (params) => {
 const getInterviewList = (params) => {
   return utils_request.http.get("/system/interview_question/list", params);
 };
-const getInterviewDetail = (params) => {
-  return utils_request.http.get("/system/interview_question/detail", params);
-};
 exports.fillUserInfo = fillUserInfo;
-exports.getInterviewDetail = getInterviewDetail;
 exports.getInterviewList = getInterviewList;
 exports.getJobList = getJobList;
 exports.getUserInfo = getUserInfo;

+ 142 - 58
unpackage/dist/dev/mp-weixin/pages/camera/camera.js

@@ -33,8 +33,16 @@ const _sfc_main = {
       // 添加加载状态
       loadError: false,
       // 添加加载错误状态
-      errorMessage: ""
+      errorMessage: "",
       // 添加错误消息
+      answers: [],
+      // 存储用户的所有答案
+      currentQuestionDetail: null,
+      // 当前题目详情
+      isSubmitting: false,
+      // 是否正在提交答案
+      openQuestionAnswer: ""
+      // 存储开放问题的答案
     };
   },
   computed: {
@@ -63,30 +71,28 @@ const _sfc_main = {
     async fetchInterviewList() {
       try {
         this.loading = true;
-        const res = await api_user.getInterviewList();
-        console.log(res);
-        this.interviewId = res.items[0].id;
-        this.fetchInterviewData();
+        const res2 = await api_user.getInterviewList();
+        console.log(res2);
+        this.interviewId = res2.items;
+        this.fetchInterviewData(res2.items);
       } catch (error) {
         console.error("获取面试列表失败:", error);
         this.handleLoadError("获取面试列表失败");
       }
     },
     // 获取面试详情数据
-    async fetchInterviewData() {
+    async fetchInterviewData(data) {
       try {
         this.loading = true;
-        const res = await api_user.getInterviewDetail({ id: this.interviewId });
-        console.log("API返回数据:", res);
-        if (res && Array.isArray(res.items)) {
-          this.questions = res.items.map((q, index) => ({
+        if (data && Array.isArray(data)) {
+          this.questions = data.map((q, index) => ({
             id: q.id || index + 1,
             text: q.question || "未知问题",
             options: q.options || [],
             correctAnswer: q.correctAnswer || 0,
             isImportant: q.is_system || false,
             explanation: q.explanation || "",
-            questionType: q.question_form || 1,
+            questionType: q.question_form,
             questionTypeName: q.question_form_name || "单选题",
             correctAnswers: q.correct_answers || [],
             difficulty: q.difficulty || 1,
@@ -118,7 +124,7 @@ const _sfc_main = {
           correctAnswer: data.correctAnswer || 0,
           isImportant: data.is_system || false,
           explanation: data.explanation || "",
-          questionType: data.question_form || 1,
+          questionType: data.question_form,
           // 1-单选题,2-多选题
           questionTypeName: data.question_form_name || "单选题",
           correctAnswers: data.correct_answers || [],
@@ -174,7 +180,7 @@ const _sfc_main = {
         } else {
           this.selectedOptions.push(index);
         }
-      } else {
+      } else if (this.currentQuestion.questionType === 1) {
         this.selectedOption = index;
       }
       this.playAiSpeaking();
@@ -185,7 +191,9 @@ const _sfc_main = {
         console.error("当前问题不存在");
         return;
       }
-      if (this.currentQuestion.questionType === 2) {
+      if (this.currentQuestion.questionType === 0) {
+        this.isAnswerCorrect = true;
+      } else if (this.currentQuestion.questionType === 2) {
         const sortedSelected = [...this.selectedOptions].sort();
         const sortedCorrect = [...this.currentQuestion.correctAnswers].sort();
         if (sortedSelected.length !== sortedCorrect.length) {
@@ -196,53 +204,126 @@ const _sfc_main = {
       } else {
         this.isAnswerCorrect = this.selectedOption === this.currentQuestion.correctAnswer;
       }
-      if (this.isAnswerCorrect) {
-        this.score++;
-      }
       this.showResult = true;
-      if (this.currentQuestionIndex === this.questions.length - 1) {
-        setTimeout(() => {
-          this.interviewCompleted = false;
-        }, 1500);
+    },
+    nextQuestion() {
+      if (!this.showResult) {
+        this.checkAnswer();
+        return;
+      }
+      this.saveAnswer();
+      if (this.currentQuestionIndex >= this.questions.length - 1) {
+        this.showEndModal = true;
         return;
       }
-      setTimeout(() => {
-        this.goToNextQuestion();
-      }, 1500);
+      this.goToNextQuestion();
     },
-    nextQuestion() {
-      if (this.currentQuestion.questionType === 2) {
-        if (this.selectedOptions.length > 0 && !this.showResult) {
-          this.checkAnswer();
-        }
+    // 保存当前题目的答案
+    saveAnswer() {
+      let answer;
+      if (this.currentQuestion.questionType === 0) {
+        answer = {
+          questionId: this.currentQuestion.id,
+          questionType: this.currentQuestion.questionType,
+          answer: this.openQuestionAnswer
+        };
       } else {
-        if (this.selectedOption !== null && !this.showResult) {
-          this.checkAnswer();
-        } else if (this.showResult) {
-          this.goToNextQuestion();
-        }
+        answer = {
+          questionId: this.currentQuestion.id,
+          questionType: this.currentQuestion.questionType,
+          answer: this.currentQuestion.questionType === 1 ? this.selectedOption : this.selectedOptions
+        };
+      }
+      const existingIndex = this.answers.findIndex((a) => a.questionId === answer.questionId);
+      if (existingIndex > -1) {
+        this.answers[existingIndex] = answer;
+      } else {
+        this.answers.push(answer);
       }
+      console.log("已保存答案:", this.answers);
     },
-    // 新增方法,处理进入下一题的逻辑
-    goToNextQuestion() {
+    // 提交所有答案
+    async submitAllAnswers() {
+      if (this.isSubmitting)
+        return;
+      try {
+        this.isSubmitting = true;
+        common_vendor.index.showLoading({
+          title: "正在提交答案..."
+        });
+        const submitData = {
+          interviewId: this.interviewId,
+          answers: this.answers
+        };
+        await new Promise((resolve) => setTimeout(resolve, 1e3));
+        common_vendor.index.hideLoading();
+        common_vendor.index.showToast({
+          title: "提交成功",
+          icon: "success"
+        });
+        setTimeout(() => {
+          this.back();
+        }, 1500);
+      } catch (error) {
+        console.error("提交答案失败:", error);
+        common_vendor.index.showToast({
+          title: "提交答案失败,请重试",
+          icon: "none"
+        });
+      } finally {
+        this.isSubmitting = false;
+      }
+    },
+    // 修改 goToNextQuestion 方法,添加 async 关键字
+    async goToNextQuestion() {
       this.showResult = false;
       this.selectedOption = null;
       this.selectedOptions = [];
+      this.openQuestionAnswer = "";
       this.currentQuestionIndex++;
-      if (this.currentQuestionIndex >= this.questions.length) {
-        this.showEndModal = true;
-        this.interviewCompleted = false;
-        if (this.timerInterval) {
-          clearInterval(this.timerInterval);
-        }
+      if (this.questions[this.currentQuestionIndex]) {
+        this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
+        this.resetTimer();
+        this.playAiSpeaking();
+        setTimeout(() => {
+          this.pauseAiSpeaking();
+        }, 2e3);
         return;
       }
-      this.resetTimer();
-      this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
-      this.playAiSpeaking();
-      setTimeout(() => {
-        this.pauseAiSpeaking();
-      }, 2e3);
+      try {
+        this.loading = true;
+        await new Promise((resolve) => setTimeout(resolve, 1e3));
+        const res2 = {
+          /* 模拟的题目数据 */
+        };
+        if (res2) {
+          const formattedQuestion = {
+            id: res2.id || this.currentQuestionIndex + 1,
+            text: res2.question || "未知问题",
+            options: res2.options || [],
+            correctAnswer: res2.correctAnswer || 0,
+            isImportant: res2.is_system || false,
+            explanation: res2.explanation || "",
+            questionType: res2.question_form || 1,
+            questionTypeName: res2.question_form_name || "单选题",
+            correctAnswers: res2.correct_answers || [],
+            difficulty: res2.difficulty || 1,
+            difficultyName: res2.difficulty_name || "初级"
+          };
+          this.questions.push(formattedQuestion);
+        }
+      } catch (error) {
+        console.error("获取题目详情失败:", error);
+        common_vendor.index.showToast({
+          title: "获取题目失败,请重试",
+          icon: "none"
+        });
+        this.currentQuestionIndex--;
+      } finally {
+        this.loading = false;
+        this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
+        this.resetTimer();
+      }
     },
     toggleSettings() {
       common_vendor.index.showToast({
@@ -346,7 +427,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   }, $options.currentQuestion.isImportant ? {} : {}, {
     h: common_vendor.t($options.currentQuestion.questionTypeName),
     i: common_vendor.t($options.currentQuestion.text),
-    j: common_vendor.f($options.currentQuestion.options, (option, index, i0) => {
+    j: $options.currentQuestion.questionType == 0
+  }, $options.currentQuestion.questionType == 0 ? {
+    k: $data.openQuestionAnswer,
+    l: common_vendor.o(($event) => $data.openQuestionAnswer = $event.detail.value),
+    m: common_vendor.t($data.openQuestionAnswer.length)
+  } : {
+    n: common_vendor.f($options.currentQuestion.options, (option, index, i0) => {
       return {
         a: common_vendor.t(option.option_text || (typeof option === "string" ? option : JSON.stringify(option))),
         b: index,
@@ -356,16 +443,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
         f: common_vendor.o(($event) => $options.selectOption(index), index)
       };
     }),
-    k: common_vendor.t($data.remainingTime),
-    l: common_vendor.t($data.showResult ? "下一题" : "提交答案"),
-    m: common_vendor.o((...args) => $options.nextQuestion && $options.nextQuestion(...args)),
-    n: $options.currentQuestion.questionType === 1 ? $data.selectedOption === null : $data.selectedOptions.length === 0,
-    o: $data.showEndModal
+    o: common_vendor.t($options.currentQuestion.questionType === 1 ? "●" : "☐")
+  }, {
+    p: common_vendor.t($data.showResult ? "下一题" : "提交答案"),
+    q: common_vendor.o((...args) => $options.nextQuestion && $options.nextQuestion(...args)),
+    r: $options.currentQuestion.questionType === 0 && $data.openQuestionAnswer.trim() === "" || $options.currentQuestion.questionType === 1 && $data.selectedOption === null || $options.currentQuestion.questionType === 2 && $data.selectedOptions.length === 0,
+    s: $data.showEndModal
   }, $data.showEndModal ? {
-    p: common_vendor.t($data.score),
-    q: common_vendor.t($data.totalQuestions),
-    r: common_vendor.t($data.score),
-    s: common_vendor.t($data.totalQuestions),
     t: common_vendor.o((...args) => $options.restartTest && $options.restartTest(...args)),
     v: common_vendor.o((...args) => $options.back && $options.back(...args))
   } : {}, {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/camera/camera.wxml


+ 29 - 0
unpackage/dist/dev/mp-weixin/pages/camera/camera.wxss

@@ -387,3 +387,32 @@
 		border-radius: 6rpx;
 		margin-right: 10rpx;
 }
+
+	/* 新增的开放问题样式 */
+.open-question-container {
+		display: flex;
+		flex-direction: column;
+		width: 100%;
+		margin-bottom: 20rpx;
+}
+.open-question-input {
+		width: 100%;
+		height: 300rpx;
+		background-color: #f9f9f9;
+		border: 1px solid #e0e0e0;
+		border-radius: 10rpx;
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #333;
+}
+.word-count {
+		text-align: right;
+		font-size: 24rpx;
+		color: #999;
+		margin-top: 10rpx;
+}
+.option-prefix {
+		margin-right: 10rpx;
+		color: #6c5ce7;
+		font-weight: bold;
+}

Неке датотеке нису приказане због велике количине промена