Browse Source

处理表格内的打勾题

lujianhong 4 years ago
parent
commit
4606e029ba
2 changed files with 5 additions and 4 deletions
  1. 4 3
      EBook.Web/Common/tasklib_book.js
  2. 1 1
      EBook.Web/Test.html

+ 4 - 3
EBook.Web/Common/tasklib_book.js

@@ -227,7 +227,8 @@ function bindEventYS() {
     var headid = -1;
     var groupId = -1;
     $(".multipleStart").each(function (i, item) {
-        $.each($(item).nextUntil(".multipleEnd").filter("[class*='group']"), function (index, item) {
+        var $startNode = $(item);
+        $.merge($(item).nextUntil(".multipleEnd").filter("[class*='group']"), $(item).nextUntil(".multipleEnd").find("[class*='group']")).each(function (index, item) {
             checkId = $(item).find('.yaoshi').attr("answer-id");
             var gid = $(item).attr('class').replace(/.*group(\d+).*/g, "$1");
             if (index == 0 || groupId != gid) {
@@ -237,7 +238,7 @@ function bindEventYS() {
             $(item).find('.yaoshi').attr('parent-anid', headid);
         });
     });
-    
+
     //显示/隐藏习题答案
     $(".yaoshi").on("click", function () {
         var parentAnid = $(this).attr("parent-anid");
@@ -428,7 +429,7 @@ function handleAnswerRange() {
     var tempJson = new Array();
     //先处理一题多空的情况,获取两个之间的答题点
     $(".multipleStart").each(function (i, item) {
-        $.each($(item).nextUntil(".multipleEnd").filter("[class*='group']"), function (index, 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");
             var headid = $(item).find('.yaoshi').attr("parent-anid");
             var ischecked = $(item).find(".underlineContent").text().indexOf("√") > -1;

+ 1 - 1
EBook.Web/Test.html

@@ -47,7 +47,7 @@
         }
         //加载听说课文
         $("#load-text").on("click", function () {
-            var data = $.ajax({ url: "lghp/gouxuan.lghp", async: false }).responseText;
+            var data = $.ajax({ url: "lghp/BGGX.lghp", async: false }).responseText;
             $("#data").html(data);
 
             //Fill(JSON.parse(hightcodejson));