【新增】根据试题number查询试题ID
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.example.exam.exam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.example.exam.exam.dal.ExamQuestion;
|
||||
import com.example.exam.exam.dal.ExamQuestionAnswer;
|
||||
import com.example.exam.exam.dal.ExamPsKeyword;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -3,6 +3,7 @@ package com.example.exam.exam.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.example.exam.exam.dal.ExamQuestion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,7 +25,7 @@ public interface ExamQuestionMapper extends BaseMapper<ExamQuestion>
|
||||
*/
|
||||
public ExamQuestion selectExamQuestionByQuId(String quId);
|
||||
|
||||
|
||||
ExamQuestion selectExamQuestionByQuNumber(@Param("quNumber") String quNumber);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -58,8 +58,10 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -70,7 +72,6 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题序号:" + educationPaperQu.getSort() + "</p>";
|
||||
judgementStr += "<p>试题编号:" + examQuestion.getQuNum() + "</p>";
|
||||
|
@@ -56,8 +56,10 @@ public class AutoForCServiceImpl implements AutoForCService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -67,7 +69,6 @@ public class AutoForCServiceImpl implements AutoForCService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
File[] lastFiles = wjFile.listFiles();
|
||||
for (File lastFile : lastFiles) {
|
||||
System.out.println(lastFile);
|
||||
|
@@ -64,8 +64,11 @@ public class AutoForFileServiceImpl implements AutoForFileService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
// 获取试题编号和试题ID
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -76,7 +79,6 @@ public class AutoForFileServiceImpl implements AutoForFileService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题序号:" + educationPaperQu.getSort() + "</p>";
|
||||
judgementStr += "<p>试题编号:" + examQuestion.getQuNum() + "</p>";
|
||||
|
@@ -58,8 +58,11 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
// 获取试题编号和试题ID
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -70,7 +73,6 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题序号:" + educationPaperQu.getSort() + "</p>";
|
||||
judgementStr += "<p>试题编号:" + examQuestion.getQuNum() + "</p>";
|
||||
|
@@ -53,8 +53,11 @@ public class AutoForPsServiceImpl implements AutoForPsService{
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
// 获取试题编号和试题ID
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -64,7 +67,6 @@ public class AutoForPsServiceImpl implements AutoForPsService{
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
System.out.println(wjFile);
|
||||
File[] lastFiles = wjFile.listFiles();
|
||||
for (File lastFile : lastFiles) {
|
||||
|
@@ -150,9 +150,9 @@ public class JudgementServiceImpl implements JudgementService
|
||||
}
|
||||
String actual = code_return.trim();
|
||||
String expected = examQuestionAnswer.getContent().trim();
|
||||
if (actual.contains(expected)) {
|
||||
if (actual.equals(expected)) {
|
||||
// 判断测试用例结果是否正确
|
||||
runList.add(true);
|
||||
runList.add(true);
|
||||
// 获取测试用例临界值,并进行判断
|
||||
// if (runList.size() >= Integer.parseInt(examQuestion.getQuestionScores().getCompileCutoff()) && !runList.contains(false)) {
|
||||
// // 测试用例得分
|
||||
|
@@ -72,6 +72,36 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
return examQuestion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamQuestion selectExamQuestionByQuNumber(String quNumber) {
|
||||
// 根据题号查询试题(非试题ID)
|
||||
ExamQuestion otherExam = examQuestionMapper.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = otherExam.getQuId();
|
||||
//查找试题答案
|
||||
List<ExamQuestionAnswer> examQuestionAnswers = examQuestionAnswerMapper.selectExamQuestionAnswerByQuId(quId);
|
||||
//查找试题文件
|
||||
List<SysFileUpload> sysFileUploads =sysFileMapper.selectSysFileByQuid(quId);
|
||||
//查找试题判分
|
||||
ExamQuestionScore examQuestionScore =examQuestionScoreMapper.selectExamQuestionScoreByQuId(quId);
|
||||
//获取试题关键字
|
||||
List<ExamQuestionKeyword> examQuestionKeywords = examQuestionKeywordMapper.selectExamQuestionKeywordByQuId(quId);
|
||||
ExamQuestion examQuestion = examQuestionMapper.selectExamQuestionByQuId(quId);
|
||||
if (examQuestion!=null){
|
||||
if (examQuestionAnswers!=null&&examQuestionAnswers.size()>0){
|
||||
examQuestion.setAnswerList(examQuestionAnswers);
|
||||
}
|
||||
if (sysFileUploads!=null&&sysFileUploads.size()>0){
|
||||
examQuestion.setFileUploads(sysFileUploads);
|
||||
}
|
||||
if (examQuestionScore!=null){
|
||||
examQuestion.setQuestionScores(examQuestionScore);
|
||||
}
|
||||
if (examQuestionKeywords!=null&&examQuestionKeywords.size()>0){
|
||||
examQuestion.setQuestionKeywords(examQuestionKeywords);
|
||||
}
|
||||
}
|
||||
return examQuestion;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -22,4 +22,6 @@ public interface IExamQuestionService
|
||||
*/
|
||||
public ExamQuestion selectExamQuestionByQuId(String quId);
|
||||
|
||||
ExamQuestion selectExamQuestionByQuNumber(String quNumber);
|
||||
|
||||
}
|
||||
|
@@ -59,8 +59,10 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -70,7 +72,6 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
System.out.println(wjFile);
|
||||
File[] lastFiles = wjFile.listFiles();
|
||||
for (File lastFile : lastFiles) {
|
||||
|
@@ -60,8 +60,10 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -71,7 +73,6 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
System.out.println(wjFile);
|
||||
File[] lastFiles = wjFile.listFiles();
|
||||
for (File lastFile : lastFiles) {
|
||||
|
@@ -57,8 +57,10 @@ public class JudgementForWordServiceImpl implements JudgementForWordService {
|
||||
File[] txFileList = txFile.listFiles();
|
||||
for (File stFile : txFileList) {
|
||||
// 获取试题编号和试题ID
|
||||
String quId = stFile.getName().split("@")[1];
|
||||
String quNumber = stFile.getName().split("@")[0];
|
||||
String quNumber = stFile.getName();
|
||||
// 需要根据题号获取试题ID
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuNumber(quNumber);
|
||||
String quId = examQuestion.getQuId();
|
||||
File[] wjFiles = stFile.listFiles();
|
||||
for (File wjFile : wjFiles) {
|
||||
if ("文件".equals(wjFile.getName())) {
|
||||
@@ -68,7 +70,6 @@ public class JudgementForWordServiceImpl implements JudgementForWordService {
|
||||
EducationPaperScheme educationPaperScheme = result.get();
|
||||
EducationPaperQu educationPaperQu = results.get();
|
||||
String quScore = educationPaperScheme.getQuScores();
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||
System.out.println(wjFile);
|
||||
File[] lastFiles = wjFile.listFiles();
|
||||
for (File lastFile : lastFiles) {
|
||||
|
@@ -47,4 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where qu_id = #{quId}
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionByQuNumber" resultType="com.example.exam.exam.dal.ExamQuestion">
|
||||
SELECT * FROM exam_question WHERE qu_num = #{quNumber}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user