|
|
@@ -1,6 +1,6 @@
|
|
|
//播放音频图片地址
|
|
|
-var PicInfo = {
|
|
|
- answerPointImgUrl: "file:///android_asset/js/update-answer.png", //../Images/update-answer.png
|
|
|
+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",
|
|
|
recordPlayImgUrl: "file:///android_asset/js/play.png",
|
|
|
@@ -9,6 +9,18 @@ var PicInfo = {
|
|
|
audioPauseImgUrl: "file:///android_asset/js/dynaiselaba.png"
|
|
|
}
|
|
|
|
|
|
+//本地调用用的资源
|
|
|
+var PicInfo = {
|
|
|
+ answerPointImgUrl: "../Images/update-answer.png",
|
|
|
+ yaoshiShowImgUrl: "../Images/yaoshi-show.png",
|
|
|
+ yaoshiHideImgUrl: "../Images/yaoshi-hide.png",
|
|
|
+ KouYuTagImgUrl: "../Images/KY.png",
|
|
|
+ recordPlayImgUrl: "../Images/play.png",
|
|
|
+ recordPauseImgUrl: "../Images/pause.png",
|
|
|
+ audioPlayImgUrl: "../Images/dynaiselaba.gif",
|
|
|
+ audioPauseImgUrl: "../Images/dynaiselaba.png"
|
|
|
+}
|
|
|
+
|
|
|
//显示、隐藏答案
|
|
|
function showHideAnswer(flag) {
|
|
|
if (flag) {
|
|
|
@@ -403,7 +415,7 @@ function handleAnswerRange() {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- $(item).prop("outerHTML", "<div class='answer-range' answer-id='" + answerid + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answertext'>答题点</span></div>");
|
|
|
+ $(item).prop("outerHTML", "<div class='answer-body' answer-id='" + answerid + "' answer-anstext='" + answerText + "' answer-isky='" + isky + "'><div class='answer-audio-range'><img src='" + PicInfo.recordPlayImgUrl + "'/><span class='answer-audio-text'>作答音频</span></div><div class='answer-point-range'><img src='" + PicInfo.answerPointImgUrl + "'/><span class='answer-point-text'>答题点</span></div><buttom class='answer-text'></buttom></div>");
|
|
|
//删除钥匙节点
|
|
|
var prev = $("img[answer-id='" + answerid + "']");
|
|
|
if (prev.length > 0) {
|
|
|
@@ -412,7 +424,7 @@ function handleAnswerRange() {
|
|
|
});
|
|
|
|
|
|
//添加点击事件
|
|
|
- $(".answer-range").on("click", function () {
|
|
|
+ $(".answer-body").on("click", function () {
|
|
|
var curObj = new Object();
|
|
|
curObj.Id = $(this).attr("answer-id");//答题点ID
|
|
|
curObj.IsKY = $(this).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
@@ -421,7 +433,7 @@ function handleAnswerRange() {
|
|
|
curObj.AnsText = $(this).attr("answer-anstext");//参考答案
|
|
|
curObj.Comment = $(this).attr("answer-comment");//评语
|
|
|
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
$(this).addClass("select-answer");
|
|
|
|
|
|
//已作答,弹出作答答案
|
|
|
@@ -451,55 +463,49 @@ function handleAnswerRange() {
|
|
|
function reviewAnswer(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerObj = JSON.parse(answerJson);
|
|
|
- var selectElement = $(".answer-range[answer-id='" + answerObj.Id + "']");
|
|
|
- var audioElement = $(selectElement).children("img").eq(0);
|
|
|
+ var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
|
|
|
+ var audioElement = $(selectElement).children(".answer-audio-range").children("img").eq(0);
|
|
|
answerObj.IsKY = $(selectElement).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
|
|
|
- //有内容时,要动态处理单词长度
|
|
|
- if (answerObj.Text != "") {
|
|
|
- $(selectElement).addClass("break-word");
|
|
|
- }
|
|
|
- else {
|
|
|
- $(selectElement).removeClass("break-word");
|
|
|
- }
|
|
|
-
|
|
|
- //是否是音频作答
|
|
|
+ //是否为音频作答
|
|
|
if ((answerObj.Type == 3 || answerObj.Type == 4) && answerObj.AudioUrl != "") {
|
|
|
- $(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
|
|
|
- answerObj.Text = answerObj.Text == "" ? "作答音频[" + answerObj.AudioLength + "s]" : "作答音频[" + answerObj.AudioLength + "s]" + "(" + answerObj.Text + ")";
|
|
|
- $(selectElement).children("span").text(answerObj.Text);
|
|
|
-
|
|
|
- //是否之前存在作答音频
|
|
|
- $(selectElement).attr("play-status", "0");
|
|
|
- $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
- var curDisplay = $(audioElement).css("display");
|
|
|
- if (curDisplay == "none") {
|
|
|
- $(audioElement).show();
|
|
|
+ $(selectElement).children(".answer-point-range").hide();
|
|
|
+ $(selectElement).children(".answer-audio-range").css("display", "inline-block");
|
|
|
+ $(selectElement).children(".answer-audio-range").children("span").text("作答音频(" + answerObj.AudioLength + "s)");
|
|
|
+ //填充作答内容
|
|
|
+ $(selectElement).attr("answer-text", answerObj.Text);
|
|
|
+ if (answerObj.Text != "") {
|
|
|
+ answerObj.Text = "(" + answerObj.Text + ")";
|
|
|
+ $(selectElement).children(".answer-text").show();
|
|
|
+ $(selectElement).children(".answer-text").text(answerObj.Text);
|
|
|
}
|
|
|
|
|
|
+ //是否之前存在作答音频
|
|
|
$(selectElement).attr("answer-url", answerObj.AudioUrl);
|
|
|
+ $(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
+ $(selectElement).children(".answer-audio-range").attr("play-status", "0");
|
|
|
//独立绑定事件
|
|
|
$(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerObj.Id, answerObj.AudioUrl);
|
|
|
});
|
|
|
- $(selectElement).children("span").on("click", function () {
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
- $(item).addClass("select-answer");
|
|
|
+ $(selectElement).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ $(selectElement).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerObj));
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
$(selectElement).attr("answer-text", answerObj.Text);//填充作答内容
|
|
|
- if (answerObj.Text == "") {
|
|
|
- answerObj.Text = "答题点";
|
|
|
- $(audioElement).show();
|
|
|
- $(audioElement).attr("src", PicInfo.answerPointImgUrl);
|
|
|
+ $(selectElement).children(".answer-audio-range").hide();
|
|
|
+ if (answerObj.Text != "") {
|
|
|
+ $(selectElement).children(".answer-text").show();
|
|
|
+ $(selectElement).children(".answer-point-range").hide();
|
|
|
+ $(selectElement).children(".answer-text").text(answerObj.Text);
|
|
|
}
|
|
|
else {
|
|
|
- //之前作答存在音频,但是现在没有音频传入,要隐藏音频节点
|
|
|
- $(audioElement).hide();
|
|
|
+ $(selectElement).children(".answer-text").hide();
|
|
|
+ $(selectElement).children(".answer-point-range").show();
|
|
|
}
|
|
|
- $(selectElement).children("span").text(answerObj.Text);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -507,17 +513,19 @@ function reviewAnswer(answerJson) {
|
|
|
//提交,获取所有作答答案及参考答案
|
|
|
function getAllAnswer() {
|
|
|
//处理作答
|
|
|
- $.each($(".answer-range"), function (index, item) {
|
|
|
- var mytext = $(item).children("span").text();
|
|
|
- if (mytext == "答题点") {
|
|
|
+ $.each($(".answer-body"), function (index, item) {
|
|
|
+ var mytext = $(item).children(".answer-text").text();
|
|
|
+ var curDisplay = $(item).children(".answer-audio-range").css("display");
|
|
|
+ if (mytext == "" && curDisplay == "none") {
|
|
|
mytext = "未作答";
|
|
|
- $(item).children("span").addClass("no-answer");
|
|
|
- $(item).children("img").hide();
|
|
|
- $(item).children("span").text(mytext);
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ $(item).children(".answer-text").addClass("no-answer");
|
|
|
}
|
|
|
});
|
|
|
- $(".answer-range").unbind('click');//取消点击绑定事件
|
|
|
- $(".answer-range>span").unbind('click');//取消点击绑定事件
|
|
|
+ $(".answer-body").unbind('click');//取消点击绑定事件
|
|
|
+ $(".answer-body").children(".answer-audio-range").children("span").unbind('click');//取消点击绑定事件
|
|
|
|
|
|
return answerData;
|
|
|
}
|
|
|
@@ -526,87 +534,75 @@ function getAllAnswer() {
|
|
|
function backupAllAnswer(answerJson, statusType) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerList = JSON.parse(answerJson);
|
|
|
- //answerList = JSON.parse(answerList);
|
|
|
- //获取Dom一个个回填
|
|
|
- $.each($(".answer-range"), function (index, item) {
|
|
|
+ $.each($(".answer-body"), function (index, item) {
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
answerList[index].IsKY = $(item).attr("answer-isky");//是否是口语试题,0-不是口语题,1-是口语题
|
|
|
- //有内容时,要动态处理单词长度
|
|
|
- if (mytext != "") {
|
|
|
- $(item).addClass("break-word");
|
|
|
- }
|
|
|
|
|
|
//添加音频控制
|
|
|
- var audioElement = $(item).children("img").eq(0);
|
|
|
+ var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
- mytext = mytext == "" ? "作答音频[" + answerList[index].AudioLength + "s]" : "作答音频[" + answerList[index].AudioLength + "s]" + "(" + mytext + ")";
|
|
|
- $(item).children("span").text(mytext);
|
|
|
-
|
|
|
- $(item).attr("play-status", "0");
|
|
|
- $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-audio-range").css("display", "inline-block");
|
|
|
+ $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
|
|
|
+ //填充作答内容
|
|
|
+ $(item).attr("answer-text", mytext);
|
|
|
+ if (mytext != "") {
|
|
|
+ mytext = "(" + mytext + ")";
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ }
|
|
|
+ //音频节点
|
|
|
$(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
+ $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
+ $(item).children(".answer-audio-range").attr("play-status", "0");
|
|
|
+
|
|
|
+ //独立绑定事件
|
|
|
+ $(audioElement).on("click", function () {
|
|
|
+ recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//可作答状态,作答还原
|
|
|
if (statusType == 0) {
|
|
|
//已作答过,还原作答,增加作答后的UI节点
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- //独立绑定事件
|
|
|
- $(item).children("img").on("click", function () {
|
|
|
- recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
- });
|
|
|
- $(item).children("span").on("click", function () {
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
+ $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
|
- if (mytext == "") {
|
|
|
- mytext = "答题点";
|
|
|
- $(audioElement).attr("src", PicInfo.answerPointImgUrl);
|
|
|
- }
|
|
|
- else {
|
|
|
- //之前作答存在音频,但是现在没有音频传入,要隐藏音频节点
|
|
|
- $(audioElement).hide();
|
|
|
+ if (mytext != "") {
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
}
|
|
|
- $(item).children("span").text(mytext);
|
|
|
}
|
|
|
}
|
|
|
//已提交,作答还原
|
|
|
if (statusType == 1) {
|
|
|
//取消点击绑定事件
|
|
|
$(item).unbind('click');
|
|
|
- //添加音频控制
|
|
|
- if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- //独立绑定事件
|
|
|
- $(item).children("img").on("click", function () {
|
|
|
- recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
- });
|
|
|
- }
|
|
|
- else {
|
|
|
- $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
- if (mytext == "") {
|
|
|
- mytext = "未作答";
|
|
|
- $(item).children("span").addClass("no-answer");
|
|
|
- }
|
|
|
- $(audioElement).hide();
|
|
|
- $(item).children("span").text(mytext);
|
|
|
+ //填充作答内容
|
|
|
+ $(item).attr("answer-text", mytext);
|
|
|
+ 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 (statusType == 2) {
|
|
|
//添加音频控制
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
//独立绑定事件
|
|
|
- $(item).children("img").on("click", function () {
|
|
|
- recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
- });
|
|
|
- $(item).children("span").on("click", function () {
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
+ $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
|
onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
});
|
|
|
@@ -615,17 +611,19 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
|
if (mytext == "") {
|
|
|
mytext = "未作答";
|
|
|
- $(item).children("span").addClass("no-answer");
|
|
|
+ $(item).children(".answer-text").addClass("no-answer");
|
|
|
}
|
|
|
- $(audioElement).hide();
|
|
|
- $(item).children("span").text(mytext);
|
|
|
+ $(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("span").addClass("bad-answer");
|
|
|
+ $(item).children(".answer-text").addClass("bad-answer");
|
|
|
}
|
|
|
if (answerList[index].Score > 0) {
|
|
|
- $(item).children("span").addClass("good-answer");
|
|
|
+ $(item).children(".answer-text").addClass("good-answer");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -636,7 +634,7 @@ function backupAllAnswer(answerJson, statusType) {
|
|
|
function reviewStuAnswer(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerObj = JSON.parse(answerJson);
|
|
|
- var selectElement = $(".answer-range[answer-id='" + answerObj.Id + "']");
|
|
|
+ var selectElement = $(".answer-body[answer-id='" + answerObj.Id + "']");
|
|
|
|
|
|
//$(selectElement).attr("answer-text", answerObj.Text);//用户作答内容
|
|
|
$(selectElement).attr("answer-score", answerObj.Score);//作答评分
|
|
|
@@ -644,12 +642,12 @@ function reviewStuAnswer(answerJson) {
|
|
|
$(selectElement).attr("answer-comment", answerObj.Comment);//评语
|
|
|
//评阅样式
|
|
|
if (answerObj.Score == 0) {
|
|
|
- $(selectElement).children("span").removeClass("good-answer");
|
|
|
- $(selectElement).children("span").addClass("bad-answer");
|
|
|
+ $(selectElement).children(".answer-text").removeClass("good-answer");
|
|
|
+ $(selectElement).children(".answer-text").addClass("bad-answer");
|
|
|
}
|
|
|
if (answerObj.Score > 0) {
|
|
|
- $(selectElement).children("span").removeClass("bad-answer");
|
|
|
- $(selectElement).children("span").addClass("good-answer");
|
|
|
+ $(selectElement).children(".answer-text").removeClass("bad-answer");
|
|
|
+ $(selectElement).children(".answer-text").addClass("good-answer");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -658,7 +656,7 @@ function reviewStuAnswer(answerJson) {
|
|
|
function backupAllReview(answerJson) {
|
|
|
if (answerJson != "" && answerJson) {
|
|
|
var answerList = JSON.parse(answerJson);
|
|
|
- $.each($(".answer-range"), function (index, item) {
|
|
|
+ $.each($(".answer-body"), function (index, item) {
|
|
|
//$(item).attr("answer-id", answerList[index].Id);//答题点ID
|
|
|
//$(item).attr("answer-text", answerList[index].Text);//用户作答内容
|
|
|
$(item).attr("answer-score", answerList[index].Score);//作答评分
|
|
|
@@ -667,41 +665,50 @@ function backupAllReview(answerJson) {
|
|
|
|
|
|
//提交直接还原作答现场
|
|
|
var mytext = answerList[index].Text;//我的答案
|
|
|
- var audioElement = $(item).children("img").eq(0);
|
|
|
+ var audioElement = $(item).children(".answer-audio-range").children("img").eq(0);
|
|
|
if ((answerList[index].Type == 3 || answerList[index].Type == 4) && answerList[index].AudioUrl != "") {
|
|
|
- $(item).attr("answer-text", mytext);//填充作答内容
|
|
|
- mytext = mytext == "" ? "作答音频[" + answerList[index].AudioLength + "s]" : "作答音频[" + answerList[index].AudioLength + "s]" + "(" + mytext + ")";
|
|
|
- $(item).children("span").text(mytext);
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
+ $(item).children(".answer-audio-range").css("display", "inline-block");
|
|
|
+ $(item).children(".answer-audio-range").children("span").text("作答音频(" + answerList[index].AudioLength + "s)");
|
|
|
+ //填充作答内容
|
|
|
+ $(item).attr("answer-text", mytext);
|
|
|
+ if (mytext != "") {
|
|
|
+ mytext = "(" + mytext + ")";
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ }
|
|
|
|
|
|
- $(item).attr("play-status", "0");
|
|
|
- $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
+ //是否之前存在作答音频
|
|
|
$(audioElement).attr("src", PicInfo.recordPlayImgUrl);
|
|
|
+ $(item).attr("answer-url", answerList[index].AudioUrl);
|
|
|
+ $(item).children(".answer-audio-range").attr("play-status", "0");
|
|
|
//独立绑定事件
|
|
|
- $(item).children("img").on("click", function () {
|
|
|
+ $(audioElement).on("click", function () {
|
|
|
recordAudioClick(this, answerList[index].Id, answerList[index].AudioUrl);
|
|
|
});
|
|
|
- $(item).children("span").on("click", function () {
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
+ $(item).children(".answer-audio-range").children("span").on("click", function () {
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
$(item).addClass("select-answer");
|
|
|
- onClickAnswerPoint(JSON.stringify(answerList[index]));//移动端的修改
|
|
|
+ onClickAnswerPoint(JSON.stringify(answerList[index]));
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
$(item).attr("answer-text", mytext);//填充作答内容
|
|
|
if (mytext == "") {
|
|
|
mytext = "未作答";
|
|
|
- $(item).children("span").addClass("no-answer");
|
|
|
+ $(item).children(".answer-text").addClass("no-answer");
|
|
|
}
|
|
|
- $(audioElement).hide();
|
|
|
- $(item).children("span").text(mytext);
|
|
|
+ $(item).children(".answer-text").show();
|
|
|
+ $(item).children(".answer-text").text(mytext);
|
|
|
+ $(item).children(".answer-point-range").hide();
|
|
|
}
|
|
|
|
|
|
//评阅样式
|
|
|
if (answerList[index].Score == 0) {
|
|
|
- $(item).children("span").addClass("bad-answer");
|
|
|
+ $(item).children(".answer-text").addClass("bad-answer");
|
|
|
}
|
|
|
if (answerList[index].Score > 0) {
|
|
|
- $(item).children("span").addClass("good-answer");
|
|
|
+ $(item).children(".answer-text").addClass("good-answer");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -710,7 +717,7 @@ function backupAllReview(answerJson) {
|
|
|
//处理播放录音,answerid:答题点ID,isPlay:是否播放(0-暂停,1-播放)
|
|
|
function playRecordAudio(answerid, isPlay) {
|
|
|
//获取其他正在播放的音频
|
|
|
- var playing = $(".answer-range[answer-id='" + answerid + "']");
|
|
|
+ var playing = $(".answer-body[answer-id='" + answerid + "']").children(".answer-audio-range");
|
|
|
if (playing.length > 0) {
|
|
|
if (isPlay == "1") {
|
|
|
$(playing).attr("play-status", "1");
|
|
|
@@ -726,8 +733,8 @@ function playRecordAudio(answerid, isPlay) {
|
|
|
//滚动到相应DIV
|
|
|
function scrollAnswer(answerid) {
|
|
|
//console.log(answerid);
|
|
|
- $(".answer-range").removeClass("select-answer");
|
|
|
- var ansDom = $(".answer-range[answer-id='" + answerid + "']");
|
|
|
+ $(".answer-body").removeClass("select-answer");
|
|
|
+ var ansDom = $(".answer-body[answer-id='" + answerid + "']");
|
|
|
$(ansDom).addClass("select-answer");
|
|
|
var scroll_offset = $(ansDom).offset(); //得到box这个div层的offset,包含两个值,top和left
|
|
|
var offset_top = scroll_offset.top;
|
|
|
@@ -761,7 +768,7 @@ function audioPlayClick(myobj) {
|
|
|
}
|
|
|
else {
|
|
|
//停止其他作答音频播放
|
|
|
- var isRecordPlaying = $(".answer-range[play-status='1']");
|
|
|
+ var isRecordPlaying = $(".answer-audio-range[play-status='1']");
|
|
|
if (isRecordPlaying.length > 0) {
|
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|
|
|
@@ -789,7 +796,7 @@ function recordAudioClick(myobj, id, url) {
|
|
|
//处理当前按钮的状态
|
|
|
if ($(myobj).parent().attr("play-status") == "0") {
|
|
|
//停止其他作答音频播放
|
|
|
- var isRecordPlaying = $(".answer-range[play-status='1']");
|
|
|
+ var isRecordPlaying = $(".answer-audio-range[play-status='1']");
|
|
|
if (isRecordPlaying.length > 0) {
|
|
|
$(isRecordPlaying).attr("play-status", "0");
|
|
|
$(isRecordPlaying).find("img").attr("src", PicInfo.recordPlayImgUrl);//移动端要根据本地路径替换
|