Переглянути джерело

增加一题多空的初步适配

lujianhong 4 роки тому
батько
коміт
96240cdec0

+ 2 - 0
EBook.Web/Common/tasklib_book.css

@@ -20,6 +20,8 @@ p{word-break: break-word;word-wrap: break-word;clear:both;}
 .select-answer {background:#ffefe4;}
 .select-answer .answer-text {color:#ff6600;}
 .select-answer .answer-point-range span {color:#ff6600;}
+/*一题多空样式*/
+.checkbox {display:inline;}
 
 /*.docxParagraphs {border:solid red 1px;}*/
 .answertext {border:0px; border-bottom:solid #6ab7ff 1px; padding-left:5px; color:#6ab7ff;word-break:keep-all;}

+ 14 - 2
EBook.Web/Common/tasklib_book.js

@@ -211,7 +211,7 @@ function bindEventYS() {
             uHtml.className = "underlineContent no-answer";
             uHtml.innerText = "暂无参考答案";
             if ($(parent)[0].tagName == 'P') {
-                if ($(parent).hasClass('correntQue')) {
+                if ($(parent).hasClass('correntQue') || $(parent).hasClass('boxQue')) {
                     uHtml.innerHTML = "     ";
                 }
             }
@@ -223,7 +223,19 @@ function bindEventYS() {
     $.each($(".wordTable"), function (index, item) {
         $(item).css("width", bodyWidth + "px");
     });
-    
+    //获取两个之间的答题点
+    var index = 1;
+    var checkId = 0;
+    $.each($(".multipleStart").nextUntil(".multipleEnd").filter("[class*='group']"), function (index, item) {
+        checkId = $(item).find('.yaoshi').attr("answer-id");
+        var index = $(item).attr('class').replace(/.*group(\d+).*/g, "$1");
+        var ischecked = $(item).find(".underlineContent").text().indexOf("√") > -1;
+        if ($(item).hasClass('boxQue')) {
+            $(item).find('.yaoshi').after("<div class='checkbox'><input id=" + checkId + " type='checkbox' onclick=this.checked=!this.checked><label for=" + checkId + "></label></div>");
+            $(item).find('input').prop('checked', ischecked);
+        }
+    });
+
     //显示/隐藏习题答案
     $(".yaoshi").on("click", function () {
         // 隐藏答案

+ 1 - 0
EBook.Web/EBook.Web.csproj

@@ -93,6 +93,7 @@
     <Content Include="Images\yaoshi.png" />
     <None Include="Lghp\21773.lghp" />
     <None Include="Lghp\21587.lghp" />
+    <Content Include="Lghp\21836.lghp" />
     <None Include="Lghp\gaicuo.lghp" />
     <Content Include="NK\tasklib_book.css" />
     <Content Include="NK\tasklib_book.js" />

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
EBook.Web/lghp/21836.lghp


Деякі файли не було показано, через те що забагато файлів було змінено