【修改】判分文件写入对号错号

This commit is contained in:
huababa1
2025-07-04 19:38:24 +08:00
parent 48f585227c
commit f30049d883
2 changed files with 38 additions and 38 deletions

View File

@@ -242,13 +242,13 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (table1Columns.equals(table2Columns)) { if (table1Columns.equals(table2Columns)) {
appendToFile(answerLogPath, "【执行】"+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】"+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSQL,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSQL,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】 "+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+showCreateTableSql+"】【验证】【表】【"+tableName+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(stuSQL, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(stuSQL, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -322,14 +322,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (isEquivalent) { if (isEquivalent) {
appendToFile(answerLogPath, "【执行】"+""+yanzheng+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】"+""+yanzheng+"】【验证】【表】【"+tableName+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+yanzheng+"】【验证】【表】【"+tableName+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+yanzheng+"】【验证】【表】【"+tableName+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSql,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSql,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】"+""+yanzheng+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】"+""+yanzheng+"】【验证】【表】【"+tableName+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+yanzheng+"】【验证】【表】【"+tableName+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+yanzheng+"】【验证】【表】【"+tableName+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(stuSql, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(stuSql, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -377,14 +377,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
//累加删除语句的所有权值 examQuestionKeywords累加scorerate //累加删除语句的所有权值 examQuestionKeywords累加scorerate
// appendToFile(answerLogPath, "验证通过:符合 DELETE 条件的记录已删除。"); // appendToFile(answerLogPath, "验证通过:符合 DELETE 条件的记录已删除。");
// judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "验证通过:符合 DELETE 条件的记录已删除。"); // judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "验证通过:符合 DELETE 条件的记录已删除。");
appendToFile(answerLogPath, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,sql,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,sql,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+verifySql+"】 【验证】 【表】 【"+tableName+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(null, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(null, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -392,7 +392,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
} }
}catch (SQLException e) { }catch (SQLException e) {
appendToFile(answerLogPath, "验证学生库失败,"+"得分0【"); appendToFile(answerLogPath, "验证学生库失败,"+"得分0【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "验证学生库失败,"+"得分0【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "验证学生库失败,"+"得分0【❌】");
} }
@@ -485,14 +485,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
// //
if (isEquivalent) { if (isEquivalent) {
appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSql,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSql,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】 "+""+selectSql+"】【验证】【表】【"+tableName+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(stuSql, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(stuSql, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -561,7 +561,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
Statement stmtstu = connstu.createStatement()) { Statement stmtstu = connstu.createStatement()) {
if (StringUtils.isBlank(stuAnswer.get())) { if (StringUtils.isBlank(stuAnswer.get())) {
SourceAndText sourceAndTextError = new SourceAndText(); SourceAndText sourceAndTextError = new SourceAndText();
appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【"); appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【❌】");
sourceAndTextError.setText(judgementStr); sourceAndTextError.setText(judgementStr);
sourceAndTextError.setScore(0.0); sourceAndTextError.setScore(0.0);
@@ -585,7 +585,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
if (isEquivalent) { if (isEquivalent) {
appendToFile(answerLogPath, "执行"+sql+"验证文件【"+fileName.get()+"】【"); appendToFile(answerLogPath, "执行"+sql+"验证文件【"+fileName.get()+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"执行"+sql+"验证文件【"+fileName.get()+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"执行"+sql+"验证文件【"+fileName.get()+"】【✅】");
//todo 得分 //todo 得分
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,String.valueOf(stuAnswer),totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,String.valueOf(stuAnswer),totalKeyScore,score,answerId,scoreTotal,judgementStr);
@@ -593,7 +593,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "执行"+sql+"验证文件【"+fileName.get()+"】【"); appendToFile(answerLogPath, "执行"+sql+"验证文件【"+fileName.get()+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"执行"+sql+"验证文件【"+fileName.get()+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"执行"+sql+"验证文件【"+fileName.get()+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(String.valueOf(stuAnswer), examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(String.valueOf(stuAnswer), examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -663,11 +663,11 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (result1!=null&&result1.size()>0){ if (result1!=null&&result1.size()>0){
if (result2!=null&&result2.size()>0){ if (result2!=null&&result2.size()>0){
if (result1.size()==result2.size()){ if (result1.size()==result2.size()){
appendToFile(answerLogPath, "【记录数】【"+result1.size()+"】【"); appendToFile(answerLogPath, "【记录数】【"+result1.size()+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【记录数】【"+result1.size()+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【记录数】【"+result1.size()+"】【✅】");
} }
}else { }else {
appendToFile(answerLogPath, "【记录数】【"+result1.size()+"】【"); appendToFile(answerLogPath, "【记录数】【"+result1.size()+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【记录数】【"+result1.size()+"】❌"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【记录数】【"+result1.size()+"】❌");
} }
} }
@@ -678,14 +678,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (isEquivalent) { if (isEquivalent) {
appendToFile(answerLogPath, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+""); appendToFile(answerLogPath, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"【√】");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSQL,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuSQL,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】 "+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【"); appendToFile(answerLogPath, "【执行】 "+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "【执行】"+""+showCreateViewSql+"】【验证】【视图】【"+viewNam1+"】【❌】");
SourceAndText studentScorePojo= calculateTotalScoreRate(stuSQL, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo= calculateTotalScoreRate(stuSQL, examMysqlKeywordList,totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -764,8 +764,8 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
Statement stmtstu = connstu.createStatement()) { Statement stmtstu = connstu.createStatement()) {
if (StringUtils.isBlank(stuAnswer.get())) { if (StringUtils.isBlank(stuAnswer.get())) {
SourceAndText sourceAndTextError = new SourceAndText(); SourceAndText sourceAndTextError = new SourceAndText();
appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【"); appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【×");
sourceAndTextError.setText(judgementStr); sourceAndTextError.setText(judgementStr);
sourceAndTextError.setScore(0.0); sourceAndTextError.setScore(0.0);
continue; continue;
@@ -790,14 +790,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (flag) { if (flag) {
//todo 得分 //todo 得分
appendToFile(answerLogPath, "【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【"); appendToFile(answerLogPath, "【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【执行】"+extractCallStatements+"【验证】【文件】 【"+fileName.get()+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【执行】"+extractCallStatements+"【验证】【文件】 【"+fileName.get()+"】【✅】");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuAnswer.get(),totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,stuAnswer.get(),totalKeyScore,score,answerId,scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
} else { } else {
appendToFile(answerLogPath, "【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【"); appendToFile(answerLogPath, "【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【执行】"+extractCallStatements+"【验证】【文件】【"+fileName.get()+"】【❌】");
//得分 //得分
@@ -884,7 +884,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
Statement stmtstu = connstu.createStatement()) { Statement stmtstu = connstu.createStatement()) {
if (StringUtils.isBlank(stuAnswer.get())) { if (StringUtils.isBlank(stuAnswer.get())) {
SourceAndText sourceAndTextError = new SourceAndText(); SourceAndText sourceAndTextError = new SourceAndText();
appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【"); appendToFile(answerLogPath, "考生SQL文件丢失或未作答无法评分得分0.0【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "考生SQL文件丢失或未作答无法评分得分0.0【❌】");
sourceAndTextError.setText(judgementStr); sourceAndTextError.setText(judgementStr);
sourceAndTextError.setScore(0.0); sourceAndTextError.setScore(0.0);
@@ -928,7 +928,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
boolean equals = normalizedTriggerSql1.equals(normalizedTriggerSql2); boolean equals = normalizedTriggerSql1.equals(normalizedTriggerSql2);
if (equals) { if (equals) {
appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【"); appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【✅】");
//todo 得分 //todo 得分
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList, total, answerLogPath, stuAnswer.get(), totalKeyScore, score, answerId, scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList, total, answerLogPath, stuAnswer.get(), totalKeyScore, score, answerId, scoreTotal,judgementStr);
@@ -937,7 +937,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
else { else {
appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【"); appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【❌】");
SourceAndText studentScorePojo = calculateTotalScoreRate(stuAnswer.get(), examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal,judgementStr); SourceAndText studentScorePojo = calculateTotalScoreRate(stuAnswer.get(), examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -946,7 +946,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
else { else {
appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【"); appendToFile(answerLogPath, "【文件】 【"+fileName.get()+"】【×");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【文件】 【"+fileName.get()+"】【❌】");
SourceAndText studentScorePojo = calculateTotalScoreRate(stuAnswer.get(), examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal,judgementStr); SourceAndText studentScorePojo = calculateTotalScoreRate(stuAnswer.get(), examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal,judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
@@ -1017,7 +1017,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
// //
if (isEquivalent) { if (isEquivalent) {
appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】 【验证】 【表】 【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】 【验证】 【表】 【"+tableName+"】【");
SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,sql,totalKeyScore,score,answerId,scoreTotal,judgementStr); SourceAndText studentScorePojo = accumulateScoreAndLog(examMysqlKeywordList,total,answerLogPath,sql,totalKeyScore,score,answerId,scoreTotal,judgementStr);
@@ -1037,7 +1037,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
String alterSQL = buildAlterFromShowColumn(tableName, columnInfo); String alterSQL = buildAlterFromShowColumn(tableName, columnInfo);
appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】 【验证】 【表】 【"+tableName+"】【"); appendToFile(answerLogPath, "【执行】 "+""+selectSql+"】 【验证】 【表】 【"+tableName+"】【×");
SourceAndText studentScorePojo = calculateTotalScoreRate(alterSQL, examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal, judgementStr); SourceAndText studentScorePojo = calculateTotalScoreRate(alterSQL, examMysqlKeywordList, totalKeyScore, score, answerId, scoreTotal, judgementStr);
scoreTotal += studentScorePojo.getScore(); scoreTotal += studentScorePojo.getScore();
judgementStr = studentScorePojo.getText(); judgementStr = studentScorePojo.getText();
@@ -1402,7 +1402,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
// 使用正则,确保是完整单词(字段)匹配 // 使用正则,确保是完整单词(字段)匹配
String regex = keywordValue; String regex = keywordValue;
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【❌】");
appendToFile(answerLogPath,"【关键字】 【"+regex+""+""); appendToFile(answerLogPath,"【关键字】 【"+regex+""+"×");
} }
} }
}else { }else {
@@ -1410,7 +1410,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
appendToFile(answerLogPath,"该语句未设置关键字!"); appendToFile(answerLogPath,"该语句未设置关键字!");
} }
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "该语句未作答得分0.0 【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "该语句未作答得分0.0 【❌】");
appendToFile(answerLogPath, "该语句未作答得分0.0 【"); appendToFile(answerLogPath, "该语句未作答得分0.0 【×");
sourceAndText.setText(judgementStr); sourceAndText.setText(judgementStr);
sourceAndText.setScore(0.0); sourceAndText.setScore(0.0);
//返回累加的总分 //返回累加的总分
@@ -1451,14 +1451,14 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
try { try {
totalScoreRate += Integer.parseInt(keyword.getScoreRate()); totalScoreRate += Integer.parseInt(keyword.getScoreRate());
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【✅】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【✅】");
appendToFile(answerLogPath,"【关键字】 【"+regex+""+""); appendToFile(answerLogPath,"【关键字】 【"+regex+""+"");
matchedKeywords.add(keywordValue); matchedKeywords.add(keywordValue);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
System.err.println("Invalid scoreRate format for keyword: " + keywordValue); System.err.println("Invalid scoreRate format for keyword: " + keywordValue);
} }
}else { }else {
judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【❌】"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr,"【关键字】 【"+regex+""+"【❌】");
appendToFile(answerLogPath,"【关键字】 【"+regex+""+""); appendToFile(answerLogPath,"【关键字】 【"+regex+""+"×");
} }
} }
} }
@@ -1640,7 +1640,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
} }
if (newResults.size() != oldResults.size()) { if (newResults.size() != oldResults.size()) {
appendToFile(answerLogPath,"考生答案与标准答案个数不对"); appendToFile(answerLogPath,"×考生答案与标准答案个数不对");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "❌考生答案与标准答案个数不对"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "❌考生答案与标准答案个数不对");
mysqlBooleanVo.setText(judgementStr); mysqlBooleanVo.setText(judgementStr);
mysqlBooleanVo.setFlag(false); mysqlBooleanVo.setFlag(false);
@@ -1653,7 +1653,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
if (!newSet.equals(oldSet)) { if (!newSet.equals(oldSet)) {
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "❌ 内容相同但顺序不同,或存在差异:"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "❌ 内容相同但顺序不同,或存在差异:");
appendToFile(answerLogPath," 内容相同但顺序不同,或存在差异:"); appendToFile(answerLogPath,"× 内容相同但顺序不同,或存在差异:");
Set<Map<String, Object>> onlyInNew = new HashSet<>(newSet); Set<Map<String, Object>> onlyInNew = new HashSet<>(newSet);
onlyInNew.removeAll(oldSet); onlyInNew.removeAll(oldSet);
@@ -1661,13 +1661,13 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
onlyInOld.removeAll(newSet); onlyInOld.removeAll(newSet);
for (Map<String, Object> row : onlyInNew) { for (Map<String, Object> row : onlyInNew) {
appendToFile(answerLogPath,"⚠️ 标准答案中有但考生答案中没有: " + row); appendToFile(answerLogPath," 标准答案中有但考生答案中没有: " + row);
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "⚠️ 标准答案中有但考生答案中没有: " + row); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, " 标准答案中有但考生答案中没有: " + row);
} }
for (Map<String, Object> row : onlyInOld) { for (Map<String, Object> row : onlyInOld) {
appendToFile(answerLogPath,"⚠️ 考生答案中有但标准答案中没有: " + row); appendToFile(answerLogPath," 考生答案中有但标准答案中没有: " + row);
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, " 考生答案中有但标准答案中没有: " + row); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, " 考生答案中有但标准答案中没有: " + row);
} }
mysqlBooleanVo.setText(judgementStr); mysqlBooleanVo.setText(judgementStr);
mysqlBooleanVo.setFlag(false); mysqlBooleanVo.setFlag(false);

View File

@@ -108,10 +108,10 @@ public class FileServericeImpl implements IFileServerice {
// 计算该考点的权重得分并保留一位小数 // 计算该考点的权重得分并保留一位小数
double weightScore = ((double) currentScore / total) * score; double weightScore = ((double) currentScore / total) * score;
String formattedWeightScore = String.format("%.1f", weightScore); String formattedWeightScore = String.format("%.1f", weightScore);
appendToFile(answerLogPath,""+answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分:"+formattedWeightScore); appendToFile(answerLogPath,""+answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分:"+formattedWeightScore);
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "" + answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分:"+formattedWeightScore); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "" + answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分:"+formattedWeightScore);
}else { }else {
appendToFile(answerLogPath,""+answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分0"); appendToFile(answerLogPath,"×"+answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分0");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "" + answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分0"); judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "" + answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 得分0");
} }
} }