|
|
@@ -561,7 +561,7 @@ function bindEventTeaOrignalYS() {
|
|
|
//改错题,要随机下划线长度
|
|
|
if ($(parent).hasClass('correntQue')) {
|
|
|
uHtml.style = "width:" +randomNum(220, 300) + "px;";
|
|
|
- }
|
|
|
+ }
|
|
|
uHtml.setAttribute("answer-anstext", "");
|
|
|
}
|
|
|
}
|
|
|
@@ -653,33 +653,33 @@ function bindEventTeaOrignalYS() {
|
|
|
//页面加载完,课件 绑定事件
|
|
|
function bindEventYS() {
|
|
|
var bodyWidth = $(document.body).width();
|
|
|
- //不存在underline 属性下有内容,所以全部隐藏,若有就是源头数据有问题
|
|
|
+ //不存在underline 属性下有内容,所以全部隐藏,若有就是源头数据有问题
|
|
|
$('.underline').css("display", "none");
|
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
|
$(item).attr('answer-id', index);
|
|
|
});
|
|
|
- //给音频绑定一个ID
|
|
|
+ //给音频绑定一个ID
|
|
|
$.each($(".audioImg"), function (index, item) {
|
|
|
$(item).attr("audiourl", "");
|
|
|
$(item).attr('audio-id', index);
|
|
|
});
|
|
|
- //给视频图标处理
|
|
|
+ //给视频图标处理
|
|
|
$.each($(".videoImg"), function (index, item) {
|
|
|
$(item).attr("audiourl", "");
|
|
|
});
|
|
|
- //给口语图标处理
|
|
|
+ //给口语图标处理
|
|
|
$.each($(".oralLanguageImg"), function (index, item) {
|
|
|
$(item).attr("audiourl", "");
|
|
|
});
|
|
|
- //去除多余的U空标签
|
|
|
+ //去除多余的U空标签
|
|
|
$.each($("u"), function (index, item) {
|
|
|
var text = $(item).text();
|
|
|
text = text.replace(/\s+/g, "");
|
|
|
if (text == "") {
|
|
|
$(item).remove();
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- //处理暂无参考答案
|
|
|
+ //处理暂无参考答案
|
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
|
var parent = $(item).parent();
|
|
|
var prev = $(item).nextAll(".underlineContent");
|
|
|
@@ -694,16 +694,16 @@ function bindEventYS() {
|
|
|
//改错题,要随机下划线长度
|
|
|
if ($(parent).hasClass('correntQue')) {
|
|
|
uHtml.style = "width:" +randomNum(220, 300) + "px;";
|
|
|
- }
|
|
|
+ }
|
|
|
uHtml.setAttribute("answer-anstext", "");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
$(item).after(uHtml);
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- //处理表格宽度
|
|
|
+ //处理表格宽度
|
|
|
AdjustTableFunc();
|
|
|
- //一题多空的答题点标注
|
|
|
+ //一题多空的答题点标注
|
|
|
var checkId = 0;
|
|
|
var headid = -1;
|
|
|
var groupId = -1;
|
|
|
@@ -715,12 +715,12 @@ function bindEventYS() {
|
|
|
if (index == 0 || groupId != gid) {
|
|
|
groupId = gid;
|
|
|
headid = checkId;
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).find('.yaoshi').attr('parent-anid', headid);
|
|
|
- });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
- //显示/隐藏习题答案
|
|
|
+ //显示/隐藏习题答案
|
|
|
$(".yaoshi").on("click", function () {
|
|
|
var parentAnid = $(this).attr("parent-anid");
|
|
|
if ($(this).attr("data-status") == "0") {
|
|
|
@@ -731,8 +731,8 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true, false);
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}
|
|
|
else {
|
|
|
$(this).attr("data-status", "1");
|
|
|
@@ -740,13 +740,13 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true, false);
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ }
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
|
if ($(".yaoshi[data-status='0']").length == 0) {
|
|
|
//添加回调
|
|
|
onClickKeyShow();
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
// 隐藏处理
|
|
|
@@ -756,8 +756,8 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false, false);
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}
|
|
|
else {
|
|
|
$(this).attr("data-status", "0");
|
|
|
@@ -765,17 +765,17 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false, false);
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ }
|
|
|
//添加回调
|
|
|
onClickKeyHide();
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- //点击喇叭事件,音频播放
|
|
|
+ //点击喇叭事件,音频播放
|
|
|
$(".audioImg").on("click", function () {
|
|
|
audioPlayClick(this);
|
|
|
});
|
|
|
- //点击播放事件,视频播放
|
|
|
+ //点击播放事件,视频播放
|
|
|
$(".videoImg").on("click", function () {
|
|
|
$(this).attr("audiourl", "");
|
|
|
var curHtml = $(this).parent().find(".videoUrl").html();
|
|
|
@@ -784,25 +784,24 @@ function bindEventYS() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
|
- function getPressFlag() {
|
|
|
+// 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
|
+function getPressFlag() {
|
|
|
return pressTableFlag;
|
|
|
}
|
|
|
- // 滚动条渲染
|
|
|
|
|
|
- // 设置离焦事件
|
|
|
- function resetPressFlag() {
|
|
|
+// 设置离焦事件
|
|
|
+function resetPressFlag() {
|
|
|
pressTableFlag = false;
|
|
|
}
|
|
|
- //学生端 处理作答区域
|
|
|
- var answerData = new Array();
|
|
|
- function handleAnswerRange() {
|
|
|
- // 隐藏答案划线
|
|
|
+//学生端 处理作答区域
|
|
|
+var answerData = new Array();
|
|
|
+function handleAnswerRange() {
|
|
|
+ // 隐藏答案划线
|
|
|
$(".underlineContentShow").attr("data-status", "0");
|
|
|
- //规范文本格式
|
|
|
+ //规范文本格式
|
|
|
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");
|
|
|
@@ -814,7 +813,7 @@ function bindEventYS() {
|
|
|
$(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();
|
|
|
@@ -841,14 +840,14 @@ function bindEventYS() {
|
|
|
else {
|
|
|
//移动端添加外部处理,弹出作答操作
|
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
//删除钥匙节点
|
|
|
$(item).find('.yaoshi').hide();
|
|
|
- });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
- //所有underline不做处理
|
|
|
+ //所有underline不做处理
|
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
|
|
|
tempId = $(item).prevAll(".yaoshi").attr("answer-id");
|
|
|
//记录上一次的ID
|
|
|
@@ -857,16 +856,16 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
answerId = tempId;
|
|
|
- }
|
|
|
+ }
|
|
|
var prev = $(item).prev();
|
|
|
if ((prev.length == 0 || $(prev).attr("class") != "tag-span") && $(prev).attr("class") != "underlineContent") {
|
|
|
if ($("span[answer-id='" + tempId + "']").length == 0) {
|
|
|
$(item).prop("outerHTML", "<span answer-id='" + tempId + "' class='tag-span' answer-isky='0'>_</span>");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
$(item).remove();
|
|
|
});
|
|
|
- //提取参考答案并规范文本格式
|
|
|
+ //提取参考答案并规范文本格式
|
|
|
answerId = "";
|
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
var info = new Object();
|
|
|
@@ -878,14 +877,14 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
answerId = info.Id;
|
|
|
- }
|
|
|
+ }
|
|
|
if (info.pId == undefined) {
|
|
|
info.pId = answerId;
|
|
|
- }
|
|
|
+ }
|
|
|
info.AnsText = $(item).attr("answer-anstext");
|
|
|
if (info.AnsText == undefined) {
|
|
|
info.AnsText = $(item).text();
|
|
|
- }
|
|
|
+ }
|
|
|
tempJson.push(info);
|
|
|
var prev = $(item).prev();
|
|
|
if (!$(prev).hasClass("checkbox")) {
|
|
|
@@ -895,8 +894,8 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
$(item).remove();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
});
|
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
|
var Id = $(item).attr("answer-id");
|
|
|
@@ -909,28 +908,28 @@ function bindEventYS() {
|
|
|
uHtml.innerText = "_";
|
|
|
uHtml.setAttribute("answer-id", Id);
|
|
|
$(item).after(uHtml);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
- //处理口语试题
|
|
|
+ //处理口语试题
|
|
|
$.each($(".oralLanguage").nextUntil(".oralLanguageDone"), function (num, part) {
|
|
|
if (part.tagName != "p") {
|
|
|
$.each($(part).find(".tag-span"), function (index, item) {
|
|
|
$(item).attr("answer-isky", "1");
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
else {
|
|
|
if ($(part).hasClass("underlinePart")) {
|
|
|
$.each($(part).find(".tag-span"), function (index, item) {
|
|
|
$(item).attr("answer-isky", "1");
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
- //合并参考答案数据
|
|
|
+ //合并参考答案数据
|
|
|
var tempid = "";
|
|
|
var temppid = "";
|
|
|
var temptext = "";
|
|
|
@@ -948,7 +947,7 @@ function bindEventYS() {
|
|
|
//重置
|
|
|
tempid = "";
|
|
|
temptext = "";
|
|
|
- }
|
|
|
+ }
|
|
|
tempid = tempJson[i].Id;
|
|
|
temppid = tempJson[i].pId;
|
|
|
temptext = tempJson[i].AnsText;
|
|
|
@@ -959,11 +958,11 @@ function bindEventYS() {
|
|
|
info.pId = temppid;
|
|
|
info.AnsText = temptext;
|
|
|
answerData.push(info);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- //补全答题点
|
|
|
+ //补全答题点
|
|
|
var Num = 0;
|
|
|
if (answerData.length > 0) {
|
|
|
//Num = Number.parseInt(answerData[answerData.length - 1].Id);
|
|
|
@@ -977,7 +976,7 @@ function bindEventYS() {
|
|
|
info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
var info = new Object();
|
|
|
@@ -985,11 +984,11 @@ function bindEventYS() {
|
|
|
info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- //添加答题点的点击UI及交互
|
|
|
+ //添加答题点的点击UI及交互
|
|
|
$.each($(".tag-span"), function (index, item) {
|
|
|
var answerText = "";
|
|
|
var parentId = "";
|
|
|
@@ -1001,17 +1000,17 @@ function bindEventYS() {
|
|
|
parentId = answerData[i].pId;
|
|
|
answerText = answerData[i].AnsText;
|
|
|
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 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) {
|
|
|
$(prev).remove();
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- //添加点击事件
|
|
|
+ //添加点击事件
|
|
|
$(".answer-body").on("click", function () {
|
|
|
var curObj = new Object();
|
|
|
curObj.Id = $(this).attr("answer-id");//答题点ID
|
|
|
@@ -1033,25 +1032,25 @@ function bindEventYS() {
|
|
|
else {
|
|
|
//移动端添加外部处理,弹出作答操作
|
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- //去除多余的空格横线
|
|
|
+ //去除多余的空格横线
|
|
|
$.each($(".underline"), function (index, item) {
|
|
|
var text = $(item).text();
|
|
|
text = text.replace(/\s+/g, "");
|
|
|
if (text == "") {
|
|
|
$(item).remove();
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- //删除所有钥匙节点
|
|
|
+ //删除所有钥匙节点
|
|
|
$("img[class=yaoshi]").remove();
|
|
|
- //console.log(JSON.stringify(answerData));
|
|
|
+ //console.log(JSON.stringify(answerData));
|
|
|
return answerData;
|
|
|
}
|
|
|
|
|
|
- //接收学生的作答
|
|
|
- function reviewAnswer(answerJson) {
|
|
|
+//接收学生的作答
|
|
|
+function reviewAnswer(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerObj = JSON.parse(answerJson);
|
|
|
var selectElement = $(".answer-body[answer-id='" +answerObj.Id + "']");
|
|
|
@@ -1069,7 +1068,7 @@ function bindEventYS() {
|
|
|
answerObj.Text = "(" +answerObj.Text + ")";
|
|
|
$(selectElement).children(".answer-text").show();
|
|
|
$(selectElement).children(".answer-text").text(answerObj.Text);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
//是否之前存在作答音频
|
|
|
$(selectElement).attr("answer-url", answerObj.AudioUrl);
|
|
|
@@ -1078,12 +1077,12 @@ function bindEventYS() {
|
|
|
//独立绑定事件
|
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerObj.Id, answerObj.AudioUrl);
|
|
|
- });
|
|
|
+ });
|
|
|
$(selectElement).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
$(selectElement).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerObj));
|
|
|
- });
|
|
|
+ });
|
|
|
$(selectElement).attr("answer-showanswer", "1");
|
|
|
}
|
|
|
else {
|
|
|
@@ -1098,14 +1097,14 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(selectElement).children(".answer-text").hide();
|
|
|
$(selectElement).children(".answer-point-range").show();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- //提交,获取所有作答答案及参考答案
|
|
|
- function getAllAnswer() {
|
|
|
- //处理作答
|
|
|
+//提交,获取所有作答答案及参考答案
|
|
|
+function getAllAnswer() {
|
|
|
+ //处理作答
|
|
|
$.each($(".answer-body"), function (index, item) {
|
|
|
var answerid = $(item).attr("answer-id");
|
|
|
var parentid = $(item).attr("parent-anid");
|
|
|
@@ -1124,12 +1123,12 @@ function bindEventYS() {
|
|
|
}
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").show();
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
$(".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");
|
|
|
@@ -1140,12 +1139,12 @@ function bindEventYS() {
|
|
|
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));
|
|
|
+ //console.log(JSON.stringify(answerData));
|
|
|
return answerData;
|
|
|
}
|
|
|
|
|
|
- //回填所有答案,answerJson:所有作答及参考答案List,statusType:0-可作答,1-已提交,2-查看评阅
|
|
|
- function backupAllAnswer(answerJson, statusType) {
|
|
|
+//回填所有答案,answerJson:所有作答及参考答案List,statusType:0-可作答,1-已提交,2-查看评阅
|
|
|
+function backupAllAnswer(answerJson, statusType) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerList = JSON.parse(answerJson);
|
|
|
$.each($(".answer-body"), function (num, item) {
|
|
|
@@ -1157,8 +1156,8 @@ function bindEventYS() {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
@@ -1176,7 +1175,7 @@ function bindEventYS() {
|
|
|
mytext = "(" + mytext + ")";
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
+ }
|
|
|
//音频节点
|
|
|
$(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
$(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
@@ -1185,8 +1184,8 @@ function bindEventYS() {
|
|
|
//独立绑定事件
|
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ }
|
|
|
//可作答状态,作答还原
|
|
|
if (statusType == 0) {
|
|
|
//已作答过,还原作答,增加作答后的UI节点
|
|
|
@@ -1195,7 +1194,7 @@ function bindEventYS() {
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
|
@@ -1203,9 +1202,9 @@ function bindEventYS() {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
//已提交,作答还原
|
|
|
if (statusType == 1) {
|
|
|
//取消点击绑定事件
|
|
|
@@ -1222,7 +1221,7 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
|
else if (mytext == "" && hasAudio) {
|
|
|
@@ -1231,9 +1230,9 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
- }
|
|
|
+ }
|
|
|
//已评阅,查看评阅详情
|
|
|
if (statusType == 2) {
|
|
|
//添加音频控制
|
|
|
@@ -1243,7 +1242,7 @@ function bindEventYS() {
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
|
@@ -1257,7 +1256,7 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
|
else if (mytext == "" && hasAudio) {
|
|
|
@@ -1266,17 +1265,17 @@ function bindEventYS() {
|
|
|
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");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
// 添加answer-boy的样式判断
|
|
|
var DStatusFlag = $(item).find(".answer-point-range").css("display") != "none";
|
|
|
if (DStatusFlag) {
|
|
|
@@ -1284,8 +1283,8 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-showanswer", "1"); // 修改显示格式
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
//打勾题的还原
|
|
|
$.each($(".checkbox"), function (num, item) {
|
|
|
//可作答状态,作答还原
|
|
|
@@ -1296,8 +1295,8 @@ function bindEventYS() {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
|
@@ -1308,8 +1307,8 @@ function bindEventYS() {
|
|
|
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 () {
|
|
|
@@ -1329,7 +1328,7 @@ function bindEventYS() {
|
|
|
}
|
|
|
else {
|
|
|
$(this).addClass("select-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
//已作答,弹出作答答案
|
|
|
if ($(this).data("ans-status") == "1") {
|
|
|
//移动端添加外部处理
|
|
|
@@ -1338,14 +1337,14 @@ function bindEventYS() {
|
|
|
else {
|
|
|
//移动端添加外部处理,弹出作答操作
|
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //老师评阅学生作答
|
|
|
- function reviewStuAnswer(answerJson) {
|
|
|
+//老师评阅学生作答
|
|
|
+function reviewStuAnswer(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerObj = JSON.parse(answerJson);
|
|
|
var selectElement = $(".answer-body[answer-id='" +answerObj.Id + "']");
|
|
|
@@ -1358,16 +1357,16 @@ function bindEventYS() {
|
|
|
if (answerObj.Score == 0) {
|
|
|
$(selectElement).children(".answer-text").removeClass("good-answer");
|
|
|
$(selectElement).children(".answer-text").addClass("bad-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
if (answerObj.Score > 0) {
|
|
|
$(selectElement).children(".answer-text").removeClass("bad-answer");
|
|
|
$(selectElement).children(".answer-text").addClass("good-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //回填所有评阅信息,answerJson:所有作答及参考答案评阅信息List
|
|
|
- function backupAllReview(answerJson) {
|
|
|
+//回填所有评阅信息,answerJson:所有作答及参考答案评阅信息List
|
|
|
+function backupAllReview(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerList = JSON.parse(answerJson);
|
|
|
$.each($(".answer-body"), function (num, item) {
|
|
|
@@ -1379,8 +1378,8 @@ function bindEventYS() {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
//$(item).attr("answer-id", answerList[index].Id);//答题点ID
|
|
|
//$(item).attr("answer-text", answerList[index].Text);//用户作答内容
|
|
|
$(item).attr("answer-score", answerList[index].Score);//作答评分
|
|
|
@@ -1400,7 +1399,7 @@ function bindEventYS() {
|
|
|
mytext = "(" + mytext + ")";
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
+ }
|
|
|
//是否之前存在作答音频
|
|
|
$(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
$(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
@@ -1408,12 +1407,12 @@ function bindEventYS() {
|
|
|
//独立绑定事件
|
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerList[index].Id, 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);//填充作答内容
|
|
|
@@ -1427,22 +1426,22 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
- }
|
|
|
+ }
|
|
|
//评阅样式
|
|
|
if (answerList[index].Score == 0) {
|
|
|
$(item).children(".answer-text").addClass("bad-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
if (answerList[index].Score > 0) {
|
|
|
$(item).children(".answer-text").addClass("good-answer");
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
//打勾题的还原
|
|
|
$.each($(".checkbox"), function (num, item) {
|
|
|
//查找
|
|
|
@@ -1453,8 +1452,8 @@ function bindEventYS() {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
@@ -1462,7 +1461,7 @@ function bindEventYS() {
|
|
|
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();
|
|
|
@@ -1487,14 +1486,14 @@ function bindEventYS() {
|
|
|
else {
|
|
|
//移动端添加外部处理,弹出作答操作
|
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
|
|
|
- function playRecordAudio(answerid, isPlay) {
|
|
|
- //获取其他正在播放的音频
|
|
|
+//处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
|
|
|
+function playRecordAudio(answerid, isPlay) {
|
|
|
+ //获取其他正在播放的音频
|
|
|
var playing = $(".answer-body[answer-id='" + answerid + "']").children(".answer-audio-range");
|
|
|
if (playing.length > 0) {
|
|
|
if (isPlay == "1") {
|
|
|
@@ -1504,12 +1503,12 @@ function bindEventYS() {
|
|
|
else {
|
|
|
$(playing).attr("play-status", "0");
|
|
|
$(playing).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- //滚动到相应DIV
|
|
|
- function scrollAnswer(answerid) {
|
|
|
- //console.log(answerid);
|
|
|
+//滚动到相应DIV
|
|
|
+function scrollAnswer(answerid) {
|
|
|
+ //console.log(answerid);
|
|
|
$(".checkbox").removeClass("select-answer");
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
var ansDom = $(".answer-body[parent-anid='" + answerid + "']");
|
|
|
@@ -1527,9 +1526,9 @@ function bindEventYS() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //暂停播放原文音频
|
|
|
- function pauseTextAudio(audioid) {
|
|
|
- //获取其他正在播放的音频
|
|
|
+//暂停播放原文音频
|
|
|
+function pauseTextAudio(audioid) {
|
|
|
+ //获取其他正在播放的音频
|
|
|
var playing = $(".audioImg[audio-id='" + audioid + "']");
|
|
|
if (playing.length > 0) {
|
|
|
$(playing).attr("play-status", "0");
|
|
|
@@ -1537,11 +1536,11 @@ function bindEventYS() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //原文音频播放按钮点击事件
|
|
|
- function audioPlayClick(myobj) {
|
|
|
+//原文音频播放按钮点击事件
|
|
|
+function audioPlayClick(myobj) {
|
|
|
var curHtml = $(myobj).parent().find(".audioUrl").html();
|
|
|
var curAlt = $(myobj).attr("alt");
|
|
|
- //处理当前按钮的状
|
|
|
+ //处理当前按钮的状
|
|
|
if ($(myobj).attr("play-status") == "1") {
|
|
|
$(myobj).attr("play-status", "0");
|
|
|
$(myobj).attr("src", PicInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
@@ -1552,13 +1551,13 @@ function bindEventYS() {
|
|
|
if (isRecordPlaying.length > 0) {
|
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
- }
|
|
|
+ }
|
|
|
//停止其他原文音频播放
|
|
|
var audioPlaying = $(".audioImg[play-status='1']");
|
|
|
if (audioPlaying.length > 0) {
|
|
|
$(audioPlaying).attr("play-status", "0");
|
|
|
$(audioPlaying).attr("src", PicInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
- }
|
|
|
+ }
|
|
|
//设置播放状态
|
|
|
$(myobj).attr("play-status", "1");
|
|
|
$(myobj).attr("src", PicInfo.audioPlayImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
@@ -1566,26 +1565,26 @@ function bindEventYS() {
|
|
|
var info = new Object();
|
|
|
info.Id = $(myobj).attr("audio-id");
|
|
|
info.AudioUrl = curAlt;
|
|
|
- //移动端添加外部处理
|
|
|
+ //移动端添加外部处理
|
|
|
playVisiableAudioCallBack(1, JSON.stringify(info));
|
|
|
}
|
|
|
|
|
|
- //作答录音播放按钮点击事件
|
|
|
- function recordAudioClick(myobj, id, url) {
|
|
|
- //处理当前按钮的状态
|
|
|
+//作答录音播放按钮点击事件
|
|
|
+function recordAudioClick(myobj, id, url) {
|
|
|
+ //处理当前按钮的状态
|
|
|
if ($(myobj).parent().attr("play-status") == "0") {
|
|
|
//停止其他作答音频播放
|
|
|
var isRecordPlaying = $(".answer-audio-range[play-status='1']");
|
|
|
if (isRecordPlaying.length > 0) {
|
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
- }
|
|
|
+ }
|
|
|
//停止其他原文音频播放
|
|
|
var audioPlaying = $(".audioImg[play-status='1']");
|
|
|
if (audioPlaying.length > 0) {
|
|
|
$(audioPlaying).attr("play-status", "0");
|
|
|
$(audioPlaying).attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
- }
|
|
|
+ }
|
|
|
//设置播放状态
|
|
|
$(myobj).parent().attr("play-status", "1");
|
|
|
$(myobj).attr("src", PicInfo.recordPauseImgUrl);//移动端要根据本地路径替换
|
|
|
@@ -1594,19 +1593,19 @@ function bindEventYS() {
|
|
|
$(myobj).parent().attr("play-status", "0");
|
|
|
$(myobj).attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
}
|
|
|
- //移动端添加外部处理,播放录音
|
|
|
+ //移动端添加外部处理,播放录音
|
|
|
var info = new Object();
|
|
|
info.Id = id;
|
|
|
info.AudioUrl = url;
|
|
|
- //移动端添加外部处理,播放录音
|
|
|
+ //移动端添加外部处理,播放录音
|
|
|
playVisiableAudioCallBack(3, JSON.stringify(info));
|
|
|
}
|
|
|
|
|
|
- //生成从minNum到maxNum的随机数
|
|
|
- function randomNum(minNum, maxNum) {
|
|
|
+//生成从minNum到maxNum的随机数
|
|
|
+function randomNum(minNum, maxNum) {
|
|
|
switch (arguments.length) {
|
|
|
case 1:
|
|
|
- return parseInt(Math.random() * minNum +1, 10);
|
|
|
+ return parseInt(Math.random() * minNum + 1, 10);
|
|
|
break;
|
|
|
case 2:
|
|
|
return parseInt(Math.random() * (maxNum - minNum + 1) +minNum, 10);
|
|
|
@@ -1626,32 +1625,32 @@ function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
|
|
|
dealAnswerFunc(element, true, true);
|
|
|
});
|
|
|
}
|
|
|
- function playVisiableAudioCallBack(type, url) {
|
|
|
- //console.log(url);
|
|
|
+function playVisiableAudioCallBack(type, url) {
|
|
|
+ //console.log(url);
|
|
|
cancelBubble();
|
|
|
plugin.startPlay(type, url);
|
|
|
}
|
|
|
|
|
|
- function onClickAnswerPoint(data) {
|
|
|
- //alert(JSON.stringify(data));
|
|
|
+function onClickAnswerPoint(data) {
|
|
|
+ //alert(JSON.stringify(data));
|
|
|
console.log(JSON.stringify(data));
|
|
|
cancelBubble();
|
|
|
plugin.onClickAnswerPoint(data);
|
|
|
}
|
|
|
|
|
|
- function onClickKeyHide() {
|
|
|
- //alert(JSON.stringify(data));
|
|
|
+function onClickKeyHide() {
|
|
|
+ //alert(JSON.stringify(data));
|
|
|
cancelBubble();
|
|
|
plugin.onClickKeyHide();
|
|
|
}
|
|
|
|
|
|
- function onClickKeyShow() {
|
|
|
- //alert(JSON.stringify(data));
|
|
|
+function onClickKeyShow() {
|
|
|
+ //alert(JSON.stringify(data));
|
|
|
cancelBubble();
|
|
|
plugin.onClickKeyShow();
|
|
|
}
|
|
|
|
|
|
- function cancelBubble(e) {
|
|
|
+function cancelBubble(e) {
|
|
|
var evt = e ? e : window.event;
|
|
|
if (evt.stopPropagation) { //W3C
|
|
|
evt.stopPropagation();
|
|
|
@@ -1660,7 +1659,7 @@ function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function getSelectedText(title) {
|
|
|
+function getSelectedText(title) {
|
|
|
var txt;
|
|
|
if (window.getSelection) {
|
|
|
txt = window.getSelection().toString();
|