|
|
@@ -185,6 +185,10 @@ var DealImageWFunc = function (Item, WidthVal) {
|
|
|
var pattWStr = new RegExp(/width\s?:\s?[0-9]+%;/ig);
|
|
|
var pattWStr2 = new RegExp(/width\s?=\s?["|'|0-9]+%/ig);
|
|
|
$.each($(Item).find("img[class!='nextpic']"), function (index, iItem) {
|
|
|
+ //var ClsName = $(iItem).attr("class");
|
|
|
+ //if (ClsName != undefined && ClsName != null && ClsName.indexOf("yaoshi") > -1) {
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
var HtmlStr = $(iItem).prop("outerHTML");
|
|
|
var matchesWArr = HtmlStr.match(pattWStr);
|
|
|
if (matchesWArr != null && matchesWArr.length > 0) {
|
|
|
@@ -362,9 +366,11 @@ var AdjustTableFunc = function () {
|
|
|
//#region 听力音频处理
|
|
|
var AddListenDiv = function (NodeHandle, NIndex) {
|
|
|
var UrlStr = $(NodeHandle).attr("alt");
|
|
|
+ var ListenDivWidth = ($(document.body).width() - GetPadVal(document.body));
|
|
|
+ ListenDivWidth = (ListenDivWidth > 414 ? 414 : ListenDivWidth);
|
|
|
if (UrlStr != null && UrlStr.indexOf("|") > -1) {
|
|
|
var UrlArr = UrlStr.split("|");
|
|
|
- var htmlStr = '<div class="ListenDiv" data-status="1" style="width:' + ($(document.body).width() - GetPadVal(document.body)) + 'px;"><div class="LDivTop">';
|
|
|
+ var htmlStr = '<div class="ListenDiv" data-status="1" style="width:' + ListenDivWidth + 'px;"><div class="LDivTop">';
|
|
|
for (var i = 0; i < UrlArr.length; i++) {
|
|
|
var SelectedN = (i == 0 ? 1 : 0);
|
|
|
htmlStr += '<div class="LDivTItem LDivTItem_' + NIndex + ' LDivTItem_' + NIndex + '_' + i + '" data-selected="' + SelectedN + '" onclick="cLSourceFunc(' + NIndex + ',' + i + ')" data-auduourl="' + UrlArr[i] + '">听力材料' + (i + 1) + '</div>';
|
|
|
@@ -372,7 +378,7 @@ var AddListenDiv = function (NodeHandle, NIndex) {
|
|
|
htmlStr += '</div><div class="LDivFooter"><div class="LDFPlayS LDFPlayS_' + NIndex + '" data-playstatus="0" onclick="playMusicFunc(' + NIndex + ')"></div><div class="LDFPauseS LDFPauseS_' + NIndex + '" onclick="pauseMusicFunc(' + NIndex + ')"></div><div class="LDFProcS"><div class="LDFPWhite LDFPWhite_' + NIndex + '"></div><div class="LDFProcImg LDFProcImg_' + NIndex + '"></div></div><div class="LDFTimerS"><span class="RunTime RunTime_' + NIndex + '">00:00</span><span>/</span><span class="RunAllTime RunAllTime_' + NIndex + '">00:00</span></div></div></div>';
|
|
|
}
|
|
|
else if (UrlStr != null) {
|
|
|
- var htmlStr = '<div class="ListenDiv" data-status="0"><div class="LDivTop" style="width:1px;height:0px;overflow:hidden;"><div class="LDivTItem LDivTItem_' + NIndex + ' LDivTItem_' + NIndex + '_0" data-selected="1" onclick="cLSourceFunc(' + NIndex + ',0)" data-selected="1" data-auduourl="' + UrlStr + '"></div></div><div class="LDivFooter"><div class="LDFPlayS LDFPlayS_' + NIndex + '" data-playstatus="0" onclick="playMusicFunc(' + NIndex + ')"></div><div class="LDFPauseS LDFPauseS_' + NIndex + '" onclick="pauseMusicFunc(' + NIndex + ')"></div><div class="LDFProcS"><div class="LDFPWhite LDFPWhite_' + NIndex + '"></div><div class="LDFProcImg LDFProcImg_' + NIndex + '"></div></div><div class="LDFTimerS"><span class="RunTime RunTime_' + NIndex + '">00:00</span><span>/</span><span class="RunAllTime RunAllTime_' + NIndex + '">00:00</span></div></div></div>';
|
|
|
+ var htmlStr = '<div class="ListenDiv" data-status="0" style="width:' + ListenDivWidth + 'px;"><div class="LDivTop" style="width:1px;height:0px;overflow:hidden;"><div class="LDivTItem LDivTItem_' + NIndex + ' LDivTItem_' + NIndex + '_0" data-selected="1" onclick="cLSourceFunc(' + NIndex + ',0)" data-selected="1" data-auduourl="' + UrlStr + '"></div></div><div class="LDivFooter"><div class="LDFPlayS LDFPlayS_' + NIndex + '" data-playstatus="0" onclick="playMusicFunc(' + NIndex + ')"></div><div class="LDFPauseS LDFPauseS_' + NIndex + '" onclick="pauseMusicFunc(' + NIndex + ')"></div><div class="LDFProcS"><div class="LDFPWhite LDFPWhite_' + NIndex + '"></div><div class="LDFProcImg LDFProcImg_' + NIndex + '"></div></div><div class="LDFTimerS"><span class="RunTime RunTime_' + NIndex + '">00:00</span><span>/</span><span class="RunAllTime RunAllTime_' + NIndex + '">00:00</span></div></div></div>';
|
|
|
}
|
|
|
$(NodeHandle).css("width", "1px").css("height", "1px").css("overflow", "hidden").after(htmlStr);
|
|
|
// 添加滑块事件
|
|
|
@@ -532,6 +538,20 @@ function TouchEndFunc(event) {
|
|
|
}
|
|
|
//#endregion
|
|
|
|
|
|
+// 点击事件样式渲染
|
|
|
+var ClickRecFunc = function (pID) {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ var jqStr = ".answer-body[parent-anid='" + pID + "']";
|
|
|
+ $(jqStr).addClass("select-answer");
|
|
|
+ var curObj = new Object();
|
|
|
+ curObj.Id = $(jqStr).attr("answer-id");//答题点ID
|
|
|
+ curObj.pId = $(jqStr).attr("parent-anid");//答题点ID
|
|
|
+ curObj.IsKY = $(jqStr).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
+ curObj.AnsText = $(jqStr).attr("answer-anstext");//参考答案
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
// 判断是否在横线内
|
|
|
var isGCFunc = function (NodeHandle) {
|
|
|
var isFlag = false;
|
|
|
@@ -1320,7 +1340,7 @@ function handleAnswerRange() {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentId + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "' answer-showanswer='0'><div class='answer-audio-range'><img class='nextpic' class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text'></buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentId + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "' answer-showanswer='0' data-astatus='0' data-errstatus='0' onclick='ClickRecFunc(" + parentId + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text'></buttom></div>");
|
|
|
//删除钥匙节点
|
|
|
var prev = $("img[answer-id='" + answerid + "']");
|
|
|
if (prev.length > 0) {
|
|
|
@@ -1366,6 +1386,8 @@ function handleAnswerRange() {
|
|
|
//console.log(JSON.stringify(answerData));
|
|
|
// 处理多选框样式
|
|
|
dealCheckBox();
|
|
|
+ // data-astatus控制作答样式(0表示未提交,1表示提交,2表示回显);data-errstatus判断是否(1)错误
|
|
|
+ $(".answer-body").attr("data-astatus", "0").attr("data-errstatus", "0");
|
|
|
return answerData;
|
|
|
}
|
|
|
|
|
|
@@ -1424,6 +1446,7 @@ function reviewAnswer(answerJson) {
|
|
|
|
|
|
//提交,获取所有作答答案及参考答案
|
|
|
function getAllAnswer() {
|
|
|
+ $(".answer-body").attr("data-astatus", "1").attr("data-errstatus", "0"); // 控制作答样式
|
|
|
//处理作答
|
|
|
$.each($(".answer-body"), function (index, item) {
|
|
|
var isanswer = false;
|
|
|
@@ -1436,7 +1459,6 @@ function getAllAnswer() {
|
|
|
isanswer = true;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
var mytext = $(item).children(".answer-text").text();
|
|
|
var curDisplay = $(item).children(".answer-audio-range").css("display");
|
|
|
if (mytext == "" && curDisplay == "none") {
|
|
|
@@ -1449,10 +1471,14 @@ function getAllAnswer() {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
|
+ else {
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
+ }
|
|
|
});
|
|
|
$(".answer-body").removeClass("select-answer");//移除样式
|
|
|
$(".answer-body").unbind("click");//取消点击绑定事件
|
|
|
@@ -1488,10 +1514,13 @@ function getAllAnswer() {
|
|
|
}
|
|
|
//mytext = mytext == "" ? " " : mytext;
|
|
|
if (!isanswer) {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' data-astatus='1' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
}
|
|
|
else {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' data-astatus='1' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ }
|
|
|
+ if (mytext == "未作答") {
|
|
|
+ $(".answer-body[answer-id='" + answerid + "']").attr("data-errstatus", "1");
|
|
|
}
|
|
|
});
|
|
|
ControlFlag = false;
|
|
|
@@ -1507,6 +1536,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
ControlFlag = false;
|
|
|
}
|
|
|
+ $(".answer-body").attr("data-astatus", statusType).attr("data-errstatus", "0"); // 实时记录作答状态
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerList = JSON.parse(answerJson);
|
|
|
$.each($(".answer-body"), function (num, item) {
|
|
|
@@ -1575,6 +1605,9 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
}
|
|
|
+ else {
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//已提交,作答还原
|
|
|
@@ -1593,6 +1626,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
|
@@ -1602,6 +1636,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
@@ -1628,6 +1663,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
|
@@ -1637,6 +1673,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
@@ -1693,10 +1730,13 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
}
|
|
|
//mytext = mytext == "" ? " " : mytext;
|
|
|
if (!isanswer) {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "' data-astatus='" + statusType + "' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
}
|
|
|
else {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "' data-astatus='" + statusType + "' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ }
|
|
|
+ if (mytext == "未作答") {
|
|
|
+ $(".answer-body[answer-id='" + answerid + "']").attr("data-errstatus", "1");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -1872,6 +1912,7 @@ function backupAllReview(answerJson) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
+ $(item).attr("data-errstatus", "1");
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
@@ -1927,10 +1968,13 @@ function backupAllReview(answerJson) {
|
|
|
}
|
|
|
//mytext = mytext == "" ? " " : mytext;
|
|
|
if (!isanswer) {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "' data-astatus='2' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
}
|
|
|
else {
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' parent-anid='" + parentid + "' answer-anstext='" + answerText + "' answer-isky='2' answer-text='" + mytext + "' data-astatus='2' data-errstatus='0' onclick='ClickRecFunc(" + parentid + ")'><div class='answer-audio-range'><img class='nextpic' src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img class='nextpic' src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text no-answer' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ }
|
|
|
+ if (mytext == "未作答") {
|
|
|
+ $(".answer-body[answer-id='" + answerid + "']").attr("data-errstatus", "1");
|
|
|
}
|
|
|
//评阅样式
|
|
|
if (answerList[index].Score == 0) {
|