|
@@ -22,9 +22,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
public class MyConsumer extends Consumer<String> {
|
|
|
- private static String[] sucStr=new String[] {"对","正确","√","是","True"};
|
|
|
- private static String[] errStr=new String[] {"错","错误","×","不正确","否","False"};
|
|
|
- private static String paperSuff = "(230821)";
|
|
|
+ private static String[] sucStr = new String[] { "对", "正确", "√", "是", "True" };
|
|
|
+ private static String[] errStr = new String[] { "错", "错误", "×", "不正确", "否", "False" };
|
|
|
+ private static String paperSuff = "(230914)";
|
|
|
private int maxqc = 200;
|
|
|
|
|
|
private static String paperDir = "d:/yunkai/paper/";
|
|
@@ -65,14 +65,11 @@ public class MyConsumer extends Consumer<String> {
|
|
|
ResultSet resultSet = null;
|
|
|
try {
|
|
|
String sql = " select q.id,q.question_type,q.topic,q.difficulty,q.answer "
|
|
|
- + " from wq_question_bank_subject t "
|
|
|
- +" left join wq_subject sub on t.subject_id=sub.id"
|
|
|
+ + " from wq_question_bank_subject t " + " left join wq_subject sub on t.subject_id=sub.id"
|
|
|
+ " left join wq_question_bank b on t.question_bank_id=b.id "
|
|
|
+ " left join wq_question_question_bank f on t.question_bank_id=f.question_bank_id "
|
|
|
- + " left join wq_question q on f.question_id=q.id "
|
|
|
- + " where sub.subject_code='"+courseCode
|
|
|
- + "' and b.rent_id=811 and b.is_deleted=0 "
|
|
|
- + " and q.is_deleted=0 and q.rent_id=811 ";
|
|
|
+ + " left join wq_question q on f.question_id=q.id " + " where sub.subject_code='" + courseCode
|
|
|
+ + "' and b.rent_id=811 and b.is_deleted=0 " + " and q.is_deleted=0 and q.rent_id=811 ";
|
|
|
|
|
|
preState = connect.prepareStatement(sql);
|
|
|
|
|
@@ -84,6 +81,10 @@ public class MyConsumer extends Consumer<String> {
|
|
|
q.setBody(disposeImg(resultSet.getString("topic"), courseCode));
|
|
|
q.setQst(YunkaiQuesStructType.getByYunKaiType(resultSet.getInt("question_type")));
|
|
|
q.setDifficulty(YunkaiDifficulty.getByYunKaiType(resultSet.getInt("difficulty")));
|
|
|
+// if (!q.getQst().isObjective()) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// q.setDifficulty(YunkaiDifficulty.ZHONGDENG);
|
|
|
q.setAnswer(disposeImg(resultSet.getString("answer"), courseCode));
|
|
|
q.setObjective(q.getQst().isObjective());
|
|
|
qs.add(q);
|
|
@@ -301,19 +302,18 @@ public class MyConsumer extends Consumer<String> {
|
|
|
return String.valueOf(optionNum);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private String getBool(String val) {
|
|
|
- String valid="错答案:正确";
|
|
|
- if(val.contains(valid)) {
|
|
|
+ String valid = "错答案:正确";
|
|
|
+ if (val.contains(valid)) {
|
|
|
return "正确";
|
|
|
}
|
|
|
- for(String suc:sucStr) {
|
|
|
- if(val.contains(suc)) {
|
|
|
+ for (String suc : sucStr) {
|
|
|
+ if (val.contains(suc)) {
|
|
|
return "正确";
|
|
|
}
|
|
|
}
|
|
|
- for(String err:errStr) {
|
|
|
- if(val.contains(err)) {
|
|
|
+ for (String err : errStr) {
|
|
|
+ if (val.contains(err)) {
|
|
|
return "错误";
|
|
|
}
|
|
|
}
|