xiaohaizhao %!s(int64=2) %!d(string=hai) anos
pai
achega
efa9b2bc24

+ 1 - 1
pages/classroom/modules/float/index.wxml

@@ -1,4 +1,4 @@
-<Yl_FloatingButton useSlot>
+<Yl_FloatingButton radius='30' useSlot>
     <view class="flot">
         <image src="/static/image/exam4.png" />
         <text>进入考试</text>

+ 4 - 0
pages/exam/detail.js

@@ -92,6 +92,10 @@ Page({
                             title: res.msg != '成功' ? res.msg : "提交成功",
                             icon: "none"
                         });
+                        res.data.testitems = res.data.testitems.map(v => {
+                            v.answer = JSON.parse(v.answer);
+                            return v
+                        })
                         if (res.msg == '成功') that.setData({
                             detail: res.data,
                             dataShow: true

+ 3 - 3
pages/exam/detail.wxml

@@ -45,7 +45,7 @@
 </view>
 
 <view class="but-box" wx:if="{{detail.status!='已完成'}}">
-    <van-button custom-class='but' disabled='{{count.length!=detail.testitems.length}}' loading="{{loading}}" loading-text="提交中..." type="primary" bindtap="submit">提交试卷</van-button>
+    <van-button custom-class='but' disabled='{{count.length!=detail.testitems.length}}' loading="{{loading}}" loading-text="提交中..." type="primary" bindclick="submit">提交试卷</van-button>
 </view>
 
 <van-popup show="{{ dataShow }}" custom-style='overflow: visible;  border-radius: 16rpx;' bind:close="onClose">
@@ -65,8 +65,8 @@
                 </view>
             </view>
             <view class="analyse">
-                <view>答对<text style="color: #52C41A;">{{detail.errcount||"0"}}</text>题</view>
-                <view style="margin-top: 20rpx;">答错<text style="color: #FF3B30; ">{{detail.rightcount||"0"}}</text>题</view>
+                <view>答对<text style="color: #52C41A;">{{detail.rightcount||"0"}}</text>题</view>
+                <view style="margin-top: 20rpx;">答错<text style="color: #FF3B30; ">{{detail.errcount||"0"}}</text>题</view>
             </view>
             <view class="but-box">
                 <van-button custom-class='but' bindtap="closeShowData">确定</van-button>

+ 32 - 1
pages/exam/index.js

@@ -39,7 +39,9 @@ Page({
             })
         })
     },
-    onSearch({detail}) {
+    onSearch({
+        detail
+    }) {
         this.data.content.where.condition = detail;
         this.getList(true);
     },
@@ -47,6 +49,35 @@ Page({
         const {
             sat_coursewareid
         } = e.currentTarget.dataset;
+
+
+        let that = this;
+        _Http.basic({
+            "classname": "saletool.courseware.coursewaretest",
+            "method": "queryTestList",
+            "content": {
+                "pageNumber": 1,
+                "pageSize": 999,
+                sat_coursewareid,
+                "where": {
+                    "status": ""
+                }
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            if (res.data.length == 0) {
+                this.createTest();
+            } else {
+                wx.navigateTo({
+                    url: '/pages/exam/detail?id=' + res.data[res.data.length - 1].sat_courseware_testid,
+                })
+            }
+        })
+    },
+    createTest(sat_coursewareid) {
         _Http.basic({
             "classname": "saletool.courseware.coursewaretest",
             "method": "createTest",

+ 0 - 1
pages/exam/index.wxml

@@ -23,7 +23,6 @@
         <view wx:if="{{item.status=='未完成'}}" class="bottom" hover-class="navigator-hover" data-sat_coursewareid="{{item.sat_coursewareid}}" bindtap="startTest">
             <image src="/static/image/exam2.png" mode="heightFix" /> 进入考试
         </view>
-
         <navigator url="/pages/exam/detail?id={{item.sat_courseware_testid}}&readOnly=true" wx:else class="bottom">
             <image src="/static/image/exam1.png" mode="heightFix" /> 查看试卷
         </navigator>