11wqe1 il y a 3 semaines
Parent
commit
631a0a5a4e
1 fichiers modifiés avec 10 ajouts et 19 suppressions
  1. 10 19
      cocostudy.js

+ 10 - 19
cocostudy.js

@@ -5,13 +5,13 @@ const mysql = require("./mysql");
 const router = express.Router();
 const crypto = require("crypto");
 // 本地
-// const _mysqlLabor = ["183.36.26.8", "pbl"];
+const _mysqlLabor = ["183.36.26.8", "pbl"];
 // const _mysqluser = ["183.36.26.8", "cocorobouser"];
 // const _getmysqlLabor2 = ["183.36.26.8", "pbl"];
 // const _getmysqlLabor = ["183.36.26.8", "pbl"];
 
 // 线上
-const _mysqlLabor = ["172.16.12.5", "pbl"];
+// const _mysqlLabor = ["172.16.12.5", "pbl"];
 // const _mysqluser = ["172.16.12.5", "cocorobouser"];
 // const _getmysqlLabor2 = ["172.16.12.7", "pbl"];
 // const _getmysqlLabor = ["172.16.12.7", "pbl"];
@@ -85,17 +85,8 @@ const aiBatchCorrectionBtn = (item, aiBatchCorrection) => {
   const _test = [];
 
   testjson.forEach((w) => {
-    if (w.tool === "choice") {
-      work.score[w.id] = 0;
-      if (w.answer && _work[w.id]) {
-        const correctAnswer = JSON.stringify([...w.answer].sort());
-        const userAnswer = JSON.stringify([...(_work[w.id] || [])].sort());
-        work.score[w.id] = correctAnswer === userAnswer ? w.score : 0;
-      }
-    } else {
       _test.push(w);
       work.score[w.id] = 0;
-    }
   });
 
   aiBatchCorrection.push({
@@ -182,7 +173,7 @@ const aiGradingBatchCorrection = async (aiBatchCorrection, val) => {
         figure_image_urls: _imgSrc,
       },
       student_file_urls: Array.isArray(_userAnswer) ? _userAnswer.map((u) => u.url) : [],
-      student_answer_text: ["fill", "qa"].includes(val.test[i].tool) ? _userAnswer : "",
+      student_answer_text: ["fill", "qa", "choice"].includes(val.test[i].tool) ? _userAnswer : "",
       model: "gpt-5.4",
     };
 
@@ -535,13 +526,13 @@ async function insertChat(answer, spaceId, userId) {
 
 
 // 定时任务:每10分钟触发一次
-schedule.scheduleJob("*/10 * * * *", async () => {
-  try {
-    await runAutoScoSafe();
-  } catch (error) {
-    console.error("[cocostudy] 定时任务异常", error.message || error);
-  }
-});
+// schedule.scheduleJob("*/10 * * * *", async () => {
+//   try {
+//     await runAutoScoSafe();
+//   } catch (error) {
+//     console.error("[cocostudy] 定时任务异常", error.message || error);
+//   }
+// });
 
 // 手动触发:GET/POST /api/cocostudy/autosco
 router.all("/autosco", async (req, res) => {