Commit 9be7ebae by wenww

多选题逻辑判断修改

parent 4f7978f0
...@@ -54,13 +54,20 @@ public class MultipleChoicesAnswerHandler extends AbstractAnswerHandler { ...@@ -54,13 +54,20 @@ public class MultipleChoicesAnswerHandler extends AbstractAnswerHandler {
@Override @Override
public boolean judgeRight(Answer answer, SubjectDto subject) { public boolean judgeRight(Answer answer, SubjectDto subject) {
int right = 0;
String[] correctAnswers = AnswerHandlerUtil.replaceComma(subject.getAnswer().getAnswer()).split(CommonConstant.COMMA); String[] correctAnswers = AnswerHandlerUtil.replaceComma(subject.getAnswer().getAnswer()).split(CommonConstant.COMMA);
for (String as : answer.getAnswer().split(CommonConstant.COMMA)) { for (String as : answer.getAnswer().split(CommonConstant.COMMA)) {
if (!ArrayUtils.contains(correctAnswers, as)) { if (!ArrayUtils.contains(correctAnswers, as)) {
return false; return false;
}else {
right ++;
} }
} }
return true; if (right == correctAnswers.length) {
return true;
}else {
return false;
}
} }
@Override @Override
......
...@@ -403,31 +403,13 @@ ...@@ -403,31 +403,13 @@
</pluginManagement> </pluginManagement>
</build> </build>
<!--指定仓库-->
<repositories> <repositories>
<repository> <repository>
<id>spring-milestone</id> <id>nexus-central</id>
<snapshots> <url>http://nexus.ui-tech.cn/repository/maven-public/</url>
<enabled>false</enabled> <releases><enabled>true</enabled></releases>
</snapshots> <snapshots><enabled>true</enabled></snapshots>
<url>http://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshot</id>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://repo.spring.io/snapshot</url>
</repository>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository> </repository>
</repositories> </repositories>
</project> </project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment