|
|
@@ -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",
|
|
|
@@ -20,6 +20,89 @@ var PicInfo1 = {
|
|
|
audioPlayImgUrl: "../Images/dynaiselaba.gif",
|
|
|
audioPauseImgUrl: "../Images/dynaiselaba.png"
|
|
|
}
|
|
|
+// 表格处理Start
|
|
|
+var pressTableFlag = false;
|
|
|
+var GetPadVal = function () {
|
|
|
+ var PaddingVal = $(document.body).css("padding");
|
|
|
+ if (PaddingVal == null || PaddingVal == undefined || PaddingVal == "" || PaddingVal == "0px") {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ var PadValArr = PaddingVal.split(" ");
|
|
|
+ if (PadValArr.length > 2) {
|
|
|
+ return parseFloat(PadValArr[1]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return parseFloat(PadValArr[1]);
|
|
|
+ }
|
|
|
+};
|
|
|
+var AdjustTableFunc = function () {
|
|
|
+ var Index = 0;
|
|
|
+ $.each($("table"), function (index, item) {
|
|
|
+ var TableWidth = isNaN(parseFloat($(item).width())) ? 0 : parseFloat($(item).width()); // 表格宽度
|
|
|
+ // 替换HTML
|
|
|
+ var ChildHtmlStr = $(item).prop("outerHTML")
|
|
|
+ var HtmlStr = "<div class='TableContainer TContain_" + Index + "'></div>";
|
|
|
+ $(item).after(HtmlStr);
|
|
|
+ $(item).remove();
|
|
|
+ var JqStr = ".TContain_" + Index;
|
|
|
+ $(JqStr).append(ChildHtmlStr);
|
|
|
+ Index += 1;
|
|
|
+ });
|
|
|
+ var BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width()) - GetPadVal()); // 界面宽度
|
|
|
+ var Index = 0;
|
|
|
+ $.each($("table"), function (index, item) {
|
|
|
+ var TableWidth = isNaN(parseFloat($(item).width())) ? 0 : parseFloat($(item).width()); // 表格宽度
|
|
|
+ // 替换HTML
|
|
|
+ var JqStr = ".TContain_" + Index;
|
|
|
+ $(JqStr).css("width", BodyWidth + "px");
|
|
|
+ if (TableWidth > BodyWidth) {
|
|
|
+ // 额外显示滚动条
|
|
|
+ var SHtmlStr = "<div class='PSBar' style='width: " + BodyWidth + "px;'></div>";
|
|
|
+ $(JqStr).after(SHtmlStr);
|
|
|
+ var HiddenRate = BodyWidth / TableWidth; // 滚动条比率
|
|
|
+ var HiddenWidth = BodyWidth - (TableWidth - BodyWidth) * HiddenRate; // 现滚动条大小
|
|
|
+ var CSHtmlStr = "<div class='CSBar' style='width: " + HiddenWidth + "px;'></div>";
|
|
|
+ $(JqStr).next().append(CSHtmlStr);
|
|
|
+ }
|
|
|
+ Index += 1;
|
|
|
+ });
|
|
|
+
|
|
|
+ $.each($(".container-table"), function (index, item) {
|
|
|
+ $(item).css("width", BodyWidth + "px");
|
|
|
+ });
|
|
|
+ // 滚动条事件
|
|
|
+ $(".TableContainer").on("touchstart", function () {
|
|
|
+ pressTableFlag = true;
|
|
|
+ }).on("touchmove", function () {
|
|
|
+ var TableWidth = isNaN(parseFloat($(this).find("table").width())) ? 0 : parseFloat($(this).find("table").width()); // 表格宽度
|
|
|
+ BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width() - GetPadVal())); // 界面宽度
|
|
|
+ var HiddenRate = BodyWidth / TableWidth; // 滚动条比率
|
|
|
+ var SLeftWdith = isNaN(parseFloat($(this)[0].scrollLeft)) ? 0 : parseFloat($(this)[0].scrollLeft);
|
|
|
+ SLeftWdith *= HiddenRate;
|
|
|
+ var NextClsName = $(this).next().attr("class");
|
|
|
+ if (NextClsName == "PSBar") {
|
|
|
+ $(this).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.addEventListener("scroll", function (event) {
|
|
|
+ var ClsName = event.target.className;
|
|
|
+ if (ClsName == undefined) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ClsName = ClsName.replace("TableContainer ", ".");
|
|
|
+ var TableWidth = isNaN(parseFloat($(ClsName).find("table").width())) ? 0 : parseFloat($(ClsName).find("table").width()); // 表格宽度
|
|
|
+ BodyWidth = isNaN(parseFloat($(document).width())) ? 0 : (parseFloat($(document).width() - GetPadVal())); // 界面宽度
|
|
|
+ var HiddenRate = BodyWidth / TableWidth; // 滚动条比率
|
|
|
+ var SLeftWdith = isNaN(parseFloat($(ClsName)[0].scrollLeft)) ? 0 : parseFloat($(ClsName)[0].scrollLeft);
|
|
|
+ SLeftWdith *= HiddenRate;
|
|
|
+ var NextClsName = $(ClsName).next().attr("class");
|
|
|
+ if (NextClsName == "PSBar") {
|
|
|
+ $(ClsName).next().find(".CSBar").css("left", SLeftWdith + "px");
|
|
|
+ }
|
|
|
+ }, true);
|
|
|
+};
|
|
|
+// 表格处理End
|
|
|
+
|
|
|
|
|
|
//显示、隐藏答案
|
|
|
function showHideAnswer(flag) {
|
|
|
@@ -205,9 +288,10 @@ function bindEventTeaOrignalYS() {
|
|
|
}
|
|
|
});
|
|
|
//处理表格宽度
|
|
|
- $.each($(".container-table"), function (index, item) {
|
|
|
- $(item).css("width", bodyWidth + "px");
|
|
|
- });
|
|
|
+ AdjustTableFunc();
|
|
|
+ //$.each($(".container-table"), function (index, item) {
|
|
|
+ // $(item).css("width", bodyWidth + "px");
|
|
|
+ //});
|
|
|
//一题多空的答题点标注
|
|
|
var checkId = 0;
|
|
|
var headid = -1;
|
|
|
@@ -383,32 +467,32 @@ function bindEventTeaOrignalYS() {
|
|
|
});
|
|
|
$("td").attr("style", "");
|
|
|
//处理表格样式
|
|
|
- $(".container-table").each(function (index, item) {
|
|
|
- var TableWidth = isNaN(parseFloat($(item).find("table").css("width"))) ? 0 : parseFloat($(item).find("table").css("width"));
|
|
|
- var ScrollLeft = isNaN(parseFloat($(item).scrollLeft())) ? 0 : parseFloat($(item).scrollLeft());
|
|
|
- var HWidth = parseFloat(TableWidth) - parseFloat(bodyWidth);
|
|
|
- var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
- var SSWidth = bodyWidth - HWidth * HRate; // 显示滚动条宽度
|
|
|
- if (TableWidth > bodyWidth) {
|
|
|
- var HtmlStr = "<div class='ShowSBar' style='width:" + bodyWidth + "px;height:5px;background-color:#eee;position:relative;left:0px;bottom:3px;z-index:2;border-radius:2px;'><div class='ShowSBarC' style='width:" + SSWidth + "px;height:5px;background-color:#ccc;position:absolute;left:" + ScrollLeft + "px;bottom:0px;z-index:3;border-radius:2px;'></div></div>";
|
|
|
- $(item).after(HtmlStr);
|
|
|
- }
|
|
|
- });
|
|
|
- $(".container-table").on("touchstart", function () {
|
|
|
- var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
- if (TableWidth > bodyWidth) {
|
|
|
- pressTableFlag = true;
|
|
|
- }
|
|
|
- }).on("touchmove", function () {
|
|
|
- var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
- var ScrollLeft = isNaN(parseFloat($(this).scrollLeft())) ? 0 : parseFloat($(this).scrollLeft());
|
|
|
- var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
- var ShowSBarName = $(this).next().attr("class");
|
|
|
- if (ScrollLeft >= 0 && ShowSBarName == "ShowSBar" && $(this).next().find(".ShowSBarC").length > 0) {
|
|
|
- // 有滚动条的进行移动
|
|
|
- $(this).next().find(".ShowSBarC").css("left", (ScrollLeft * HRate) + "px");
|
|
|
- }
|
|
|
- });
|
|
|
+ //$(".container-table").each(function (index, item) {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(item).find("table").css("width"))) ? 0 : parseFloat($(item).find("table").css("width"));
|
|
|
+ // var ScrollLeft = isNaN(parseFloat($(item).scrollLeft())) ? 0 : parseFloat($(item).scrollLeft());
|
|
|
+ // var HWidth = parseFloat(TableWidth) -parseFloat(bodyWidth);
|
|
|
+ // var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
+ // var SSWidth = bodyWidth - HWidth * HRate; // 显示滚动条宽度
|
|
|
+ // if (TableWidth > bodyWidth) {
|
|
|
+ // var HtmlStr = "<div class='ShowSBar' style='width:" + bodyWidth + "px;height:5px;background-color:#eee;position:relative;left:0px;bottom:3px;z-index:2;border-radius:2px;'><div class='ShowSBarC' style='width:" +SSWidth + "px;height:5px;background-color:#ccc;position:absolute;left:" +ScrollLeft + "px;bottom:0px;z-index:3;border-radius:2px;'></div></div>";
|
|
|
+ // $(item).after(HtmlStr);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ //$(".container-table").on("touchstart", function () {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0: parseFloat($(this).find("table").css("width"));
|
|
|
+ // if (TableWidth > bodyWidth) {
|
|
|
+ // pressTableFlag = true;
|
|
|
+ // }
|
|
|
+ // }).on("touchmove", function () {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0: parseFloat($(this).find("table").css("width"));
|
|
|
+ // var ScrollLeft = isNaN(parseFloat($(this).scrollLeft())) ? 0: parseFloat($(this).scrollLeft());
|
|
|
+ // var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
+ // var ShowSBarName = $(this).next().attr("class");
|
|
|
+ // if (ScrollLeft >= 0 && ShowSBarName == "ShowSBar" && $(this).next().find(".ShowSBarC").length > 0) {
|
|
|
+ // // 有滚动条的进行移动
|
|
|
+ // $(this).next().find(".ShowSBarC").css("left", (ScrollLeft * HRate) + "px");
|
|
|
+ // }
|
|
|
+ //});
|
|
|
}
|
|
|
|
|
|
//页面加载完,课件 绑定事件
|
|
|
@@ -458,9 +542,10 @@ function bindEventYS() {
|
|
|
}
|
|
|
});
|
|
|
//处理表格宽度
|
|
|
- $.each($(".container-table"), function (index, item) {
|
|
|
- $(item).css("width", bodyWidth + "px");
|
|
|
- });
|
|
|
+ AdjustTableFunc();
|
|
|
+ //$.each($(".container-table"), function (index, item) {
|
|
|
+ // $(item).css("width", bodyWidth + "px");
|
|
|
+ //});
|
|
|
//一题多空的答题点标注
|
|
|
var checkId = 0;
|
|
|
var headid = -1;
|
|
|
@@ -480,6 +565,7 @@ function bindEventYS() {
|
|
|
|
|
|
//显示/隐藏习题答案
|
|
|
$(".yaoshi").on("click", function () {
|
|
|
+ console.log("11");
|
|
|
var parentAnid = $(this).attr("parent-anid");
|
|
|
if ($(this).attr("data-status") == "0") {
|
|
|
// 显示处理
|
|
|
@@ -518,7 +604,7 @@ function bindEventYS() {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- else {
|
|
|
+ else{
|
|
|
$(this).attr("data-status", "1");
|
|
|
$(this).attr("src", PicInfo.yaoshiShowImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
|
|
|
@@ -591,7 +677,7 @@ function bindEventYS() {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- else {
|
|
|
+ else {
|
|
|
$(this).attr("data-status", "0");
|
|
|
$(this).attr("src", PicInfo.yaoshiHideImgUrl);
|
|
|
//$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
|
|
|
@@ -638,60 +724,61 @@ function bindEventYS() {
|
|
|
});
|
|
|
$("td").attr("style", "");
|
|
|
//处理表格样式
|
|
|
- $(".container-table").each(function (index, item) {
|
|
|
- var TableWidth = isNaN(parseFloat($(item).find("table").css("width"))) ? 0 : parseFloat($(item).find("table").css("width"));
|
|
|
- var ScrollLeft = isNaN(parseFloat($(item).scrollLeft())) ? 0 : parseFloat($(item).scrollLeft());
|
|
|
- var HWidth = parseFloat(TableWidth) - parseFloat(bodyWidth);
|
|
|
- var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
- var SSWidth = bodyWidth - HWidth * HRate; // 显示滚动条宽度
|
|
|
- if (TableWidth > bodyWidth) {
|
|
|
- var HtmlStr = "<div class='ShowSBar' style='width:" + bodyWidth + "px;height:5px;background-color:#eee;position:relative;left:0px;bottom:3px;z-index:2;border-radius:2px;'><div class='ShowSBarC' style='width:" + SSWidth + "px;height:5px;background-color:#ccc;position:absolute;left:" + ScrollLeft + "px;bottom:0px;z-index:3;border-radius:2px;'></div></div>";
|
|
|
- $(item).after(HtmlStr);
|
|
|
- }
|
|
|
- });
|
|
|
- $(".container-table").on("touchstart", function () {
|
|
|
- var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
- if (TableWidth > bodyWidth) {
|
|
|
- pressTableFlag = true;
|
|
|
- }
|
|
|
- }).on("touchmove", function () {
|
|
|
- var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
- var ScrollLeft = isNaN(parseFloat($(this).scrollLeft())) ? 0 : parseFloat($(this).scrollLeft());
|
|
|
- var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
- var ShowSBarName = $(this).next().attr("class");
|
|
|
- if (ScrollLeft >= 0 && ShowSBarName == "ShowSBar" && $(this).next().find(".ShowSBarC").length > 0) {
|
|
|
- // 有滚动条的进行移动
|
|
|
- $(this).next().find(".ShowSBarC").css("left", (ScrollLeft * HRate) + "px");
|
|
|
- }
|
|
|
- });
|
|
|
+ //$(".container-table").each(function (index, item) {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(item).find("table").css("width"))) ? 0 : parseFloat($(item).find("table").css("width"));
|
|
|
+ // var ScrollLeft = isNaN(parseFloat($(item).scrollLeft())) ? 0 : parseFloat($(item).scrollLeft());
|
|
|
+ // var HWidth = parseFloat(TableWidth) - parseFloat(bodyWidth);
|
|
|
+ // var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
+ // var SSWidth = bodyWidth - HWidth * HRate; // 显示滚动条宽度
|
|
|
+ // if (TableWidth > bodyWidth) {
|
|
|
+ // var HtmlStr = "<div class='ShowSBar' style='width:" + bodyWidth + "px;height:5px;background-color:#eee;position:relative;left:0px;bottom:3px;z-index:2;border-radius:2px;'><div class='ShowSBarC' style='width:" + SSWidth + "px;height:5px;background-color:#ccc;position:absolute;left:" + ScrollLeft + "px;bottom:0px;z-index:3;border-radius:2px;'></div></div>";
|
|
|
+ // $(item).after(HtmlStr);
|
|
|
+ // }
|
|
|
+ //});
|
|
|
+ //$(".container-table").on("touchstart", function () {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
+ // if (TableWidth > bodyWidth) {
|
|
|
+ // pressTableFlag = true;
|
|
|
+ // }
|
|
|
+ //}).on("touchmove", function () {
|
|
|
+ // var TableWidth = isNaN(parseFloat($(this).find("table").css("width"))) ? 0 : parseFloat($(this).find("table").css("width"));
|
|
|
+ // var ScrollLeft = isNaN(parseFloat($(this).scrollLeft())) ? 0 : parseFloat($(this).scrollLeft());
|
|
|
+ // var HRate = parseFloat(bodyWidth) / parseFloat(TableWidth);
|
|
|
+ // var ShowSBarName = $(this).next().attr("class");
|
|
|
+ // if (ScrollLeft >= 0 && ShowSBarName == "ShowSBar" && $(this).next().find(".ShowSBarC").length > 0) {
|
|
|
+ // // 有滚动条的进行移动
|
|
|
+ // $(this).next().find(".ShowSBarC").css("left", (ScrollLeft*HRate) + "px");
|
|
|
+ // }
|
|
|
+ //});
|
|
|
}
|
|
|
-var pressTableFlag = false;
|
|
|
// 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
|
|
|
function getPressFlag() {
|
|
|
- return pressTableFlag;
|
|
|
+ alert(pressTableFlag);
|
|
|
}
|
|
|
// 滚动条渲染
|
|
|
|
|
|
// 设置离焦事件
|
|
|
-function resetPressFlag() {
|
|
|
+function setPressFlag() {
|
|
|
pressTableFlag = false;
|
|
|
}
|
|
|
// 判断是否存在中文(true表示存在)
|
|
|
var hasChineseWorld = function (dataStr) {
|
|
|
- if (escape(dataStr).indexOf("%u") < 0) {
|
|
|
+ if (escape(dataStr).indexOf("%u") < 0)
|
|
|
+ {
|
|
|
return false;
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
return true;
|
|
|
}
|
|
|
};
|
|
|
//学生端 处理作答区域
|
|
|
var answerData = new Array();
|
|
|
-function handleAnswerRange() {
|
|
|
- //规范文本格式
|
|
|
+ function handleAnswerRange() {
|
|
|
+ //规范文本格式
|
|
|
var answerId = "";
|
|
|
var tempJson = new Array();
|
|
|
- //先处理一题多空的情况,获取两个之间的答题点
|
|
|
+ //先处理一题多空的情况,获取两个之间的答题点
|
|
|
$(".multipleStart").each(function (i, item) {
|
|
|
$.merge($(item).nextUntil(".multipleEnd").filter("[class*='group']"), $(item).nextUntil(".multipleEnd").find("[class*='group']")).each(function (index, item) {
|
|
|
var checkId = $(item).find('.yaoshi').attr("answer-id");
|
|
|
@@ -703,7 +790,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('input').prop('checked', ischecked);
|
|
|
$(item).find('.underlineContent').hide();
|
|
|
- }
|
|
|
+ }
|
|
|
//点击事件
|
|
|
$(item).find('input').bind("click", function () {
|
|
|
var curObj = new Object();
|
|
|
@@ -730,14 +817,14 @@ function handleAnswerRange() {
|
|
|
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
|
|
|
@@ -746,17 +833,17 @@ function handleAnswerRange() {
|
|
|
}
|
|
|
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();
|
|
|
@@ -768,10 +855,10 @@ function handleAnswerRange() {
|
|
|
}
|
|
|
else {
|
|
|
answerId = info.Id;
|
|
|
- }
|
|
|
+ }
|
|
|
if (info.pId == undefined) {
|
|
|
info.pId = answerId;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
info.AnsText = $(item).text();
|
|
|
tempJson.push(info);
|
|
|
@@ -784,11 +871,11 @@ function handleAnswerRange() {
|
|
|
}
|
|
|
else {
|
|
|
$(item).remove();
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- //补充空钥匙的处理
|
|
|
+ //补充空钥匙的处理
|
|
|
$.each($(".yaoshi"), function (index, item) {
|
|
|
var Id = $(item).attr("answer-id");
|
|
|
var prev = $(item).next();
|
|
|
@@ -800,12 +887,12 @@ function handleAnswerRange() {
|
|
|
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) {
|
|
|
@@ -817,11 +904,11 @@ function handleAnswerRange() {
|
|
|
$.each($(part).find(".tag-span"), function (index, item) {
|
|
|
$(item).attr("answer-isky", "1");
|
|
|
});
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- //合并参考答案数据
|
|
|
+ //合并参考答案数据
|
|
|
var tempid = "";
|
|
|
var temppid = "";
|
|
|
var temptext = "";
|
|
|
@@ -839,37 +926,37 @@ function handleAnswerRange() {
|
|
|
//重置
|
|
|
tempid = "";
|
|
|
temptext = "";
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
tempid = tempJson[i].Id;
|
|
|
temppid = tempJson[i].pId;
|
|
|
temptext = tempJson[i].AnsText;
|
|
|
//最后一个存入
|
|
|
- if (i == tempJson.length - 1) {
|
|
|
+ if (i == tempJson.length -1) {
|
|
|
var info = new Object();
|
|
|
info.Id = tempid;
|
|
|
info.pId = temppid;
|
|
|
info.AnsText = temptext;
|
|
|
answerData.push(info);
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //补全答题点
|
|
|
+ //补全答题点
|
|
|
var Num = 0;
|
|
|
if (answerData.length > 0) {
|
|
|
//Num = Number.parseInt(answerData[answerData.length - 1].Id);
|
|
|
Num = Number.parseInt($(".yaoshi:last").attr('answer-id'));
|
|
|
- for (var i = 0; i < Num + 1; i++) {
|
|
|
+ for (var i = 0; i < Num +1; i++) {
|
|
|
if (i < answerData.length) {
|
|
|
- var index = Number(answerData[i].Id) - i;
|
|
|
+ var index = Number(answerData[i].Id) -i;
|
|
|
for (var j = 0; j < index; j++) {
|
|
|
var info = new Object();
|
|
|
info.Id = (i + j).toString();
|
|
|
info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
var info = new Object();
|
|
|
@@ -877,11 +964,11 @@ function handleAnswerRange() {
|
|
|
info.pId = info.Id;
|
|
|
info.AnsText = "";
|
|
|
answerData.splice(i, 0, info);
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //添加答题点的点击UI及交互
|
|
|
+ //添加答题点的点击UI及交互
|
|
|
$.each($(".tag-span"), function (index, item) {
|
|
|
var answerText = "";
|
|
|
var parentId = "";
|
|
|
@@ -893,17 +980,17 @@ function handleAnswerRange() {
|
|
|
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
|
|
|
@@ -927,25 +1014,25 @@ function handleAnswerRange() {
|
|
|
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 + "']");
|
|
|
@@ -963,7 +1050,7 @@ function reviewAnswer(answerJson) {
|
|
|
answerObj.Text = "(" + answerObj.Text + ")";
|
|
|
$(selectElement).children(".answer-text").show();
|
|
|
$(selectElement).children(".answer-text").text(answerObj.Text);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
//是否之前存在作答音频
|
|
|
$(selectElement).attr("answer-url", answerObj.AudioUrl);
|
|
|
@@ -990,14 +1077,14 @@ function reviewAnswer(answerJson) {
|
|
|
else {
|
|
|
$(selectElement).children(".answer-text").hide();
|
|
|
$(selectElement).children(".answer-point-range").show();
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-//提交,获取所有作答答案及参考答案
|
|
|
-function getAllAnswer() {
|
|
|
- //处理作答
|
|
|
+ //提交,获取所有作答答案及参考答案
|
|
|
+ function getAllAnswer() {
|
|
|
+ //处理作答
|
|
|
$.each($(".answer-body"), function (index, item) {
|
|
|
var mytext = $(item).children(".answer-text").text();
|
|
|
var curDisplay = $(item).children(".answer-audio-range").css("display");
|
|
|
@@ -1007,13 +1094,13 @@ function getAllAnswer() {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
$(".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");
|
|
|
@@ -1026,13 +1113,13 @@ function getAllAnswer() {
|
|
|
$(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) {
|
|
|
@@ -1043,8 +1130,8 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
@@ -1063,7 +1150,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
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);
|
|
|
@@ -1073,7 +1160,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
//可作答状态,作答还原
|
|
|
if (statusType == 0) {
|
|
|
//已作答过,还原作答,增加作答后的UI节点
|
|
|
@@ -1090,9 +1177,9 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-point-range").hide();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
//已提交,作答还原
|
|
|
if (statusType == 1) {
|
|
|
//取消点击绑定事件
|
|
|
@@ -1111,9 +1198,9 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
- $(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ }
|
|
|
//已评阅,查看评阅详情
|
|
|
if (statusType == 2) {
|
|
|
//添加音频控制
|
|
|
@@ -1139,18 +1226,18 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
else {
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
- $(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
+ $(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) {
|
|
|
@@ -1158,7 +1245,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-showanswer", "1"); // 修改显示格式
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
//打勾题的还原
|
|
|
$.each($(".checkbox"), function (num, item) {
|
|
|
@@ -1171,8 +1258,8 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
@@ -1186,7 +1273,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
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) {
|
|
|
@@ -1213,14 +1300,14 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
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 + "']");
|
|
|
@@ -1233,16 +1320,16 @@ function reviewStuAnswer(answerJson) {
|
|
|
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) {
|
|
|
@@ -1253,8 +1340,8 @@ function backupAllReview(answerJson) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
//$(item).attr("answer-id", answerList[index].Id);//答题点ID
|
|
|
//$(item).attr("answer-text", answerList[index].Text);//用户作答内容
|
|
|
@@ -1275,7 +1362,7 @@ function backupAllReview(answerJson) {
|
|
|
mytext = "(" + mytext + ")";
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
//是否之前存在作答音频
|
|
|
$(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
@@ -1296,19 +1383,19 @@ function backupAllReview(answerJson) {
|
|
|
if (mytext == "") {
|
|
|
mytext = "未作答";
|
|
|
$(item).children(".answer-text").addClass("no-answer");
|
|
|
- }
|
|
|
+ }
|
|
|
$(item).children(".answer-text").show();
|
|
|
$(item).children(".answer-text").text(mytext);
|
|
|
$(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) {
|
|
|
@@ -1320,8 +1407,8 @@ function backupAllReview(answerJson) {
|
|
|
if (answerid == answerList[i].Id) {
|
|
|
index = i;
|
|
|
break;
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
@@ -1354,14 +1441,14 @@ function backupAllReview(answerJson) {
|
|
|
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") {
|
|
|
@@ -1371,13 +1458,13 @@ function playRecordAudio(answerid, isPlay) {
|
|
|
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 + "']");
|
|
|
@@ -1388,17 +1475,17 @@ function scrollAnswer(answerid) {
|
|
|
var scroll_offset = $(ansDom).offset(); //得到box这个div层的offset,包含两个值,top和left
|
|
|
var offset_top = scroll_offset.top;
|
|
|
if (offset_top > 150) {
|
|
|
- offset_top = offset_top - 200;
|
|
|
+ offset_top = offset_top -200;
|
|
|
}
|
|
|
|
|
|
$("body,html").animate({
|
|
|
- scrollTop: offset_top //让body的scrollTop等于pos的top,就实现了滚动
|
|
|
+ scrollTop: offset_top //让body的scrollTop等于pos的top,就实现了滚动
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-//暂停播放原文音频
|
|
|
-function pauseTextAudio(audioid) {
|
|
|
- //获取其他正在播放的音频
|
|
|
+ //暂停播放原文音频
|
|
|
+ function pauseTextAudio(audioid) {
|
|
|
+ //获取其他正在播放的音频
|
|
|
var playing = $(".audioImg[audio-id='" + audioid + "']");
|
|
|
if (playing.length > 0) {
|
|
|
$(playing).attr("play-status", "0");
|
|
|
@@ -1406,11 +1493,11 @@ function pauseTextAudio(audioid) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//原文音频播放按钮点击事件
|
|
|
-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);//移动端要根据本地 喇叭 路径替换
|
|
|
@@ -1421,13 +1508,13 @@ function audioPlayClick(myobj) {
|
|
|
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);//移动端要根据本地 喇叭 路径替换
|
|
|
@@ -1436,26 +1523,26 @@ function audioPlayClick(myobj) {
|
|
|
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);//移动端要根据本地路径替换
|
|
|
@@ -1465,34 +1552,34 @@ function recordAudioClick(myobj, id, url) {
|
|
|
$(myobj).attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
}
|
|
|
|
|
|
- //移动端添加外部处理,播放录音
|
|
|
+ //移动端添加外部处理,播放录音
|
|
|
var info = new Object();
|
|
|
info.Id = id;
|
|
|
info.AudioUrl = url;
|
|
|
- //移动端添加外部处理,播放录音
|
|
|
+ //移动端添加外部处理,播放录音
|
|
|
playVisiableAudioCallBack(3, JSON.stringify(info));
|
|
|
}
|
|
|
|
|
|
-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 cancelBubble(e) {
|
|
|
+ function cancelBubble(e) {
|
|
|
var evt = e ? e : window.event;
|
|
|
if (evt.stopPropagation) { //W3C
|
|
|
evt.stopPropagation();
|
|
|
@@ -1511,23 +1598,4 @@ function getSelectedText(title) {
|
|
|
txt = window.document.selection.createRange().text;
|
|
|
}
|
|
|
JSInterface.callback(txt, title);
|
|
|
-}
|
|
|
-
|
|
|
-//暂停播放主体课文中的原文音频
|
|
|
-function pauseTextAudio(audioID) {
|
|
|
- //获取其他正在播放的音频
|
|
|
- var playing = $(".audioImg[audio-id='" + audioID + "']");
|
|
|
- if (playing.length > 0) {
|
|
|
- $(playing).attr("play-status", "0");
|
|
|
- $(playing).attr("src", PicInfo.audioPauseImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function playTextAudio(audioID) {
|
|
|
- //获取其他正在播放的音频
|
|
|
- var playing = $(".audioImg[audio-id='" + audioID + "']");
|
|
|
- if (playing.length > 0) {
|
|
|
- $(playing).attr("play-status", "1");
|
|
|
- $(playing).attr("src", PicInfo.audioPlayImgUrl);//移动端要根据本地 喇叭 路径替换
|
|
|
- }
|
|
|
-}
|
|
|
+}
|