|
@@ -107,8 +107,8 @@ public class coursewaretesthead extends Controller {
|
|
|
|
|
|
JSONArray jsonArray = detailRow.getJSONArray("testquestions");
|
|
|
detailRow.put("testquestions", jsonArray);
|
|
|
- for (Object object:jsonArray) {
|
|
|
- JSONObject jsonObject= (JSONObject) object;
|
|
|
+ for (Object object : jsonArray) {
|
|
|
+ JSONObject jsonObject = (JSONObject) object;
|
|
|
if (jsonObject.getLong("type") == 1) {
|
|
|
jsonObject.put("typestr", "选择题");
|
|
|
}
|
|
@@ -536,11 +536,13 @@ public class coursewaretesthead extends Controller {
|
|
|
where.append(")");
|
|
|
}
|
|
|
}
|
|
|
+ Long sat_courseware_testheadid = content.getLongValue("sat_courseware_testheadid");
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sat_courseware_test").setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sat_courseware_testhead", "t2", "t2.sat_courseware_testheadid=t1.sat_courseware_testheadid and t2.siteid=t1.siteid"
|
|
|
, "num");
|
|
|
querySQL.setWhere(where.toString());
|
|
|
querySQL.setSiteid(siteid);
|
|
|
+ querySQL.setWhere("t1.sat_courseware_testheadid",sat_courseware_testheadid);
|
|
|
querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting);
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
@@ -557,6 +559,16 @@ public class coursewaretesthead extends Controller {
|
|
|
public String testinfo() throws YosException {
|
|
|
|
|
|
Long sat_courseware_testid = content.getLongValue("sat_courseware_testid");
|
|
|
+ if (dbConnect.runSqlQuery("SELECT * from sat_courseware_test WHERE sat_courseware_testid=" + sat_courseware_testid + " and siteid='" + siteid + "' and status='未开始' and userid='" + userid + "'").isNotEmpty()) {
|
|
|
+
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_courseware_test");
|
|
|
+ updateSQL.setUniqueid(sat_courseware_testid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("begdate", getDateTime_Str());
|
|
|
+ updateSQL.setValue("status", "进行中");
|
|
|
+ updateSQL.update();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sat_courseware_test").setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sat_courseware_testhead", "t2", "t2.sat_courseware_testheadid=t1.sat_courseware_testheadid and t2.siteid=t1.siteid"
|
|
@@ -581,6 +593,10 @@ public class coursewaretesthead extends Controller {
|
|
|
.setWhere("sat_courseware_testid", detailRow.getLong("sat_courseware_testid"));
|
|
|
|
|
|
Rows rows2 = querySQL2.query();
|
|
|
+ for (Row row : rows2) {
|
|
|
+ JSONArray jsonArray = row.getJSONArray("options");
|
|
|
+ row.put("options", jsonArray);
|
|
|
+ }
|
|
|
|
|
|
detailRow.put("testquestions", rows2);
|
|
|
return getSucReturnObject().setData(detailRow).toString();
|
|
@@ -640,4 +656,14 @@ public class coursewaretesthead extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "查询我的考试列表", apiversion = R.ID20240326145902.v1.class)
|
|
|
+ public String submit() throws YosException {
|
|
|
+
|
|
|
+ Long sat_courseware_testid = content.getLongValue("sat_courseware_testid");
|
|
|
+
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|