Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
school-paper-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
school-paper
school-paper-admin
Commits
3210cd5c
Commit
3210cd5c
authored
Jul 28, 2023
by
zhengyunfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组卷错误提示
parent
042f10aa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletions
+30
-1
school-paper/src/main/java/com/ruoyi/school/paper/domain/vo/MyErrorTopicListVo.java
+4
-0
school-paper/src/main/java/com/ruoyi/school/paper/service/impl/DbTestPaperServiceImpl.java
+23
-0
school-paper/src/main/resources/mapper/school-paper/DbTestPaperRecordDetailMapper.xml
+3
-1
No files found.
school-paper/src/main/java/com/ruoyi/school/paper/domain/vo/MyErrorTopicListVo.java
View file @
3210cd5c
...
...
@@ -28,6 +28,10 @@ public class MyErrorTopicListVo implements Serializable {
private
String
topic
;
/**
* 题目分数
*/
private
String
topicScore
;
/**
* 我的答案
*/
private
String
answer
;
...
...
school-paper/src/main/java/com/ruoyi/school/paper/service/impl/DbTestPaperServiceImpl.java
View file @
3210cd5c
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.school.paper.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.dynamic.datasource.annotation.Slave
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -10,6 +11,7 @@ import com.ruoyi.common.core.domain.PageQuery;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.helper.LoginHelper
;
import
com.ruoyi.common.utils.JsonUtils
;
import
com.ruoyi.common.utils.StringUtils
;
...
...
@@ -169,6 +171,9 @@ public class DbTestPaperServiceImpl implements IDbTestPaperService {
&&
bank
.
getPhaseId
().
equals
(
bo
.
getPhaseId
())
&&
bo
.
getIntensitys
().
contains
(
bank
.
getIntensity
())
).
collect
(
Collectors
.
groupingBy
(
DbQuestionBank:
:
getSpecies
));
if
(
CollectionUtil
.
isEmpty
(
collect
))
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
// 根据习题种类分组
// 选择题
List
<
DbQuestionBank
>
select
=
collect
.
get
(
2
);
...
...
@@ -180,6 +185,15 @@ public class DbTestPaperServiceImpl implements IDbTestPaperService {
List
<
DbQuestionBankTestPaper
>
papers
=
new
ArrayList
<>();
List
<
DbQuestionBankTestPaper
>
selectList
=
null
;
if
(
bo
.
getTotalPoints
().
equals
(
100
))
{
if
(
CollectionUtil
.
isEmpty
(
select
)
||
select
.
size
()
<
4
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
if
(
CollectionUtil
.
isEmpty
(
gapFilling
)
||
gapFilling
.
size
()
<
5
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
if
(
CollectionUtil
.
isEmpty
(
resolve
)
||
resolve
.
size
()
<
2
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
selectList
=
generatePaper
(
select
,
4
,
bo
.
getTotalPoints
(),
add
.
getId
());
List
<
DbQuestionBankTestPaper
>
gapFillingList
=
generatePaper
(
gapFilling
,
5
,
bo
.
getTotalPoints
(),
add
.
getId
());
List
<
DbQuestionBankTestPaper
>
resolveList
=
generatePaper
(
resolve
,
2
,
bo
.
getTotalPoints
(),
add
.
getId
());
...
...
@@ -187,6 +201,15 @@ public class DbTestPaperServiceImpl implements IDbTestPaperService {
papers
.
addAll
(
gapFillingList
);
papers
.
addAll
(
resolveList
);
}
else
{
if
(
CollectionUtil
.
isEmpty
(
select
)
||
select
.
size
()
<
4
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
if
(
CollectionUtil
.
isEmpty
(
gapFilling
)
||
gapFilling
.
size
()
<
12
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
if
(
CollectionUtil
.
isEmpty
(
resolve
)
||
resolve
.
size
()
<
5
)
{
throw
new
ServiceException
(
"符合条件的题目数量不足"
);
}
selectList
=
generatePaper
(
select
,
4
,
bo
.
getTotalPoints
(),
add
.
getId
());
List
<
DbQuestionBankTestPaper
>
gapFillingList
=
generatePaper
(
gapFilling
,
12
,
bo
.
getTotalPoints
(),
add
.
getId
());
List
<
DbQuestionBankTestPaper
>
resolveList
=
generatePaper
(
resolve
,
5
,
bo
.
getTotalPoints
(),
add
.
getId
());
...
...
school-paper/src/main/resources/mapper/school-paper/DbTestPaperRecordDetailMapper.xml
View file @
3210cd5c
...
...
@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"answer"
column=
"answer"
/>
<result
property=
"answerPic"
column=
"answers_pic"
/>
<result
property=
"score"
column=
"score"
/>
<result
property=
"topicScore"
column=
"topicScore"
/>
<result
property=
"correctAnswer"
column=
"correctAnswer"
/>
<result
property=
"correctAnswerPic"
column=
"correctAnswerPic"
/>
<collection
property=
"options"
javaType=
"java.util.List"
column=
"question_bank_id"
select=
"getOptionList"
ofType=
"com.ruoyi.school.paper.domain.vo.DbQuestionBankAnswerTestPaperVo"
>
...
...
@@ -47,7 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dtprd.answer,
dtprd.answers_pic,
dtprd.score,
dqbatp.species
dqbatp.species,
dqbatp.score as topicScore
FROM
db_test_paper_record_detail dtprd
LEFT JOIN db_question_bank_test_paper dqbatp ON dtprd.question_bank_id = dqbatp.id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment