|
|
@@ -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"];
|
|
|
@@ -84,9 +84,17 @@ const aiBatchCorrectionBtn = (item, aiBatchCorrection) => {
|
|
|
};
|
|
|
const _test = [];
|
|
|
|
|
|
- testjson.forEach((w) => {
|
|
|
+ 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({
|
|
|
@@ -173,7 +181,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", "choice"].includes(val.test[i].tool) ? _userAnswer : "",
|
|
|
+ student_answer_text: ["fill", "qa"].includes(val.test[i].tool) ? (_userAnswer ? _userAnswer :'暂无数据') : "",
|
|
|
model: "gpt-5.4",
|
|
|
};
|
|
|
|
|
|
@@ -526,13 +534,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) => {
|