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-2?y5q(s&atb}HY*Vkk!%V>ZLyrEmBa$A`XY_kV@zU?R+Zl`&8PRWe$`
z9nAgS%L8%_*!XirqjFPE)0()<0@4 answer.answerId === optionId);
+}
+
+// 判断答案是否正确
+export function isAnswerCorrect(question) {
+ if (!question.userAnswerBaseList || !question.userAnswerBaseList.length) return false;
+
+ // 获取所有正确答案的ID
+ const correctOptionIds = question.answerList
+ .filter(option => option.isTrue)
+ .map(option => option.id);
+
+ // 获取用户选择的答案ID
+ const userAnswerIds = [...new Set(question.userAnswerBaseList.map(answer => answer.answerId))];
+
+ // 判断用户选择的答案数量是否与正确答案数量相同
+ if (userAnswerIds.length !== correctOptionIds.length) {
+ return false;
+ }
+
+ // 判断用户选择的答案是否都是正确的
+ return userAnswerIds.every(answerId => correctOptionIds.includes(answerId));
+}
+
+export function isQuestionAnswered(question) {
+ if (question.type == '培训') {
+ // 填空题:检查是否有答案且答案不为空
+ return question.userAppletAnswerTrain &&
+ question.userAppletAnswerTrain.answer &&
+ question.userAppletAnswerTrain.answer.trim() !== '';
+ } else {
+ // 选择题:检查是否有选择的答案
+ return question.userAnswerBaseList && question.userAnswerBaseList.length > 0;
+ }
+}
+
+// 判断全部题目答案是否达到指定的准确率
+export function isSuccessPrecision(list, number = 100){
+
+ let errNumber = 0
+
+ for (var index = 0; index < list.length; index++) {
+ var question = list[index];
+ if (question.type == '基本' && !isAnswerCorrect(question)) {
+ errNumber++
+ }
+ }
+
+ console.log(errNumber, (list.length - errNumber) / list.length * 100);
+
+ if(((list.length - errNumber) / list.length * 100) < number){
+ return false
+ }
+
+ return true
+}
+
+export default {
+ isOptionSelected,
+ isAnswerCorrect,
+ isQuestionAnswered,
+ isSuccessPrecision,
+}
\ No newline at end of file
diff --git a/utils/getUrl.js b/utils/getUrl.js
index 986cc48..7757f93 100644
--- a/utils/getUrl.js
+++ b/utils/getUrl.js
@@ -1,6 +1,6 @@
-let current = "develop";
+let current = "trial";
const accountInfo = wx.getAccountInfoSync();
-// current = accountInfo.miniProgram.envVersion;
+current = accountInfo.miniProgram.envVersion;
const api = {
develop:"http://127.0.0.1:8002",
diff --git a/utils/serviceTime.js b/utils/serviceTime.js
index 80c24b3..4ea40c1 100644
--- a/utils/serviceTime.js
+++ b/utils/serviceTime.js
@@ -35,6 +35,8 @@ export function getProductNameText(petId, productList, orderServiceList) {
let list = (productList
.filter(product => orderService.filter(service => service.id == product.orderServiceId).length > 0)
.map(product => product.productName))
+
+ list = list.reverse();
return [...new Set(list)]
}