|
@@ -20,6 +20,12 @@ var PicInfo1 = {
|
|
|
audioPlayImgUrl: "../Images/dynaiselaba.gif",
|
|
audioPlayImgUrl: "../Images/dynaiselaba.gif",
|
|
|
audioPauseImgUrl: "../Images/dynaiselaba.png"
|
|
audioPauseImgUrl: "../Images/dynaiselaba.png"
|
|
|
}
|
|
}
|
|
|
|
|
+// 高亮
|
|
|
|
|
+var styleWPSContrl = {
|
|
|
|
|
+ wordFlag: true,
|
|
|
|
|
+ phraseFlag: true,
|
|
|
|
|
+ sentenceFlag: true
|
|
|
|
|
+}
|
|
|
// 表格处理Start
|
|
// 表格处理Start
|
|
|
var pressTableFlag = false;
|
|
var pressTableFlag = false;
|
|
|
var GetPadVal = function () {
|
|
var GetPadVal = function () {
|
|
@@ -35,6 +41,49 @@ var GetPadVal = function () {
|
|
|
return parseFloat(PadValArr[0]) * 2;
|
|
return parseFloat(PadValArr[0]) * 2;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+// 获取最大字符长度的字符串(起决定宽度的字符串/将字符去除HTML标签)(使用)
|
|
|
|
|
+var removeHtmlFunc = function (HtmlStr) {
|
|
|
|
|
+ // 清除非长度标签
|
|
|
|
|
+ var pattStr = new RegExp(/<(img){1}.*?>/ig);
|
|
|
|
|
+ var matchesArr = HtmlStr.match(pattStr);
|
|
|
|
|
+ if (matchesArr != null && matchesArr.length > 0) {
|
|
|
|
|
+ for (var i = 0; i < matchesArr.length; i++) {
|
|
|
|
|
+ HtmlStr = HtmlStr.replace(matchesArr[i], "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ pattStr = new RegExp(/(<(p){1}.*?>).*?(<\/\2>)/ig);
|
|
|
|
|
+ matchesArr = HtmlStr.match(pattStr);
|
|
|
|
|
+ // 判断是否存在p标签
|
|
|
|
|
+ if (matchesArr != null || matchesArr.length > 0) {
|
|
|
|
|
+ pattStr = new RegExp(/(<(p|b|span|u){1}.*?>).*?(<\/\2>)/i);
|
|
|
|
|
+ for (var i = 0; i < matchesArr.length; i++) {
|
|
|
|
|
+ var NewHtmlStr = matchesArr[i];
|
|
|
|
|
+ while (pattStr.test(NewHtmlStr)) {
|
|
|
|
|
+ var TmatchesArr = NewHtmlStr.match(pattStr);
|
|
|
|
|
+ if (TmatchesArr.length > 0) {
|
|
|
|
|
+ // 存在P标签
|
|
|
|
|
+ NewHtmlStr = NewHtmlStr.replace(TmatchesArr[1], "").replace(TmatchesArr[3], "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i == 0 || (HtmlStr.length < NewHtmlStr.length)) {
|
|
|
|
|
+ HtmlStr = NewHtmlStr;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ pattStr = new RegExp(/(<(b|span|u){1}.*?>).*?(<\/\2>)/i);
|
|
|
|
|
+ if (pattStr.test(HtmlStr)) {
|
|
|
|
|
+ while (pattStr.test(HtmlStr)) {
|
|
|
|
|
+ var matchesArr = HtmlStr.match(pattStr);
|
|
|
|
|
+ if (matchesArr.length > 0) {
|
|
|
|
|
+ HtmlStr = HtmlStr.replace(matchesArr[1], "").replace(matchesArr[3], "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return HtmlStr;
|
|
|
|
|
+};
|
|
|
|
|
+// 获取最大字符长度的字符串(起决定宽度的字符串/将字符去除HTML标签)(替换,不用)
|
|
|
var dealTdTextFunc = function (HtmlStr) {
|
|
var dealTdTextFunc = function (HtmlStr) {
|
|
|
var ReStr = "";
|
|
var ReStr = "";
|
|
|
var ReNumber = 0;
|
|
var ReNumber = 0;
|
|
@@ -70,21 +119,21 @@ var AdjustTableFunc = function () {
|
|
|
var RuleFlag = true;
|
|
var RuleFlag = true;
|
|
|
$.each($(item).find("tr"), function (trIndex, trItem) {
|
|
$.each($(item).find("tr"), function (trIndex, trItem) {
|
|
|
$.each($(trItem).find("td"), function (tdIndex, tdItem) {
|
|
$.each($(trItem).find("td"), function (tdIndex, tdItem) {
|
|
|
- var tdtext = dealTdTextFunc($(tdItem).html());
|
|
|
|
|
|
|
+ var tdtext = removeHtmlFunc($(tdItem).html());
|
|
|
$("#pContrainId").text(tdtext);
|
|
$("#pContrainId").text(tdtext);
|
|
|
var tdWidthVal = $("#pContrainId").width();
|
|
var tdWidthVal = $("#pContrainId").width();
|
|
|
if (ArrMaxLen.length < tdIndex + 1) {
|
|
if (ArrMaxLen.length < tdIndex + 1) {
|
|
|
if (trIndex != 0) {
|
|
if (trIndex != 0) {
|
|
|
RuleFlag = false;
|
|
RuleFlag = false;
|
|
|
- }
|
|
|
|
|
- ArrMaxLen.push(0);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ ArrMaxLen.push(0);
|
|
|
|
|
+ }
|
|
|
if (ArrMaxLen[tdIndex] < tdWidthVal) {
|
|
if (ArrMaxLen[tdIndex] < tdWidthVal) {
|
|
|
TotalMaxLen += tdWidthVal - ArrMaxLen[tdIndex];
|
|
TotalMaxLen += tdWidthVal - ArrMaxLen[tdIndex];
|
|
|
ArrMaxLen[tdIndex] = tdWidthVal;
|
|
ArrMaxLen[tdIndex] = tdWidthVal;
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
+ });
|
|
|
// 判断表格是否只有一行
|
|
// 判断表格是否只有一行
|
|
|
if ($(item).find("tr").length == 1 && $(item).find("tr").eq(0).find("td").length == 1) {
|
|
if ($(item).find("tr").length == 1 && $(item).find("tr").eq(0).find("td").length == 1) {
|
|
|
$(item).find("tr").eq(0).find("td").eq(0).css("width", (ScreenWidth - 4 - GetPadVal()) + "px");
|
|
$(item).find("tr").eq(0).find("td").eq(0).css("width", (ScreenWidth - 4 - GetPadVal()) + "px");
|
|
@@ -96,8 +145,8 @@ var AdjustTableFunc = function () {
|
|
|
AddPx = AddPx > 2 ? AddPx - 2 : AddPx;
|
|
AddPx = AddPx > 2 ? AddPx - 2 : AddPx;
|
|
|
for (var i = 0; i < ArrMaxLen.length; i++) {
|
|
for (var i = 0; i < ArrMaxLen.length; i++) {
|
|
|
ArrMaxLen[i] += AddPx;
|
|
ArrMaxLen[i] += AddPx;
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
var OneFlag = false;
|
|
var OneFlag = false;
|
|
|
for (var i = 0; i < ArrMaxLen.length; i++) {
|
|
for (var i = 0; i < ArrMaxLen.length; i++) {
|
|
|
if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length > 1 && RuleFlag) {
|
|
if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length > 1 && RuleFlag) {
|
|
@@ -109,21 +158,21 @@ var AdjustTableFunc = function () {
|
|
|
var NotRuleWidth = 0;
|
|
var NotRuleWidth = 0;
|
|
|
if (i == ArrMaxLen.length - 1) {
|
|
if (i == ArrMaxLen.length - 1) {
|
|
|
NotRuleWidth = TableWidth / $(item).find("tr").eq(0).find("td").length;
|
|
NotRuleWidth = TableWidth / $(item).find("tr").eq(0).find("td").length;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
$.each($(item).find("tr").eq(0).find("td"), function (tdIndex, tdItem) {
|
|
$.each($(item).find("tr").eq(0).find("td"), function (tdIndex, tdItem) {
|
|
|
$(tdItem).css("width", NotRuleWidth + "px");
|
|
$(tdItem).css("width", NotRuleWidth + "px");
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
else if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length == 1) {
|
|
else if (ArrMaxLen[i] != undefined && $(item).find("tr").eq(0).find("td").length == 1) {
|
|
|
OneFlag = true;
|
|
OneFlag = true;
|
|
|
TableWidth += ArrMaxLen[i];
|
|
TableWidth += ArrMaxLen[i];
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
if (OneFlag) {
|
|
if (OneFlag) {
|
|
|
$(item).find("tr").eq(0).find("td").eq(0).css("width", TableWidth + "px");
|
|
$(item).find("tr").eq(0).find("td").eq(0).css("width", TableWidth + "px");
|
|
|
- }
|
|
|
|
|
- $(item).css("width", TableWidth + "px");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ $(item).css("width", TableWidth + "px");
|
|
|
|
|
+ }
|
|
|
// 替换HTML
|
|
// 替换HTML
|
|
|
var ChildHtmlStr = $(item).prop("outerHTML");
|
|
var ChildHtmlStr = $(item).prop("outerHTML");
|
|
|
var HtmlStr = "<div class='TableContainer TContain_" + Index + "'></div>";
|
|
var HtmlStr = "<div class='TableContainer TContain_" + Index + "'></div>";
|
|
@@ -132,7 +181,7 @@ var AdjustTableFunc = function () {
|
|
|
var JqStr = ".TContain_" + Index;
|
|
var JqStr = ".TContain_" + Index;
|
|
|
$(JqStr).append(ChildHtmlStr);
|
|
$(JqStr).append(ChildHtmlStr);
|
|
|
Index += 1;
|
|
Index += 1;
|
|
|
- });
|
|
|
|
|
|
|
+});
|
|
|
$(document.body).css("width", ScreenWidth + "px");
|
|
$(document.body).css("width", ScreenWidth + "px");
|
|
|
var BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width()) - GetPadVal()); // 界面宽度
|
|
var BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width()) - GetPadVal()); // 界面宽度
|
|
|
var Index = 0;
|
|
var Index = 0;
|
|
@@ -149,12 +198,12 @@ var AdjustTableFunc = function () {
|
|
|
var HiddenWidth = BodyWidth - (TableWidth - BodyWidth) * HiddenRate; // 现滚动条大小
|
|
var HiddenWidth = BodyWidth - (TableWidth - BodyWidth) * HiddenRate; // 现滚动条大小
|
|
|
var CSHtmlStr = "<div class='CSBar' style='width: " + HiddenWidth + "px;'></div>";
|
|
var CSHtmlStr = "<div class='CSBar' style='width: " + HiddenWidth + "px;'></div>";
|
|
|
$(JqStr).next().append(CSHtmlStr);
|
|
$(JqStr).next().append(CSHtmlStr);
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
Index += 1;
|
|
Index += 1;
|
|
|
- });
|
|
|
|
|
|
|
+});
|
|
|
$.each($(".container-table"), function (index, item) {
|
|
$.each($(".container-table"), function (index, item) {
|
|
|
$(item).css("width", BodyWidth + "px");
|
|
$(item).css("width", BodyWidth + "px");
|
|
|
- });
|
|
|
|
|
|
|
+});
|
|
|
// 滚动条事件
|
|
// 滚动条事件
|
|
|
$(".TableContainer").on("touchstart", function () {
|
|
$(".TableContainer").on("touchstart", function () {
|
|
|
pressTableFlag = true;
|
|
pressTableFlag = true;
|
|
@@ -167,13 +216,13 @@ var AdjustTableFunc = function () {
|
|
|
var NextClsName = $(this).next().attr("class");
|
|
var NextClsName = $(this).next().attr("class");
|
|
|
if (NextClsName == "PSBar") {
|
|
if (NextClsName == "PSBar") {
|
|
|
$(this).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
$(this).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
window.addEventListener("scroll", function (event) {
|
|
window.addEventListener("scroll", function (event) {
|
|
|
var ClsName = event.target.className;
|
|
var ClsName = event.target.className;
|
|
|
if (ClsName == undefined) {
|
|
if (ClsName == undefined) {
|
|
|
return;
|
|
return;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
ClsName = ClsName.replace("TableContainer ", ".");
|
|
ClsName = ClsName.replace("TableContainer ", ".");
|
|
|
var TableWidth = isNaN(parseFloat($(ClsName).find("table").width())) ? 0 : parseFloat($(ClsName).find("table").width()); // 表格宽度
|
|
var TableWidth = isNaN(parseFloat($(ClsName).find("table").width())) ? 0 : parseFloat($(ClsName).find("table").width()); // 表格宽度
|
|
|
BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width() - GetPadVal())); // 界面宽度
|
|
BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width() - GetPadVal())); // 界面宽度
|
|
@@ -183,12 +232,55 @@ var AdjustTableFunc = function () {
|
|
|
var NextClsName = $(ClsName).next().attr("class");
|
|
var NextClsName = $(ClsName).next().attr("class");
|
|
|
if (NextClsName == "PSBar") {
|
|
if (NextClsName == "PSBar") {
|
|
|
$(ClsName).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
$(ClsName).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}, true);
|
|
}, true);
|
|
|
$("#pContrainId").remove();
|
|
$("#pContrainId").remove();
|
|
|
};
|
|
};
|
|
|
// 表格处理End
|
|
// 表格处理End
|
|
|
|
|
|
|
|
|
|
+// 判断是否在横线内
|
|
|
|
|
+var isGCFunc = function (NodeHandle) {
|
|
|
|
|
+ var isFlag = false;
|
|
|
|
|
+ var PClsName = $(NodeHandle).attr("class");
|
|
|
|
|
+ var tagName = $(NodeHandle).prop("tagName");
|
|
|
|
|
+ while (tagName != undefined && tagName != "BODY" && ((PClsName != undefined && PClsName.indexOf("underlineContent") == -1) || PClsName == undefined)) {
|
|
|
|
|
+ NodeHandle = $(NodeHandle).parent();
|
|
|
|
|
+ PClsName = $(NodeHandle).attr("class");
|
|
|
|
|
+ tagName = $(NodeHandle).prop("tagName");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (PClsName != undefined && PClsName.indexOf("underlineContent") > -1) {
|
|
|
|
|
+ isFlag = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return isFlag;
|
|
|
|
|
+};
|
|
|
|
|
+// 处理高亮
|
|
|
|
|
+var dealGLShowFunc = function (NodeHandle) {
|
|
|
|
|
+ if (styleWPSContrl.wordFlag) {
|
|
|
|
|
+ $(NodeHandle).find(".wordStyle").css("color", "#db5d00");
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $.each($(NodeHandle).find(".wordStyle"), function (index, element) {
|
|
|
|
|
+ if (isGCFunc(element)) {
|
|
|
|
|
+ $(element).css("color", "#92D050");
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $(element).css("color", "#000000");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (styleWPSContrl.phraseFlag) {
|
|
|
|
|
+ $(NodeHandle).find(".phraseStyle").css("background-color", "#f2db8b");
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $(NodeHandle).find(".phraseStyle").css("background-color", "#fff");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (styleWPSContrl.sentenceFlag) {
|
|
|
|
|
+ $(NodeHandle).find(".sentenceStyle").css("border-bottom", "2px solid #78ae43");
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $(NodeHandle).find(".sentenceStyle").css("border-bottom", "2px solid #fff");
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
// 处理显示或隐藏答案
|
|
// 处理显示或隐藏答案
|
|
|
var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
var FontSizeValue = $(NodeHandle).css("font-size");
|
|
var FontSizeValue = $(NodeHandle).css("font-size");
|
|
@@ -205,6 +297,8 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
}
|
|
}
|
|
|
if (OCFlag) {
|
|
if (OCFlag) {
|
|
|
$(NodeHandle).css("display", "inline-block").after(addHtml);
|
|
$(NodeHandle).css("display", "inline-block").after(addHtml);
|
|
|
|
|
+ // 处理高亮
|
|
|
|
|
+ dealGLShowFunc(NodeHandle);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
$(NodeHandle).css("display", "none").after(addHtml);
|
|
$(NodeHandle).css("display", "none").after(addHtml);
|
|
@@ -214,6 +308,8 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
else {
|
|
else {
|
|
|
if (OCFlag) {
|
|
if (OCFlag) {
|
|
|
$(NodeHandle).css("display", "inline-block").next().attr("data-status", "0");
|
|
$(NodeHandle).css("display", "inline-block").next().attr("data-status", "0");
|
|
|
|
|
+ // 处理高亮
|
|
|
|
|
+ dealGLShowFunc(NodeHandle);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
$(NodeHandle).css("display", "none").next().attr("data-status", "1");
|
|
$(NodeHandle).css("display", "none").next().attr("data-status", "1");
|
|
@@ -232,14 +328,12 @@ var dealAnswerFunc = function (NodeHandle, OCFlag) {
|
|
|
//显示、隐藏答案
|
|
//显示、隐藏答案
|
|
|
function showHideAnswer(flag) {
|
|
function showHideAnswer(flag) {
|
|
|
if (flag) {
|
|
if (flag) {
|
|
|
- $(".underlineContent").css("color", "#92D050");
|
|
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
dealAnswerFunc(item, true);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- $(".underlineContent").css("color", "#ffffff");
|
|
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
dealAnswerFunc(item, false);
|
|
@@ -258,15 +352,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
if (isShowAS) {
|
|
if (isShowAS) {
|
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
$.each($(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
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");
|
|
|
|
|
});
|
|
});
|
|
|
$(".yaoshi").attr("data-status", "1");
|
|
$(".yaoshi").attr("data-status", "1");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiShowImgUrl);
|
|
@@ -274,9 +359,6 @@ function showHideAnswerEx(isShowYX, isShowAS) {
|
|
|
else {
|
|
else {
|
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
$.each($(".underlineContent,.underlineContent.no-answer"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
|
|
});
|
|
});
|
|
|
$(".yaoshi").attr("data-status", "0");
|
|
$(".yaoshi").attr("data-status", "0");
|
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
$(".yaoshi").attr("src", PicInfo.yaoshiHideImgUrl);
|
|
@@ -362,7 +444,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(".audioImg").on("click", function () {
|
|
$(".audioImg").on("click", function () {
|
|
|
audioPlayClick(this);
|
|
audioPlayClick(this);
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
//显示/隐藏习题答案
|
|
//显示/隐藏习题答案
|
|
|
$(".yaoshi").on("click", function () {
|
|
$(".yaoshi").on("click", function () {
|
|
|
var parentAnid = $(this).attr("parent-anid");
|
|
var parentAnid = $(this).attr("parent-anid");
|
|
@@ -375,14 +456,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
$(item).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, true);
|
|
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");
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -391,14 +464,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
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");
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
@@ -415,9 +480,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(item).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
$(item).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
$.each($(item).parent().find(".underlineContent"), function (cIndex, cItem) {
|
|
|
dealAnswerFunc(cItem, false);
|
|
dealAnswerFunc(cItem, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -426,9 +488,6 @@ function bindEventTeaOrignalYS() {
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
$.each($(this).nextUntil(".yaoshi").find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
//添加回调
|
|
//添加回调
|
|
@@ -487,10 +546,10 @@ function bindEventYS() {
|
|
|
//改错题,要随机下划线长度
|
|
//改错题,要随机下划线长度
|
|
|
if ($(parent).hasClass('correntQue')) {
|
|
if ($(parent).hasClass('correntQue')) {
|
|
|
uHtml.style = "width:" + randomNum(220, 300) + "px;";
|
|
uHtml.style = "width:" + randomNum(220, 300) + "px;";
|
|
|
- }
|
|
|
|
|
- uHtml.setAttribute("answer-anstext", "");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ uHtml.setAttribute("answer-anstext", "");
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
$(item).after(uHtml);
|
|
$(item).after(uHtml);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -524,14 +583,6 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
$(fItem).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
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");
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -541,14 +592,6 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, true);
|
|
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");
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
//不再存在已隐藏的钥匙,移动端回调
|
|
@@ -565,11 +608,8 @@ function bindEventYS() {
|
|
|
$(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
$(fItem).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
$.each($(fItem).parent().find(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
|
|
- });
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
$(this).attr("data-status", "0");
|
|
$(this).attr("data-status", "0");
|
|
@@ -577,14 +617,11 @@ function bindEventYS() {
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
$.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
|
dealAnswerFunc(item, false);
|
|
dealAnswerFunc(item, false);
|
|
|
- $(item).css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".wordStyle").css("color", "#ffffff");
|
|
|
|
|
- $(item).find(".phraseStyle").css("background-color", "#ffffff");
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
//添加回调
|
|
//添加回调
|
|
|
onClickKeyHide();
|
|
onClickKeyHide();
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
//点击喇叭事件,音频播放
|
|
//点击喇叭事件,音频播放
|
|
|
$(".audioImg").on("click", function () {
|
|
$(".audioImg").on("click", function () {
|
|
@@ -598,6 +635,7 @@ function bindEventYS() {
|
|
|
playVisiableAudioCallBack(2, $(this).attr("alt"));
|
|
playVisiableAudioCallBack(2, $(this).attr("alt"));
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
// 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
|
function getPressFlag() {
|
|
function getPressFlag() {
|
|
|
return pressTableFlag;
|
|
return pressTableFlag;
|
|
@@ -637,7 +675,7 @@ function handleAnswerRange() {
|
|
|
$(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('.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('input').prop('checked', ischecked);
|
|
|
$(item).find('.underlineContent').hide();
|
|
$(item).find('.underlineContent').hide();
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
//点击事件
|
|
//点击事件
|
|
|
$(item).find('input').bind("click", function () {
|
|
$(item).find('input').bind("click", function () {
|
|
|
var curObj = new Object();
|
|
var curObj = new Object();
|
|
@@ -664,31 +702,31 @@ function handleAnswerRange() {
|
|
|
else {
|
|
else {
|
|
|
//移动端添加外部处理,弹出作答操作
|
|
//移动端添加外部处理,弹出作答操作
|
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
//删除钥匙节点
|
|
//删除钥匙节点
|
|
|
$(item).find('.yaoshi').hide();
|
|
$(item).find('.yaoshi').hide();
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//所有underline不做处理
|
|
//所有underline不做处理
|
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
|
|
|
- tempId = $(item).prevAll(".yaoshi").attr("answer-id");
|
|
|
|
|
- //记录上一次的ID
|
|
|
|
|
- if (tempId == undefined) {
|
|
|
|
|
- tempId = answerId;
|
|
|
|
|
- }
|
|
|
|
|
- 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();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ tempId = $(item).prevAll(".yaoshi").attr("answer-id");
|
|
|
|
|
+ //记录上一次的ID
|
|
|
|
|
+ if (tempId == undefined) {
|
|
|
|
|
+ tempId = answerId;
|
|
|
|
|
+ }
|
|
|
|
|
+ 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 = "";
|
|
answerId = "";
|
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
|
|
@@ -705,7 +743,6 @@ function handleAnswerRange() {
|
|
|
if (info.pId == undefined) {
|
|
if (info.pId == undefined) {
|
|
|
info.pId = answerId;
|
|
info.pId = answerId;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
info.AnsText = $(item).attr("answer-anstext");
|
|
info.AnsText = $(item).attr("answer-anstext");
|
|
|
if (info.AnsText == undefined) {
|
|
if (info.AnsText == undefined) {
|
|
|
info.AnsText = $(item).text();
|
|
info.AnsText = $(item).text();
|
|
@@ -722,7 +759,6 @@ function handleAnswerRange() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
|
var Id = $(item).attr("answer-id");
|
|
var Id = $(item).attr("answer-id");
|
|
|
var prev = $(item).next();
|
|
var prev = $(item).next();
|
|
@@ -894,7 +930,7 @@ function reviewAnswer(answerJson) {
|
|
|
answerObj.Text = "(" + answerObj.Text + ")";
|
|
answerObj.Text = "(" + answerObj.Text + ")";
|
|
|
$(selectElement).children(".answer-text").show();
|
|
$(selectElement).children(".answer-text").show();
|
|
|
$(selectElement).children(".answer-text").text(answerObj.Text);
|
|
$(selectElement).children(".answer-text").text(answerObj.Text);
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//是否之前存在作答音频
|
|
//是否之前存在作答音频
|
|
|
$(selectElement).attr("answer-url", answerObj.AudioUrl);
|
|
$(selectElement).attr("answer-url", answerObj.AudioUrl);
|
|
@@ -903,12 +939,12 @@ function reviewAnswer(answerJson) {
|
|
|
//独立绑定事件
|
|
//独立绑定事件
|
|
|
$(audioElement).on("click", function () {
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerObj.Id, answerObj.AudioUrl);
|
|
recordAudioClick(this, answerObj.Id, answerObj.AudioUrl);
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
$(selectElement).children(".answer-audio-range").children("span").on("click", function () {
|
|
$(selectElement).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
$(selectElement).addClass("select-answer");
|
|
$(selectElement).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerObj));
|
|
onClickAnswerPoint(JSON.stringify(answerObj));
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
$(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
|
|
$(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
|
|
@@ -921,9 +957,9 @@ function reviewAnswer(answerJson) {
|
|
|
else {
|
|
else {
|
|
|
$(selectElement).children(".answer-text").hide();
|
|
$(selectElement).children(".answer-text").hide();
|
|
|
$(selectElement).children(".answer-point-range").show();
|
|
$(selectElement).children(".answer-point-range").show();
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//提交,获取所有作答答案及参考答案
|
|
//提交,获取所有作答答案及参考答案
|
|
@@ -961,7 +997,6 @@ function getAllAnswer() {
|
|
|
$(".answer-body").removeClass("select-answer");//移除样式
|
|
$(".answer-body").removeClass("select-answer");//移除样式
|
|
|
$(".answer-body").unbind("click");//取消点击绑定事件
|
|
$(".answer-body").unbind("click");//取消点击绑定事件
|
|
|
$(".answer-body").children(".answer-audio-range").children("span").unbind("click");//取消点击绑定事件
|
|
$(".answer-body").children(".answer-audio-range").children("span").unbind("click");//取消点击绑定事件
|
|
|
-
|
|
|
|
|
//打勾题的还原
|
|
//打勾题的还原
|
|
|
$.each($(".checkbox"), function (num, item) {
|
|
$.each($(".checkbox"), function (num, item) {
|
|
|
var answerid = $(item).attr("answer-id");
|
|
var answerid = $(item).attr("answer-id");
|
|
@@ -970,13 +1005,10 @@ function getAllAnswer() {
|
|
|
var mytext = $(item).attr("answer-text");//我的答案
|
|
var mytext = $(item).attr("answer-text");//我的答案
|
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
|
var answerText = $(item).attr("answer-anstext");//参考答案
|
|
var answerText = $(item).attr("answer-anstext");//参考答案
|
|
|
-
|
|
|
|
|
mytext = mytext == "" ? "__" : mytext;
|
|
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>");
|
|
$(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;
|
|
return answerData;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1008,7 +1040,6 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
//提交直接还原作答现场
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
-
|
|
|
|
|
//添加音频控制
|
|
//添加音频控制
|
|
|
var hasAudio = false;
|
|
var hasAudio = false;
|
|
|
var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
@@ -1042,7 +1073,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
$(item).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
@@ -1070,7 +1101,6 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$(item).children(".answer-text").show();
|
|
$(item).children(".answer-text").show();
|
|
|
}
|
|
}
|
|
|
else if (mytext == "" && hasAudio) {
|
|
else if (mytext == "" && hasAudio) {
|
|
@@ -1155,7 +1185,6 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
var ischecked = mytext.indexOf("√") > -1;
|
|
|
var answerText = $(item).attr("answer-anstext");//参考答案
|
|
var answerText = $(item).attr("answer-anstext");//参考答案
|
|
|
-
|
|
|
|
|
$(item).attr("answer-text", mytext);
|
|
$(item).attr("answer-text", mytext);
|
|
|
$(item).find('input').prop('checked', ischecked);
|
|
$(item).find('input').prop('checked', ischecked);
|
|
|
//已提交,已评阅,还原HTML代码,去除checkbox
|
|
//已提交,已评阅,还原HTML代码,去除checkbox
|
|
@@ -1176,7 +1205,6 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
curObj.AnsText = $(this).attr("answer-anstext");//参考答案
|
|
curObj.AnsText = $(this).attr("answer-anstext");//参考答案
|
|
|
curObj.Comment = $(this).attr("answer-comment");//评语
|
|
curObj.Comment = $(this).attr("answer-comment");//评语
|
|
|
curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
-
|
|
|
|
|
$(".checkbox").removeClass("select-answer");
|
|
$(".checkbox").removeClass("select-answer");
|
|
|
$(".answer-body").removeClass("select-answer");
|
|
$(".answer-body").removeClass("select-answer");
|
|
|
if (statusType == 2) {
|
|
if (statusType == 2) {
|
|
@@ -1185,7 +1213,6 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
else {
|
|
|
$(this).addClass("select-answer");
|
|
$(this).addClass("select-answer");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
//已作答,弹出作答答案
|
|
//已作答,弹出作答答案
|
|
|
if ($(this).data("ans-status") == "1") {
|
|
if ($(this).data("ans-status") == "1") {
|
|
|
//移动端添加外部处理
|
|
//移动端添加外部处理
|
|
@@ -1203,8 +1230,8 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
//老师评阅学生作答
|
|
//老师评阅学生作答
|
|
|
function reviewStuAnswer(answerJson) {
|
|
function reviewStuAnswer(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
if (answerJson != "" && answerJson) {
|
|
|
- var answerObj = JSON.parse(answerJson);
|
|
|
|
|
- var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
|
|
|
|
|
|
|
+ var answerObj = JSON.parse(answerJson);
|
|
|
|
|
+ var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
|
|
|
|
|
|
|
|
//$(selectElement).attr("answer-text", answerObj.Text);//用户作答内容
|
|
//$(selectElement).attr("answer-text", answerObj.Text);//用户作答内容
|
|
|
$(selectElement).attr("answer-score", answerObj.Score);//作答评分
|
|
$(selectElement).attr("answer-score", answerObj.Score);//作答评分
|
|
@@ -1356,21 +1383,21 @@ function backupAllReview(answerJson) {
|
|
|
curObj.Comment = $(this).attr("answer-comment");//评语
|
|
curObj.Comment = $(this).attr("answer-comment");//评语
|
|
|
curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
curObj.pId = curObj.pId ? curObj.pId : curObj.Id;//组ID
|
|
|
|
|
|
|
|
- $(".checkbox").removeClass("select-answer");
|
|
|
|
|
- $(".answer-body").removeClass("select-answer");
|
|
|
|
|
- //$(this).addClass("select-answer");
|
|
|
|
|
- $(".answer-body[parent-anid=" + curObj.pId + "]").addClass("select-answer");
|
|
|
|
|
- //已作答,弹出作答答案
|
|
|
|
|
- if ($(this).data("ans-status") == "1") {
|
|
|
|
|
- //移动端添加外部处理
|
|
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- //移动端添加外部处理,弹出作答操作
|
|
|
|
|
- onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ $(".checkbox").removeClass("select-answer");
|
|
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
|
|
+ //$(this).addClass("select-answer");
|
|
|
|
|
+ $(".answer-body[parent-anid=" + curObj.pId + "]").addClass("select-answer");
|
|
|
|
|
+ //已作答,弹出作答答案
|
|
|
|
|
+ if ($(this).data("ans-status") == "1") {
|
|
|
|
|
+ //移动端添加外部处理
|
|
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ //移动端添加外部处理,弹出作答操作
|
|
|
|
|
+ onClickAnswerPoint(JSON.stringify(curObj));
|
|
|
}
|
|
}
|
|
|
|
|
+});
|
|
|
|
|
+}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
|
|
//处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
|
|
@@ -1385,7 +1412,7 @@ function playRecordAudio(answerid, isPlay) {
|
|
|
else {
|
|
else {
|
|
|
$(playing).attr("play-status", "0");
|
|
$(playing).attr("play-status", "0");
|
|
|
$(playing).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
$(playing).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//滚动到相应DIV
|
|
//滚动到相应DIV
|
|
@@ -1403,9 +1430,8 @@ function scrollAnswer(answerid) {
|
|
|
if (offset_top > 150) {
|
|
if (offset_top > 150) {
|
|
|
offset_top = offset_top - 200;
|
|
offset_top = offset_top - 200;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$("body,html").animate({
|
|
$("body,html").animate({
|
|
|
- scrollTop: offset_top //让body的scrollTop等于pos的top,就实现了滚动
|
|
|
|
|
|
|
+ scrollTop: offset_top //让body的scrollTop等于pos的top,就实现了滚动
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1461,13 +1487,13 @@ function recordAudioClick(myobj, id, url) {
|
|
|
if (isRecordPlaying.length > 0) {
|
|
if (isRecordPlaying.length > 0) {
|
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
//停止其他原文音频播放
|
|
//停止其他原文音频播放
|
|
|
var audioPlaying = $(".audioImg[play-status='1']");
|
|
var audioPlaying = $(".audioImg[play-status='1']");
|
|
|
if (audioPlaying.length > 0) {
|
|
if (audioPlaying.length > 0) {
|
|
|
$(audioPlaying).attr("play-status", "0");
|
|
$(audioPlaying).attr("play-status", "0");
|
|
|
$(audioPlaying).attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
$(audioPlaying).attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
//设置播放状态
|
|
//设置播放状态
|
|
|
$(myobj).parent().attr("play-status", "1");
|
|
$(myobj).parent().attr("play-status", "1");
|
|
|
$(myobj).attr("src", PicInfo.recordPauseImgUrl);//移动端要根据本地路径替换
|
|
$(myobj).attr("src", PicInfo.recordPauseImgUrl);//移动端要根据本地路径替换
|
|
@@ -1499,6 +1525,14 @@ function randomNum(minNum, maxNum) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 传递显示单词wordFlag/句子phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
|
|
|
|
|
+function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
|
|
|
|
|
+ styleWPSContrl.wordFlag = wordFlag;
|
|
|
|
|
+ styleWPSContrl.phraseFlag = phraseFlag;
|
|
|
|
|
+ styleWPSContrl.sentenceFlag = sentenceFlag;
|
|
|
|
|
+ dealGLShowFunc(document);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function playVisiableAudioCallBack(type, url) {
|
|
function playVisiableAudioCallBack(type, url) {
|
|
|
//console.log(url);
|
|
//console.log(url);
|
|
|
cancelBubble();
|
|
cancelBubble();
|
|
@@ -1523,6 +1557,7 @@ function onClickKeyShow() {
|
|
|
cancelBubble();
|
|
cancelBubble();
|
|
|
plugin.onClickKeyShow();
|
|
plugin.onClickKeyShow();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function cancelBubble(e) {
|
|
function cancelBubble(e) {
|
|
|
var evt = e ? e : window.event;
|
|
var evt = e ? e : window.event;
|
|
|
if (evt.stopPropagation) { //W3C
|
|
if (evt.stopPropagation) { //W3C
|