当不存在需要切题时,将 is_cutout 写为1

This commit is contained in:
强 杨 2023-06-25 17:39:29 +08:00
parent 8d3f9db037
commit 9768e1d555
3 changed files with 27 additions and 19 deletions

View File

@ -36,7 +36,7 @@
<ul class="xul"> <ul class="xul">
<li style="font-size: 18px; border: 1px solid #ddd;">序号: <li style="font-size: 18px; border: 1px solid #ddd;">序号:
<label style="font-weight: bold; color: #f00; font-size: 30px;"><%=xuhao %></label> <label style="font-weight: bold; color: #f00; font-size: 30px;"><%=xuhao %></label>
小题:<label><%=xiaoti %></label><br /> <%--小题:--%><label style="display:none"><%=xiaoti %></label><br />
分数:<label style="font-weight: bold; color: #f00; font-size: 30px;" id="oldScore"><%=fenshu %></label> 分数:<label style="font-weight: bold; color: #f00; font-size: 30px;" id="oldScore"><%=fenshu %></label>
阅卷跳分:<label><%=yuejuanfen %></label></li> 阅卷跳分:<label><%=yuejuanfen %></label></li>
</ul> </ul>
@ -45,7 +45,7 @@
<div style="float: left; margin-top: 10px;"> <div style="float: left; margin-top: 10px;">
题号:<input type="text" id="zhuguan_tihao" style="width: 200px; font-size: 14px; height: 30px;" value="" placeholder="题号不能与原题号一致建议13.1" /><br /> 题号:<input type="text" id="zhuguan_tihao" style="width: 200px; font-size: 14px; height: 30px;" value="" placeholder="题号不能与原题号一致建议13.1" /><br />
<br /> <br />
小题:<input type="text" id="zhuguan_xiaoti" style="width: 80px; font-size: 14px; height: 30px;" value="0" placeholder="" /> <%--小题:--%><input type="text" id="zhuguan_xiaoti" style="width: 80px; font-size: 14px; height: 30px; display:none;" value="0" placeholder="" />
分数: 分数:
<select id="zgquestionscroe" style="font-size: 14px; width: 80px; height: 30px; text-align: center;"> <select id="zgquestionscroe" style="font-size: 14px; width: 80px; height: 30px; text-align: center;">
<option value="">无分</option> <option value="">无分</option>
@ -126,8 +126,9 @@
} }
if (confirm("拆题后,之前的数据将无法恢复,请谨慎使用")) { if (confirm("拆题后,之前的数据将无法恢复,请谨慎使用")) {
var totalScorew = $("#totalScorew").html(); var totalScorew = $("#totalScorew").html() == '' ? 0 : parseFloat($("#totalScorew").html());
var oldScore = $("#oldScore").html(); var oldScore = $("#oldScore").html() == '' ? 0 : parseFloat($("#oldScore").html());
if (totalScorew != oldScore) { if (totalScorew != oldScore) {
if (confirm("原始分数与拆解后分数不一致,是否继续?")) { if (confirm("原始分数与拆解后分数不一致,是否继续?")) {
@ -211,8 +212,8 @@
var html = "<div class=\"boxscore\" id='box_" + zhuguan_tihao + "'>"; var html = "<div class=\"boxscore\" id='box_" + zhuguan_tihao + "'>";
html += ""; html += "";
html += "<label><b>号:" + zhuguan_tihao + "</b></label>"; html += "<label><b>号:" + zhuguan_tihao + "</b></label>";
html += "<label>小题:" + zhuguan_xiaoti + "</label>"; html += "<label style=\"display:none\">小题:" + zhuguan_xiaoti + "</label>";
html += "<label>分数:<b class='scoreTotal'>" + score + "</b></label>"; html += "<label>分数:<b class='scoreTotal'>" + score + "</b></label>";
html += "<label>间隔:" + scoretype + "</label>"; html += "<label>间隔:" + scoretype + "</label>";
html += "<label>" + lineWhTx + "</label>"; html += "<label>" + lineWhTx + "</label>";

View File

@ -171,8 +171,15 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
ids += new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() + ","; ids += new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() + ",";
} }
questionNumList = questionNumList.Trim('$'); questionNumList = questionNumList.Trim('$');
int is_cutout = 0;
if (Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar("SELECT COUNT(1) FROM `MK_ExamResult` where ExamSubjectId=" + exam_subject_id + " AND QuestionNumber_int='" + questionNum + "'")) <= 0)
{
is_cutout = 1;
}
//写入任务表 //写入任务表
sql = "Insert Into mk_subjective_cut_record(temp_main_id,temp_detail_id,temp_question_num,is_cutout,exam_subject_id,temp_question_Newdata_ids,subjective_questions_data,cutted_question_num) VALUES(" + tempMainID + "," + TemDataID + ",'" + questionNum + "',0," + exam_subject_id + ",'" + ids.Trim(',') + "','" + zhuguantiList + "','" + questionNumList + "')"; sql = "Insert Into mk_subjective_cut_record(temp_main_id,temp_detail_id,temp_question_num,is_cutout,exam_subject_id,temp_question_Newdata_ids,subjective_questions_data,cutted_question_num) VALUES(" + tempMainID + "," + TemDataID + ",'" + questionNum + "',"+ is_cutout + "," + exam_subject_id + ",'" + ids.Trim(',') + "','" + zhuguantiList + "','" + questionNumList + "')";
new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp);
Response.Write("1"); Response.Write("1");
@ -205,15 +212,15 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
token = Globals.Request("token"); token = Globals.Request("token");
if (action == 0) if (action == 0)
{ {
string sql = "SELECT exam_subject_id,question_num FROM marking_setting_subjective WHERE id=" + subjective; string sql = "SELECT exam_subject_id,question_num,score,score_interval FROM marking_setting_subjective WHERE id=" + subjective;
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); DataTable dtSubSetting = new MysqlDBHelper(tenant).ExecuteQuery(sql);
if (dt.Rows.Count == 0) if (dtSubSetting.Rows.Count == 0)
{ {
Response.Write("<script>alert('无模板数据');window.close();</script>"); Response.Write("<script>alert('无模板数据');window.close();</script>");
return; return;
} }
exam_subject_id = Convert.ToInt64(dt.Rows[0]["exam_subject_id"]); exam_subject_id = Convert.ToInt64(dtSubSetting.Rows[0]["exam_subject_id"]);
questionNum = dt.Rows[0]["question_num"].ToString(); questionNum = dtSubSetting.Rows[0]["question_num"].ToString();
sql = "SELECT template_id FROM exam_subject WHERE id=" + exam_subject_id; sql = "SELECT template_id FROM exam_subject WHERE id=" + exam_subject_id;
long template_id_main = Convert.ToInt64(new MysqlDBHelper(tenant).ExecuteScalar(sql)); long template_id_main = Convert.ToInt64(new MysqlDBHelper(tenant).ExecuteScalar(sql));
@ -223,7 +230,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
TempMainID = template_id_main.ToString(); TempMainID = template_id_main.ToString();
sql = "SELECT ID_bigint,TempValue_nvarchar,TempPicture64_nvarchar FROM MK_TempleteData WHERE MainID_bigint=" + template_id_main; sql = "SELECT ID_bigint,TempValue_nvarchar,TempPicture64_nvarchar FROM MK_TempleteData WHERE MainID_bigint=" + template_id_main;
dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
bool isHave = false; bool isHave = false;
TempID = ""; TempID = "";
@ -246,8 +253,8 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
QuestionTempValue = q; QuestionTempValue = q;
xuhao = questionNum; xuhao = questionNum;
xiaoti = q.Split(',')[5]; xiaoti = q.Split(',')[5];
fenshu = q.Split(',')[6]; fenshu = dtSubSetting.Rows[0]["score"].ToString();
yuejuanfen = q.Split(',')[8]; yuejuanfen = dtSubSetting.Rows[0]["score_interval"].ToString();
isHave = true; isHave = true;
break; break;
} }
@ -293,9 +300,9 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
{ {
UpdateData(); UpdateData();
} }
catch catch (Exception ex)
{ {
Response.Write("拆题失败"); Response.Write("拆题失败" + ex);
} }
Response.End(); Response.End();
@ -353,7 +360,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
else if (Request.Url.Host.ToLower().Contains("localhost")) else if (Request.Url.Host.ToLower().Contains("localhost"))
{ {
// 开发地址 // 开发地址
url = "https://192.168.2.8:6500/"; url = "http://192.168.2.8:6500/";
} }
url += "api/marking-setting/sub/" + id + "/cut"; url += "api/marking-setting/sub/" + id + "/cut";
WebRequest request = WebRequest.Create(url); WebRequest request = WebRequest.Create(url);

View File

@ -47,7 +47,7 @@
border-radius: 5px; border-radius: 5px;
} }
.boxscore { .boxscore {
width: 130px; margin-right:5px; width: 180px; margin-right:5px;
font-size: 12px; font-size: 12px;
border: 1px solid #ddd; border: 1px solid #ddd;
height: 80px; height: 80px;