|
|
@@ -40,6 +40,7 @@ public class coursewaretesthead extends Controller {
|
|
|
Long sat_courseware_testheadid = content.getLongValue("sat_courseware_testheadid");
|
|
|
int testaddmode = content.getIntValue("testaddmode", 1);
|
|
|
int num = content.getIntValue("num", 0);
|
|
|
+ boolean isrepeat = content.getBooleanValue("isrepeat");
|
|
|
JSONArray sat_courseware_classids = new JSONArray();
|
|
|
if (content.containsKey("sat_courseware_classids")) {
|
|
|
sat_courseware_classids = content.getJSONArray("sat_courseware_classids");
|
|
|
@@ -88,6 +89,7 @@ public class coursewaretesthead extends Controller {
|
|
|
insertSQL.setValue("passingscore", content.getBigDecimalValue("passingscore", 60));
|
|
|
insertSQL.setValue("num", content.getIntValue("num", 0));
|
|
|
insertSQL.setValue("sat_courseware_classids", sat_courseware_classids);
|
|
|
+ insertSQL.setValue("isrepeat", isrepeat);
|
|
|
insertSQL.insert();
|
|
|
|
|
|
content.put("sat_courseware_testheadid", sat_courseware_testheadid);
|
|
|
@@ -103,6 +105,7 @@ public class coursewaretesthead extends Controller {
|
|
|
updateSQL.setValue("passingscore", content.getBigDecimalValue("passingscore", 60));
|
|
|
updateSQL.setValue("num", content.getIntValue("num", 0));
|
|
|
updateSQL.setValue("sat_courseware_classids", sat_courseware_classids);
|
|
|
+ updateSQL.setValue("isrepeat", isrepeat);
|
|
|
if (testaddmode == 1) {//系统随机
|
|
|
updateSQL.setValue("testquestions", new JSONArray());
|
|
|
}
|
|
|
@@ -395,7 +398,7 @@ public class coursewaretesthead extends Controller {
|
|
|
if (testheadRows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("考试不存在").toString();
|
|
|
}
|
|
|
- Rows testRows = dbConnect.runSqlQuery("SELECT sat_courseware_testid from sat_courseware_test WHERE sat_courseware_testheadid=" + sat_courseware_testheadid + " and userid=" + userid + " and siteid='" + siteid + "'");
|
|
|
+ Rows testRows = dbConnect.runSqlQuery("SELECT sat_courseware_testid from sat_courseware_test WHERE status!='已作废' and sat_courseware_testheadid=" + sat_courseware_testheadid + " and userid=" + userid + " and siteid='" + siteid + "'");
|
|
|
if (testRows.isNotEmpty()) {
|
|
|
Long sat_courseware_testid = testRows.get(0).getLong("sat_courseware_testid");
|
|
|
content.put("sat_courseware_testid", sat_courseware_testid);
|
|
|
@@ -480,6 +483,7 @@ public class coursewaretesthead extends Controller {
|
|
|
querySQL.addQueryFields("status", "IFNULL(t3.`status`,'未开始')");
|
|
|
querySQL.addQueryFields("rightcount", "IFNULL(t3.`rightcount`,0)");
|
|
|
querySQL.setWhere(where.toString());
|
|
|
+ querySQL.setWhere("t3.status!='已作废'");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
querySQL.setWhere("t2.sat_courseware_testheadid", sat_courseware_testheadid);
|
|
|
if (pageSorting.equals("''")) {
|
|
|
@@ -508,8 +512,7 @@ public class coursewaretesthead extends Controller {
|
|
|
updateSQL.update();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sat_courseware_test").setTableAlias("t1");
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sat_courseware_test","isrepeat").setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sat_courseware_testhead", "t2", "t2.sat_courseware_testheadid=t1.sat_courseware_testheadid and t2.siteid=t1.siteid"
|
|
|
, "num", "passingscore", "title");
|
|
|
querySQL.setWhere("sat_courseware_testid", sat_courseware_testid);
|
|
|
@@ -620,6 +623,18 @@ public class coursewaretesthead extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "重考", apiversion = R.ID20260414100001.v1.class)
|
|
|
+ public String retest() throws YosException {
|
|
|
+ Long sat_courseware_testid = content.getLong("sat_courseware_testid");
|
|
|
+ long sat_courseware_testheadid = content.getLong("sat_courseware_testheadid");
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_courseware_test");
|
|
|
+ updateSQL.setUniqueid(sat_courseware_testid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "已作废");
|
|
|
+ updateSQL.update();
|
|
|
+ return addTest();
|
|
|
+ }
|
|
|
+
|
|
|
@API(title = "考试提交", apiversion = R.ID20240326145902.v1.class)
|
|
|
public String submit() throws YosException {
|
|
|
|