|
|
@@ -107,21 +107,21 @@ public class EvalService implements SubsystemService {
|
|
|
String token = httpService.getToken();
|
|
|
System.out.println(token);
|
|
|
JSONObject requestBody = new JSONObject();
|
|
|
- requestBody.put("examName",createEvalExamVO.getExamName());
|
|
|
- requestBody.put("skills",createEvalExamVO.getSkills());
|
|
|
- requestBody.put("difficulty",createEvalExamVO.getDifficulty());
|
|
|
- requestBody.put("startTime",createEvalExamVO.getStartTime());
|
|
|
- requestBody.put("endTime",createEvalExamVO.getEndTime());
|
|
|
- requestBody.put("comment",createEvalExamVO.getComment());
|
|
|
- requestBody.put("antiCheating",createEvalExamVO.getAntiCheating());
|
|
|
- requestBody.put("isPublic",createEvalExamVO.getIsPublic());
|
|
|
- requestBody.put("position",createEvalExamVO.getPosition());
|
|
|
- requestBody.put("courseId",createEvalExamVO.getCourseId());
|
|
|
+ requestBody.put("examName", createEvalExamVO.getExamName());
|
|
|
+ requestBody.put("skills", createEvalExamVO.getSkills());
|
|
|
+ requestBody.put("difficulty", createEvalExamVO.getDifficulty());
|
|
|
+ requestBody.put("startTime", createEvalExamVO.getStartTime());
|
|
|
+ requestBody.put("endTime", createEvalExamVO.getEndTime());
|
|
|
+ requestBody.put("comment", createEvalExamVO.getComment());
|
|
|
+ requestBody.put("antiCheating", createEvalExamVO.getAntiCheating());
|
|
|
+ requestBody.put("isPublic", createEvalExamVO.getIsPublic());
|
|
|
+ requestBody.put("position", createEvalExamVO.getPosition());
|
|
|
+ requestBody.put("courseId", createEvalExamVO.getCourseId());
|
|
|
// requestBody.put("courseId",1);//测试用
|
|
|
System.out.println(requestBody);
|
|
|
String result = null;
|
|
|
try {
|
|
|
- result = httpService.sendPost(uri, requestBody,null, token);
|
|
|
+ result = httpService.sendPost(uri, requestBody, null, token);
|
|
|
System.out.println(result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -145,7 +145,7 @@ public class EvalService implements SubsystemService {
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/question/sample";
|
|
|
String result = null;
|
|
|
try {
|
|
|
- result = httpService.sendGet(uri,new ArrayList<>(),null);
|
|
|
+ result = httpService.sendGet(uri, new ArrayList<>(), null);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
@@ -153,7 +153,7 @@ public class EvalService implements SubsystemService {
|
|
|
}
|
|
|
|
|
|
public JSONObject getExamQuestionAndScoreById(Integer examId) {
|
|
|
- String uri = "https://eval-server.seec.seecoder.cn/api/exam/" + examId +"/questions";
|
|
|
+ String uri = "https://eval-server.seec.seecoder.cn/api/exam/" + examId + "/questions";
|
|
|
String result = null;
|
|
|
try {
|
|
|
result = httpService.sendGet(uri, new ArrayList<>(), null);
|
|
|
@@ -178,7 +178,7 @@ public class EvalService implements SubsystemService {
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/exam/question/sample/" + examId + "/?sampleExamPaperId=" + sampleExamPaperId;
|
|
|
String token = httpService.getToken();
|
|
|
try {
|
|
|
- httpService.sendPost(uri, null,null,token);
|
|
|
+ httpService.sendPost(uri, null, null, token);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -198,14 +198,14 @@ public class EvalService implements SubsystemService {
|
|
|
|
|
|
public JSONObject getQuestionList(String stem, List<String> tags, String knowledgeName, int pageSize, int pageNum) {
|
|
|
String params = "";
|
|
|
- if(stem!=null){
|
|
|
- params+=("stem=" + stem + "&");
|
|
|
+ if (stem != null) {
|
|
|
+ params += ("stem=" + stem + "&");
|
|
|
}
|
|
|
- if(tags!=null){
|
|
|
- params+=("tags=" + tags + "&");
|
|
|
+ if (tags != null) {
|
|
|
+ params += ("tags=" + tags + "&");
|
|
|
}
|
|
|
- if(knowledgeName!=null){
|
|
|
- params+=("knowledgeName=" + knowledgeName + "&");
|
|
|
+ if (knowledgeName != null) {
|
|
|
+ params += ("knowledgeName=" + knowledgeName + "&");
|
|
|
}
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/question/question" + "?" + params + "pageSize=" + pageSize + "&pageNum=" + pageNum;
|
|
|
String token = httpService.getToken();
|
|
|
@@ -222,16 +222,16 @@ public class EvalService implements SubsystemService {
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/exam/" + examId + "/questions/";
|
|
|
String token = httpService.getToken();
|
|
|
JSONObject requestBody = new JSONObject();
|
|
|
- requestBody.put("questionScoreMap",questionScoreMapVO.getQuestionScoreMap());
|
|
|
+ requestBody.put("questionScoreMap", questionScoreMapVO.getQuestionScoreMap());
|
|
|
try {
|
|
|
- httpService.sendPut(uri, requestBody,token);
|
|
|
+ httpService.sendPut(uri, requestBody, null, token);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public JSONObject getExamById(Integer examId) {
|
|
|
- String uri = "https://eval-server.seec.seecoder.cn/api/exam/" +examId;
|
|
|
+ String uri = "https://eval-server.seec.seecoder.cn/api/exam/" + examId;
|
|
|
String token = httpService.getToken();
|
|
|
String result = null;
|
|
|
try {
|
|
|
@@ -243,7 +243,7 @@ public class EvalService implements SubsystemService {
|
|
|
}
|
|
|
|
|
|
public JSONObject getUsersByExamId(Integer examId) {
|
|
|
- String uri = "https://eval-server.seec.seecoder.cn/api/user/" + examId;
|
|
|
+ String uri = "https://eval-server.seec.seecoder.cn/api/user/" + examId;
|
|
|
String token = httpService.getToken();
|
|
|
String result = null;
|
|
|
try {
|
|
|
@@ -255,7 +255,7 @@ public class EvalService implements SubsystemService {
|
|
|
}
|
|
|
|
|
|
public JSONObject getReportByExamId(Integer examId) {
|
|
|
- String uri = "https://eval-server.seec.seecoder.cn/api/report/all?examId=" + examId;
|
|
|
+ String uri = "https://eval-server.seec.seecoder.cn/api/report/all?examId=" + examId;
|
|
|
String token = httpService.getToken();
|
|
|
String result = null;
|
|
|
try {
|
|
|
@@ -270,10 +270,10 @@ public class EvalService implements SubsystemService {
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/exam/invite/code" + "?inviteCode=" + inviteCode + "&examId=" + examId;
|
|
|
String token = httpService.getToken();
|
|
|
JSONObject requestBody = new JSONObject();
|
|
|
- requestBody.put("inviteCode",inviteCode);
|
|
|
- requestBody.put("examId",examId);
|
|
|
+ requestBody.put("inviteCode", inviteCode);
|
|
|
+ requestBody.put("examId", examId);
|
|
|
try {
|
|
|
- httpService.sendPut(uri, requestBody,token);
|
|
|
+ httpService.sendPut(uri, requestBody, null, token);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -283,9 +283,9 @@ public class EvalService implements SubsystemService {
|
|
|
String uri = "https://eval-server.seec.seecoder.cn/api/exam/invite/code" + "?examId=" + examId;
|
|
|
String token = httpService.getToken();
|
|
|
JSONObject requestBody = new JSONObject();
|
|
|
- requestBody.put("examId",examId);
|
|
|
+ requestBody.put("examId", examId);
|
|
|
try {
|
|
|
- httpService.sendPut(uri, requestBody,token);
|
|
|
+ httpService.sendPut(uri, requestBody, null, token);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -303,4 +303,16 @@ public class EvalService implements SubsystemService {
|
|
|
}
|
|
|
return JSONObject.parseObject(result);
|
|
|
}
|
|
|
+
|
|
|
+ public JSONObject getExamCodeQuestionAndScoreById(Integer examId) {
|
|
|
+ String uri = "https://eval-server.seec.seecoder.cn/api/exam/" + examId + "/questions/code";
|
|
|
+ String result = null;
|
|
|
+ try {
|
|
|
+ result = httpService.sendGet(uri, new ArrayList<>(), null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return JSONObject.parseObject(result);
|
|
|
+
|
|
|
+ }
|
|
|
}
|