|
|
@@ -1,5 +1,5 @@
|
|
|
//播放音频图片地址
|
|
|
-var PicInfo = {
|
|
|
+var PicInfo1 = {
|
|
|
answerPointImgUrl: "file:///android_asset/js/update-answer.png",
|
|
|
yaoshiShowImgUrl: "file:///android_asset/js/yaoshi-show.png",
|
|
|
yaoshiHideImgUrl: "file:///android_asset/js/yaoshi-hide.png",
|
|
|
@@ -10,7 +10,7 @@ var PicInfo = {
|
|
|
}
|
|
|
|
|
|
//本地调用用的资源
|
|
|
-var PicInfo1 = {
|
|
|
+var PicInfo = {
|
|
|
answerPointImgUrl: "../Images/update-answer.png",
|
|
|
yaoshiShowImgUrl: "../Images/yaoshi-show.png",
|
|
|
yaoshiHideImgUrl: "../Images/yaoshi-hide.png",
|
|
|
@@ -275,14 +275,12 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
//显示、隐藏答案
|
|
|
function showHideAnswer(flag) {
|
|
|
if (flag) {
|
|
|
- $(".underlineContent").css("color", "#92D050");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
- $(".underlineContent").css("color", "#ffffff");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
@@ -301,13 +299,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
if (isShowAS) {
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- //$(item).html($(item).attr("answer-anstext"));
|
|
|
- if (!$(item).hasClass("no-answer")) {
|
|
|
- $(item).css("color", "#92D050");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).css("color", "#989898");
|
|
|
- }
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
@@ -317,7 +308,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
else {
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
@@ -417,12 +407,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, true);
|
|
|
- if (!$(item).hasClass("no-answer")) {
|
|
|
- $(item).css("color", "#92D050");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).css("color", "#989898");
|
|
|
- }
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
@@ -433,12 +417,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- if (!$(item).hasClass("no-answer")) {
|
|
|
- $(item).css("color", "#92D050");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).css("color", "#989898");
|
|
|
- }
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
});
|
|
|
@@ -457,7 +435,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
@@ -468,7 +445,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
@@ -566,16 +542,10 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- if (!$(item).hasClass("no-answer")) {
|
|
|
- $(item).css("color", "#92D050");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).css("color", "#989898");
|
|
|
- }
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}
|
|
|
else {
|
|
|
$(this).attr("data-status", "1");
|
|
|
@@ -583,21 +553,15 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
|
- if (!$(item).hasClass("no-answer")) {
|
|
|
- $(item).css("color", "#92D050");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).css("color", "#989898");
|
|
|
- }
|
|
|
$(item).find(".wordStyle").css("color", "#db5d00");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ }
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
|
if ($(".yaoshi[data-status='0']").length == 0) {
|
|
|
//添加回调
|
|
|
onClickKeyShow();
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
// 隐藏处理
|
|
|
@@ -607,7 +571,6 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
@@ -619,7 +582,6 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
$(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
$(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
});
|
|
|
@@ -1011,106 +973,71 @@ function getAllAnswer() {
|
|
|
//回填所有答案,answerJson:所有作答及参考答案List,statusType:0-可作答,1-已提交,2-查看评阅
|
|
|
function backupAllAnswer(answerJson, statusType) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
- var answerList = JSON.parse(answerJson);
|
|
|
- $.each($(".answer-body"), function (num, item) {
|
|
|
- //查找
|
|
|
- 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;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //提交直接还原作答现场
|
|
|
- var mytext = answerList[index].Text;//我的答案
|
|
|
- answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
- //添加音频控制
|
|
|
- var hasAudio = false;
|
|
|
- var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
|
- if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- hasAudio = true;
|
|
|
- $(item).children(".answer-point-range").hide();
|
|
|
- $(item).children(".answer-audio-range").css("display", "inline-block");
|
|
|
- $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
|
|
|
- //填充作答内容
|
|
|
- $(item).attr("answer-text", mytext);
|
|
|
- if (mytext != "") {
|
|
|
- mytext = "(" + mytext + ")";
|
|
|
- $(item).children(".answer-text").show();
|
|
|
- $(item).children(".answer-text").text(mytext);
|
|
|
+ var answerList = JSON.parse(answerJson);
|
|
|
+ $.each($(".answer-body"), function (num, item) {
|
|
|
+ //查找
|
|
|
+ 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;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- //音频节点
|
|
|
- $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
- $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
- $(item).children(".answer-audio-range").attr("play-status", "0");
|
|
|
-
|
|
|
- //独立绑定事件
|
|
|
- $(audioElement).on("click", function () {
|
|
|
- recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
- });
|
|
|
- }
|
|
|
- //可作答状态,作答还原
|
|
|
- if (statusType == 0) {
|
|
|
- //已作答过,还原作答,增加作答后的UI节点
|
|
|
+ //提交直接还原作答现场
|
|
|
+ var mytext = answerList[index].Text;//我的答案
|
|
|
+ answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
+ //添加音频控制
|
|
|
+ var hasAudio = false;
|
|
|
+ var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
- $(".answer-body").removeClass("select-answer");
|
|
|
- $(item).addClass("select-answer");
|
|
|
- onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
- });
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
+ hasAudio = true;
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-audio-range").css("display", "inline-block");
|
|
|
+ $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
|
|
|
+ //填充作答内容
|
|
|
+ $(item).attr("answer-text", mytext);
|
|
|
if (mytext != "") {
|
|
|
+ mytext = "(" + mytext + ")";
|
|
|
$(item).children(".answer-text").show();
|
|
|
- $(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
}
|
|
|
+ //音频节点
|
|
|
+ $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
+ $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
+ $(item).children(".answer-audio-range").attr("play-status", "0");
|
|
|
+
|
|
|
+ //独立绑定事件
|
|
|
+ $(audioElement).on("click", function () {
|
|
|
+ recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
- //已提交,作答还原
|
|
|
- if (statusType == 1) {
|
|
|
- //取消点击绑定事件
|
|
|
- $(item).unbind('click');
|
|
|
- //填充作答内容
|
|
|
- $(item).attr("answer-text", mytext);
|
|
|
- if (mytext == "" && !hasAudio) {
|
|
|
- mytext = "未作答";
|
|
|
- if (parentid != answerid) {
|
|
|
- mytext = " ";
|
|
|
- $(item).children(".answer-text").html(mytext);
|
|
|
- $(item).children(".answer-text").addClass("noanswer-border");
|
|
|
+ //可作答状态,作答还原
|
|
|
+ if (statusType == 0) {
|
|
|
+ //已作答过,还原作答,增加作答后的UI节点
|
|
|
+ if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
+ $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(item).addClass("select-answer");
|
|
|
+ onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
+ });
|
|
|
}
|
|
|
else {
|
|
|
- $(item).children(".answer-text").text(mytext);
|
|
|
- $(item).children(".answer-text").addClass("no-answer");
|
|
|
+ $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
+ if (mytext != "") {
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ }
|
|
|
}
|
|
|
- $(item).children(".answer-text").show();
|
|
|
- }
|
|
|
- else if (mytext == "" && hasAudio) {
|
|
|
- $(item).children(".answer-text").hide();
|
|
|
}
|
|
|
- else {
|
|
|
- $(item).children(".answer-text").show();
|
|
|
- $(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
- $(item).children(".answer-point-range").hide();
|
|
|
- }
|
|
|
- //已评阅,查看评阅详情
|
|
|
- if (statusType == 2) {
|
|
|
- //添加音频控制
|
|
|
- if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- //独立绑定事件
|
|
|
- $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
- $(".answer-body").removeClass("select-answer");
|
|
|
- $(item).addClass("select-answer");
|
|
|
- onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
- });
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
+ //已提交,作答还原
|
|
|
+ if (statusType == 1) {
|
|
|
+ //取消点击绑定事件
|
|
|
+ $(item).unbind('click');
|
|
|
+ //填充作答内容
|
|
|
+ $(item).attr("answer-text", mytext);
|
|
|
if (mytext == "" && !hasAudio) {
|
|
|
mytext = "未作答";
|
|
|
if (parentid != answerid) {
|
|
|
@@ -1133,82 +1060,114 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
}
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
- //评阅样式
|
|
|
- if (answerList[index].Score == 0 && answerList[index].Text != "") {
|
|
|
- $(item).children(".answer-text").addClass("bad-answer");
|
|
|
- }
|
|
|
- if (answerList[index].Score > 0) {
|
|
|
- $(item).children(".answer-text").addClass("good-answer");
|
|
|
- }
|
|
|
- }
|
|
|
- // 添加answer-boy的样式判断
|
|
|
- var DStatusFlag = $(item).find(".answer-point-range").css("display") != "none";
|
|
|
- if (DStatusFlag) {
|
|
|
- $(item).attr("answer-showanswer", "0"); // 修改显示格式
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).attr("answer-showanswer", "1"); // 修改显示格式
|
|
|
- }
|
|
|
- });
|
|
|
- //打勾题的还原
|
|
|
- $.each($(".checkbox"), function (num, item) {
|
|
|
- //可作答状态,作答还原
|
|
|
- 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;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //提交直接还原作答现场
|
|
|
- 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);
|
|
|
- //已提交,已评阅,还原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");
|
|
|
+ //已评阅,查看评阅详情
|
|
|
if (statusType == 2) {
|
|
|
- $(".answer-body[parent-anid=" + curObj.pId + "]").addClass("select-answer");
|
|
|
+ //添加音频控制
|
|
|
+ if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
+ //独立绑定事件
|
|
|
+ $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(item).addClass("select-answer");
|
|
|
+ onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
+ if (mytext == "" && !hasAudio) {
|
|
|
+ mytext = "未作答";
|
|
|
+ if (parentid != answerid) {
|
|
|
+ mytext = " ";
|
|
|
+ $(item).children(".answer-text").html(mytext);
|
|
|
+ $(item).children(".answer-text").addClass("noanswer-border");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ $(item).children(".answer-text").addClass("no-answer");
|
|
|
+ }
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ }
|
|
|
+ else if (mytext == "" && hasAudio) {
|
|
|
+ $(item).children(".answer-text").hide();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ }
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ }
|
|
|
+ //评阅样式
|
|
|
+ if (answerList[index].Score == 0 && answerList[index].Text != "") {
|
|
|
+ $(item).children(".answer-text").addClass("bad-answer");
|
|
|
+ }
|
|
|
+ if (answerList[index].Score > 0) {
|
|
|
+ $(item).children(".answer-text").addClass("good-answer");
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- $(this).addClass("select-answer");
|
|
|
- }
|
|
|
-
|
|
|
- //已作答,弹出作答答案
|
|
|
- if ($(this).data("ans-status") == "1") {
|
|
|
- //移动端添加外部处理
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ // 添加answer-boy的样式判断
|
|
|
+ var DStatusFlag = $(item).find(".answer-point-range").css("display") != "none";
|
|
|
+ if (DStatusFlag) {
|
|
|
+ $(item).attr("answer-showanswer", "0"); // 修改显示格式
|
|
|
}
|
|
|
else {
|
|
|
- //移动端添加外部处理,弹出作答操作
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ $(item).attr("answer-showanswer", "1"); // 修改显示格式
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //打勾题的还原
|
|
|
+ $.each($(".checkbox"), function (num, item) {
|
|
|
+ //可作答状态,作答还原
|
|
|
+ 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;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //提交直接还原作答现场
|
|
|
+ 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);
|
|
|
+ //已提交,已评阅,还原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");
|
|
|
+ if (statusType == 2) {
|
|
|
+ $(".answer-body[parent-anid=" + curObj.pId + "]").addClass("select-answer");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $(this).addClass("select-answer");
|
|
|
+ }
|
|
|
+ //已作答,弹出作答答案
|
|
|
+ if ($(this).data("ans-status") == "1") {
|
|
|
+ //移动端添加外部处理
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //移动端添加外部处理,弹出作答操作
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
-}
|
|
|
-}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//老师评阅学生作答
|
|
|
@@ -1508,6 +1467,7 @@ function onClickKeyShow() {
|
|
|
cancelBubble();
|
|
|
plugin.onClickKeyShow();
|
|
|
}
|
|
|
+
|
|
|
function cancelBubble(e) {
|
|
|
var evt = e ? e : window.event;
|
|
|
if (evt.stopPropagation) { //W3C
|