|
@@ -35,7 +35,7 @@ public class NetExamService {
|
|
|
|
|
|
public Result getCurrentTime(String key, String token) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = propertyService.getNetExamUrl() + "/api/online_exam_course/currentTime";
|
|
|
+ final String requestUrl = String.format("%s/api/online_exam_course/currentTime", propertyService.getNetExamUrl());
|
|
|
Result<String> result = HttpUtils.doGet(requestUrl, key, token);
|
|
|
if (result.isSuccess()) {
|
|
|
//转换日期格式
|
|
@@ -46,13 +46,13 @@ public class NetExamService {
|
|
|
|
|
|
public Result getOfflineExamCourseList(String key, String token) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = propertyService.getNetExamUrl() + "/api/offline_exam/getOfflineCourse";
|
|
|
+ final String requestUrl = String.format("%s/api/offline_exam/getOfflineCourse", propertyService.getNetExamUrl());
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
public Result startOfflineExamRecord(String key, String token, String examStudentId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/offline_exam/start?examStudentId=%s", examStudentId);
|
|
|
+ final String requestUrl = String.format("%s/api/offline_exam/start?examStudentId=%s", propertyService.getNetExamUrl(), examStudentId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
@@ -67,7 +67,7 @@ public class NetExamService {
|
|
|
throw new ApiException("File must be not empty.");
|
|
|
}
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/offline_exam/%s/submit", examRecordId);
|
|
|
+ final String requestUrl = String.format("%s/api/offline_exam/%s/submit", propertyService.getNetExamUrl(), examRecordId);
|
|
|
MultipartBody.Builder form = new MultipartBody.Builder().setType(MultipartBody.FORM);
|
|
|
RequestBody body = RequestBody.create(MediaType.parse("application/octet-stream"), fileBytes);
|
|
|
form.addFormDataPart("file", fileName, body);
|
|
@@ -78,24 +78,26 @@ public class NetExamService {
|
|
|
|
|
|
public Result getPracticeExamCourseList(String key, String token, String examId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/practice_course?examId=%s", examId);
|
|
|
+ final String requestUrl = String.format("%s/api/practice_course?examId=%s", propertyService.getNetExamUrl(), examId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
public Result getExamRecordHeartbeat(String key, String token, String examRecordId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/exam_control/heartbeat?examRecordId=%s", examRecordId);
|
|
|
+ final String requestUrl = String.format("%s/api/exam_control/heartbeat?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
public Result startPracticeExamRecord(String key, String token, String examStudentId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/exam_control/start?stu_exam_info_id=%s", examStudentId);
|
|
|
+ final String requestUrl = String.format("%s/api/exam_control/start?stu_exam_info_id=%s", propertyService.getNetExamUrl(), examStudentId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
public Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception {
|
|
|
- return null;
|
|
|
+ //封装请求参数
|
|
|
+ final String requestUrl = String.format("%s/api/exam_control/start?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
|
|
|
+ return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
public Result getExamRecordPaperQuestionList(String key, String token, String examRecordId) throws Exception {
|