|
|
@@ -27,11 +27,54 @@ function showHideAnswer(flag) {
|
|
|
//$(".underlineContent").show();
|
|
|
$(".underlineContent").css("color", "#92D050");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
+ $.each($(".underlineContent"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ $(item).css("display", "inline-block").after(addHtml);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
+ }
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
+ $(this).parent().find(".checkbox").find("input").prop('checked', true);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
else {
|
|
|
//$(".underlineContent").hide();
|
|
|
$(".underlineContent").css("color", "#ffffff");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
+ $.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ $(item).css("display", "none").after(addHtml);
|
|
|
+ $(item).next().attr("data-status", "1");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).css("display", "none").next().attr("data-status", "1");
|
|
|
+ }
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
+ $(this).parent().find(".checkbox").find("input").prop('checked', false);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -46,6 +89,25 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
|
|
|
if (isShowAS) {
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ $(item).css("display", "inline-block").after(addHtml);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
+ }
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
+ $(this).parent().find(".checkbox").find("input").prop('checked', true);
|
|
|
+ }
|
|
|
//$(item).html($(item).attr("data-text"));
|
|
|
if (!$(item).hasClass("no-answer")) {
|
|
|
$(item).css("color", "#92D050");
|
|
|
@@ -53,7 +115,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
else {
|
|
|
$(item).css("color", "#989898");
|
|
|
}
|
|
|
-
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
@@ -62,6 +123,26 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
}
|
|
|
else {
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
+ var underlineContentText = $(this).text(); // 获取文本内容
|
|
|
+ var widthValue = $(item).css("width");
|
|
|
+ var newClsName = $(item).next().attr("class");
|
|
|
+ if (newClsName != "underlineContentShow") {
|
|
|
+ var addHtml = "";
|
|
|
+ if (hasChineseWorld(underlineContentText)) {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ addHtml = "<span class='underlineContentShow' style='width:" + widthValue + ";' data-status='0'> </span>";
|
|
|
+ }
|
|
|
+ $(item).css("display", "none").after(addHtml);
|
|
|
+ $(item).next().attr("data-status", "1");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).css("display", "none").next().attr("data-status", "1");
|
|
|
+ }
|
|
|
+ if (underlineContentText.indexOf("√") > -1) {
|
|
|
+ $(this).parent().find(".checkbox").find("input").prop('checked', false);
|
|
|
+ }
|
|
|
$(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
@@ -212,7 +293,7 @@ function bindEventYS() {
|
|
|
uHtml.innerText = "暂无参考答案";
|
|
|
if ($(parent)[0].tagName == 'P') {
|
|
|
if ($(parent).hasClass('correntQue') || $(parent).hasClass('boxQue')) {
|
|
|
- uHtml.innerHTML = " ";
|
|
|
+ uHtml.innerHTML = " ";
|
|
|
}
|
|
|
}
|
|
|
uHtml.setAttribute("data-text", uHtml.innerText);
|
|
|
@@ -227,23 +308,17 @@ function bindEventYS() {
|
|
|
var checkId = 0;
|
|
|
var headid = -1;
|
|
|
var groupId = -1;
|
|
|
- $.each($(".multipleStart").nextUntil(".multipleEnd").filter("[class*='group']"), function (index, item) {
|
|
|
- checkId = $(item).find('.yaoshi').attr("answer-id");
|
|
|
- var gid = $(item).attr('class').replace(/.*group(\d+).*/g, "$1");
|
|
|
- if (index == 0 || groupId != gid) {
|
|
|
- groupId = gid;
|
|
|
- headid = checkId;
|
|
|
- }
|
|
|
- $(item).find('.yaoshi').attr('parent-anid', headid);
|
|
|
-
|
|
|
- var ischecked = $(item).find(".underlineContent").text().indexOf("√") > -1;
|
|
|
- var answerText = ischecked ? "√" : "";
|
|
|
- //勾选题
|
|
|
- if ($(item).hasClass('boxQue')) {
|
|
|
- $(item).find('.yaoshi').after("<div class='checkbox' answer-id='" + checkId + "' parent-anid='" + headid + "' answer-isky='2' answer-anstext=" + answerText + "><input id=" + checkId + " type='checkbox' onclick=this.checked=!this.checked><label for=" + checkId + "></label></div>");
|
|
|
- $(item).find('input').prop('checked', ischecked);
|
|
|
- $(item).find('.underlineContent').hide();
|
|
|
- }
|
|
|
+ $(".multipleStart").each(function (i, item) {
|
|
|
+ var $startNode = $(item);
|
|
|
+ $.merge($(item).nextUntil(".multipleEnd").filter("[class*='group']"), $(item).nextUntil(".multipleEnd").find("[class*='group']")).each(function (index, item) {
|
|
|
+ checkId = $(item).find('.yaoshi').attr("answer-id");
|
|
|
+ var gid = $(item).attr('class').replace(/.*group(\d+).*/g, "$1");
|
|
|
+ if (index == 0 || groupId != gid) {
|
|
|
+ groupId = gid;
|
|
|
+ headid = checkId;
|
|
|
+ }
|
|
|
+ $(item).find('.yaoshi').attr('parent-anid', headid);
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
//显示/隐藏习题答案
|
|
|
@@ -414,7 +489,7 @@ function bindEventYS() {
|
|
|
});
|
|
|
}
|
|
|
var pressTableFlag = false;
|
|
|
-// 移动端使用(表格处理)
|
|
|
+// 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
|
function getPressFlag() {
|
|
|
alert(pressTableFlag);
|
|
|
}
|
|
|
@@ -435,6 +510,51 @@ function handleAnswerRange() {
|
|
|
//规范文本格式
|
|
|
var answerId = "";
|
|
|
var tempJson = new Array();
|
|
|
+ //先处理一题多空的情况,获取两个之间的答题点
|
|
|
+ $(".multipleStart").each(function (i, item) {
|
|
|
+ $.merge($(item).nextUntil(".multipleEnd").filter("[class*='group']"), $(item).nextUntil(".multipleEnd").find("[class*='group']")).each(function (index, item) {
|
|
|
+ var checkId = $(item).find('.yaoshi').attr("answer-id");
|
|
|
+ var headid = $(item).find('.yaoshi').attr("parent-anid");
|
|
|
+ var ischecked = $(item).find(".underlineContent").text().indexOf("√") > -1;
|
|
|
+ var answerText = ischecked ? "√" : "";
|
|
|
+ //勾选题
|
|
|
+ if ($(item).hasClass('boxQue')) {
|
|
|
+ $(item).find('.yaoshi').after("<div class='checkbox' answer-id='" + checkId + "' parent-anid='" + headid + "' answer-isky='2' answer-anstext=" + answerText + "><input id=" + checkId + " type='checkbox'><label for=" + checkId + "></label></div>");
|
|
|
+ //$(item).find('input').prop('checked', ischecked);
|
|
|
+ $(item).find('.underlineContent').hide();
|
|
|
+ }
|
|
|
+ //点击事件
|
|
|
+ $(item).find('input').bind("click", function () {
|
|
|
+ var curObj = new Object();
|
|
|
+ curObj.Id = $(this).parent().attr("answer-id");//答题点ID
|
|
|
+ curObj.pId = $(this).parent().attr("parent-anid");//答题点ID
|
|
|
+ curObj.IsKY = $(this).parent().attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题,2-打勾题
|
|
|
+ //curObj.Text = $(this).parent().attr("answer-text");//用户作答内容
|
|
|
+ curObj.Score = $(this).parent().attr("answer-score");//作答评分
|
|
|
+ curObj.AnsText = $(this).parent().attr("answer-anstext");//参考答案
|
|
|
+ curObj.Comment = $(this).parent().attr("answer-comment");//评语
|
|
|
+ curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
+ curObj.Text = $(this).prop("checked") ? "√" : "";//用户作答内容
|
|
|
+ $(this).parent().attr("answer-text", curObj.Text);//用户作答内容
|
|
|
+
|
|
|
+ $(".checkbox").removeClass("select-answer");
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(this).parent().addClass("select-answer");
|
|
|
+
|
|
|
+ //已作答,弹出作答答案
|
|
|
+ if ($(this).parent().data("ans-status") == "1") {
|
|
|
+ //移动端添加外部处理
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //移动端添加外部处理,弹出作答操作
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //删除钥匙节点
|
|
|
+ $(item).find('.yaoshi').hide();
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
//所有underline不做处理
|
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
|
|
|
@@ -522,6 +642,7 @@ function handleAnswerRange() {
|
|
|
|
|
|
//合并参考答案数据
|
|
|
var tempid = "";
|
|
|
+ var temppid = "";
|
|
|
var temptext = "";
|
|
|
for (var i = 0; i < tempJson.length; i++) {
|
|
|
if (tempid == tempJson[i].Id) {
|
|
|
@@ -531,6 +652,7 @@ function handleAnswerRange() {
|
|
|
if (tempid != "") {
|
|
|
var info = new Object();
|
|
|
info.Id = tempid;
|
|
|
+ info.pId = temppid;
|
|
|
info.AnsText = temptext;
|
|
|
answerData.push(info);
|
|
|
//重置
|
|
|
@@ -539,11 +661,13 @@ function handleAnswerRange() {
|
|
|
}
|
|
|
|
|
|
tempid = tempJson[i].Id;
|
|
|
+ temppid = tempJson[i].pId;
|
|
|
temptext = tempJson[i].AnsText;
|
|
|
//最后一个存入
|
|
|
if (i == tempJson.length - 1) {
|
|
|
var info = new Object();
|
|
|
info.Id = tempid;
|
|
|
+ info.pId = temppid;
|
|
|
info.AnsText = temptext;
|
|
|
answerData.push(info);
|
|
|
}
|
|
|
@@ -561,6 +685,7 @@ function handleAnswerRange() {
|
|
|
for (var j = 0; j < index; j++) {
|
|
|
var info = new Object();
|
|
|
info.Id = (i + j).toString();
|
|
|
+ info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
}
|
|
|
@@ -568,48 +693,13 @@ function handleAnswerRange() {
|
|
|
else {
|
|
|
var info = new Object();
|
|
|
info.Id = (i).toString();
|
|
|
+ info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //获取两个之间的答题点
|
|
|
- var index = 1;
|
|
|
- var checkId = 0;
|
|
|
- $.each($(".multipleStart").nextUntil(".multipleEnd").filter("[class*='group']"), function (index, item) {
|
|
|
- $(item).find('input').removeAttr("onclick");
|
|
|
- $(item).find('input').prop('checked', false);
|
|
|
- $(item).find('input').bind("click", function () {
|
|
|
- var curObj = new Object();
|
|
|
- curObj.Id = $(this).parent().attr("answer-id");//答题点ID
|
|
|
- curObj.pId = $(this).parent().attr("parent-anid");//答题点ID
|
|
|
- curObj.IsKY = $(this).parent().attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题,2-打勾题
|
|
|
- //curObj.Text = $(this).parent().attr("answer-text");//用户作答内容
|
|
|
- curObj.Score = $(this).parent().attr("answer-score");//作答评分
|
|
|
- curObj.AnsText = $(this).parent().attr("answer-anstext");//参考答案
|
|
|
- curObj.Comment = $(this).parent().attr("answer-comment");//评语
|
|
|
- curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
- curObj.Text = $(this).prop("checked") ? "√" : "";//用户作答内容
|
|
|
-
|
|
|
- $(".checkbox").removeClass("select-answer");
|
|
|
- $(".answer-body").removeClass("select-answer");
|
|
|
- $(this).parent().addClass("select-answer");
|
|
|
-
|
|
|
- //已作答,弹出作答答案
|
|
|
- if ($(this).parent().data("ans-status") == "1") {
|
|
|
- //移动端添加外部处理
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
- else {
|
|
|
- //移动端添加外部处理,弹出作答操作
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
- });
|
|
|
- //删除钥匙节点
|
|
|
- $(item).find('.yaoshi').remove();
|
|
|
- });
|
|
|
-
|
|
|
//添加答题点的点击UI及交互
|
|
|
$.each($(".tag-span"), function (index, item) {
|
|
|
var answerText = "";
|
|
|
@@ -622,7 +712,7 @@ function handleAnswerRange() {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "'><div class='answer-audio-range'><img src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img 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 + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "' answer-showanswer='0'><div class='answer-audio-range'><img src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img 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) {
|
|
|
@@ -665,7 +755,9 @@ function handleAnswerRange() {
|
|
|
$(item).remove();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ //删除所有钥匙节点
|
|
|
+ $("img[class=yaoshi]").remove();
|
|
|
+ //console.log(JSON.stringify(answerData));
|
|
|
return answerData;
|
|
|
}
|
|
|
|
|
|
@@ -734,13 +826,25 @@ function getAllAnswer() {
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
}
|
|
|
});
|
|
|
- $("input[type=checkbox]").unbind("click");
|
|
|
- $("input[type=checkbox]").removeAttr("onclick");
|
|
|
- $("input[type=checkbox]").addr("disabled", "disabled");
|
|
|
$(".answer-body").removeClass("select-answer");//移除样式
|
|
|
$(".answer-body").unbind("click");//取消点击绑定事件
|
|
|
$(".answer-body").children(".answer-audio-range").children("span").unbind("click");//取消点击绑定事件
|
|
|
|
|
|
+ //打勾题的还原
|
|
|
+ $.each($(".checkbox"), function (num, item) {
|
|
|
+ var answerid = $(item).attr("answer-id");
|
|
|
+ var parentid = $(item).attr("parent-anid");
|
|
|
+ //提交直接还原作答现场
|
|
|
+ var mytext = $(item).attr("answer-text");//我的答案
|
|
|
+ var ischecked = mytext.indexOf("√") > -1;
|
|
|
+ var answerText = $(item).attr("answer-anstext");//参考答案
|
|
|
+
|
|
|
+ mytext = mytext == "" ? "__" : mytext;
|
|
|
+ $(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 src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ });
|
|
|
+
|
|
|
+ //console.log(JSON.stringify(answerData));
|
|
|
+
|
|
|
return answerData;
|
|
|
}
|
|
|
|
|
|
@@ -821,6 +925,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
}
|
|
|
//已评阅,查看评阅详情
|
|
|
if (statusType == 2) {
|
|
|
+ $(item).attr("answer-showanswer", "1"); // 修改显示格式
|
|
|
//添加音频控制
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
//独立绑定事件
|
|
|
@@ -856,6 +961,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
//查找
|
|
|
var index = 0;
|
|
|
var answerid = $(item).attr("answer-id");
|
|
|
+ var parentid = $(item).attr("parent-anid");
|
|
|
for (var i = 0; i < answerList.length; i++) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
@@ -866,22 +972,45 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
|
-
|
|
|
+ var answerText = $(item).attr("answer-anstext");//参考答案
|
|
|
+
|
|
|
$(item).attr("answer-text", mytext);
|
|
|
$(item).find('input').prop('checked', ischecked);
|
|
|
|
|
|
- //已提交,作答还原
|
|
|
- if (statusType == 1) {
|
|
|
- $("input[type=checkbox]").unbind("click");
|
|
|
- $("input[type=checkbox]").removeAttr("onclick");
|
|
|
- $("input[type=checkbox]").attr("disabled", "disabled");
|
|
|
- }
|
|
|
- //已评阅,查看评阅详情
|
|
|
- if (statusType == 2) {
|
|
|
- $("input[type=checkbox]").attr("disabled", "disabled");
|
|
|
- //$("input[type=checkbox]").attr("onclick", "this.checked=!this.checked");
|
|
|
+ //已提交,已评阅,还原HTML代码,去除checkbox
|
|
|
+ if (statusType == 1 || statusType == 2) {
|
|
|
+ mytext = mytext == "" ? "__" : mytext;
|
|
|
+ $(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 src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
}
|
|
|
});
|
|
|
+ //点击事件重新绑定
|
|
|
+ if (statusType == 0 || statusType == 2) {
|
|
|
+ $(".answer-body").unbind("click").on("click", function () {
|
|
|
+ var curObj = new Object();
|
|
|
+ curObj.Id = $(this).attr("answer-id");//答题点ID
|
|
|
+ curObj.pId = $(this).attr("parent-anid");//答题点ID
|
|
|
+ curObj.IsKY = $(this).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
+ curObj.Text = $(this).attr("answer-text");//用户作答内容
|
|
|
+ curObj.Score = $(this).attr("answer-score");//作答评分
|
|
|
+ curObj.AnsText = $(this).attr("answer-anstext");//参考答案
|
|
|
+ curObj.Comment = $(this).attr("answer-comment");//评语
|
|
|
+ curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
+
|
|
|
+ $(".checkbox").removeClass("select-answer");
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(this).addClass("select-answer");
|
|
|
+
|
|
|
+ //已作答,弹出作答答案
|
|
|
+ if ($(this).data("ans-status") == "1") {
|
|
|
+ //移动端添加外部处理
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //移动端添加外部处理,弹出作答操作
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -981,6 +1110,7 @@ function backupAllReview(answerJson) {
|
|
|
//查找
|
|
|
var index = 0;
|
|
|
var answerid = $(item).attr("answer-id");
|
|
|
+ var parentid = $(item).attr("parent-anid");
|
|
|
for (var i = 0; i < answerList.length; i++) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
@@ -991,10 +1121,35 @@ function backupAllReview(answerJson) {
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
|
+ var answerText = $(item).attr("answer-anstext");//参考答案
|
|
|
+ mytext = mytext == "" ? "__" : mytext;
|
|
|
+ $(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 src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range' style='display:none;'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text' style='display:block;'>" + mytext + "</buttom></div>");
|
|
|
+ });
|
|
|
+ //点击事件重新绑定
|
|
|
+ $(".answer-body").unbind("click").on("click", function () {
|
|
|
+ var curObj = new Object();
|
|
|
+ curObj.Id = $(this).attr("answer-id");//答题点ID
|
|
|
+ curObj.pId = $(this).attr("parent-anid");//答题点ID
|
|
|
+ curObj.IsKY = $(this).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
+ curObj.Text = $(this).attr("answer-text");//用户作答内容
|
|
|
+ curObj.Score = $(this).attr("answer-score");//作答评分
|
|
|
+ curObj.AnsText = $(this).attr("answer-anstext");//参考答案
|
|
|
+ curObj.Comment = $(this).attr("answer-comment");//评语
|
|
|
+ curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
|
|
|
- $(item).attr("answer-text", mytext);
|
|
|
- $(item).find('input').prop('checked', ischecked);
|
|
|
- $("input[type=checkbox]").attr("disabled", "disabled");
|
|
|
+ $(".checkbox").removeClass("select-answer");
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(this).addClass("select-answer");
|
|
|
+
|
|
|
+ //已作答,弹出作答答案
|
|
|
+ if ($(this).data("ans-status") == "1") {
|
|
|
+ //移动端添加外部处理
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //移动端添加外部处理,弹出作答操作
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -1018,6 +1173,7 @@ function playRecordAudio(answerid, isPlay) {
|
|
|
//滚动到相应DIV
|
|
|
function scrollAnswer(answerid) {
|
|
|
//console.log(answerid);
|
|
|
+ $(".checkbox").removeClass("select-answer");
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
var ansDom = $(".answer-body[answer-id='" + answerid + "']");
|
|
|
if (ansDom.length == 0) {
|