|
@@ -21,13 +21,16 @@ import okhttp3.MultipartBody;
|
|
|
import okhttp3.RequestBody;
|
|
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
+import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import static cn.com.qmth.examcloud.app.model.Constants.FILE_TYPE_PDF;
|
|
@@ -135,15 +138,17 @@ public class NetExamServiceImpl implements NetExamService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result updateExamRecordPaperQuestionAnswer(String key, String token, String order, String studentAnswer) throws Exception {
|
|
|
+ public Result updateExamRecordPaperQuestionAnswer(String key, String token, Integer order, String studentAnswer) throws Exception {
|
|
|
//封装请求参数
|
|
|
final String requestUrl = String.format("%s/api/ecs_oe_student/examQuestion/submitQuestionAnswer", propertyService.getNetExamUrl());
|
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
+ List<Map> paramsList = new ArrayList<Map>();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
params.put("order", order);
|
|
|
params.put("studentAnswer", studentAnswer);
|
|
|
- String json = new JsonMapper().toJson(params);
|
|
|
+ paramsList.add(params);
|
|
|
+ String json = new JsonMapper().toJson(paramsList);
|
|
|
RequestBody formBody = FormBody.create(MediaType.parse(Constants.CHARSET_JSON_UTF8), json);
|
|
|
- return HttpUtils.doPut(requestUrl, formBody, key, token);
|
|
|
+ return HttpUtils.doPost(requestUrl, formBody, key, token);
|
|
|
}
|
|
|
|
|
|
@Override
|