chengjie 6 anos atrás
pai
commit
3002b51feb
6 arquivos alterados com 1682 adições e 1591 exclusões
  1. 3 3
      app.js
  2. 27 20
      pages/test/index.js
  3. 11 4
      pages/test/list.js
  4. 29 8
      pages/test/report.js
  5. 1550 0
      utils/constant.js
  6. 62 1556
      utils/main.js

Diferenças do arquivo suprimidas por serem muito extensas
+ 3 - 3
app.js


+ 27 - 20
pages/test/index.js

@@ -142,22 +142,22 @@ Page({
142 142
             Image: "../images/examine_subject_a009.png"
143 143
           }, ]
144 144
         },
145
-        // {
146
-        //   Name: "六年级",
147
-        //   Name2: "语文六年级",
148
-        //   Select: "",
149
-        //   List: [
150
-        //     {
151
-        //       ID: 11,
152
-        //       Type: "Shizi",
153
-        //       Name: "语文识字",
154
-        //       Name2: "上学期",
155
-        //       Finish: 0,
156
-        //       Total: 16,
157
-        //       Image: "../images/examine_subject_a011.png"
158
-        //     },
159
-        //   ]
160
-        // },
145
+        {
146
+          Name: "六年级",
147
+          Name2: "语文六年级",
148
+          Select: "",
149
+          List: [
150
+            {
151
+              ID: 11,
152
+              Type: "Shizi",
153
+              Name: "语文识字",
154
+              Name2: "上学期",
155
+              Finish: 0,
156
+              Total: 16,
157
+              Image: "../images/examine_subject_a011.png"
158
+            },
159
+          ]
160
+        },
161 161
         // {
162 162
         //   Name: "英语常用词",
163 163
         //   Name2: "英语常用词",
@@ -268,13 +268,20 @@ Page({
268 268
     var id = e.currentTarget.dataset.id;
269 269
     var userid = app.globalData.userInfo.UserID;
270 270
     //todo
271
-    main.getData('GetTestReportInfo?UserID=' + userid+'&ID='+id, function (data) {
272
-      if (data) {
271
+    // main.getData('GetTestReportInfo?UserID=' + userid+'&ID='+id, function (data) {
272
+    //   if (data) {
273
+    //     wx.setStorageSync("TestTask", data);
274
+    //     wx.navigateTo({
275
+    //       url: "./report?type=edit",
276
+    //     });
277
+    //   }
278
+    // });
279
+
280
+    main.GetTestReportInfo(id,function(data){
273 281
         wx.setStorageSync("TestTask", data);
274 282
         wx.navigateTo({
275
-          url: "./report?type=edit&id="+id,
283
+          url: "./report?type=edit",
276 284
         });
277
-      }
278 285
     });
279 286
   },
280 287
   onUnload: function () {

+ 11 - 4
pages/test/list.js

@@ -138,14 +138,21 @@ Page({
138 138
 
139 139
       if (id) {
140 140
         var reporttype = e.currentTarget.dataset.type;
141
-        main.getData('GetTestReportInfo?UserID=' + userid + '&ID=' + id, function(data) {
142
-          if (data) {
143
-            wx.setStorageSync("TestTask2", data);
141
+        // main.getData('GetTestReportInfo?UserID=' + userid + '&ID=' + id, function(data) {
142
+        //   if (data) {
143
+        //     wx.setStorageSync("TestTask2", data);
144
+        //     that.onClose();
145
+        //     wx.navigateTo({
146
+        //       url: "./item?type=" + reporttype,
147
+        //     });
148
+        //   }
149
+        // });
150
+        main.GetTestReportInfo(id,function(data){
151
+          wx.setStorageSync("TestTask2", data);
144 152
             that.onClose();
145 153
             wx.navigateTo({
146 154
               url: "./item?type=" + reporttype,
147 155
             });
148
-          }
149 156
         });
150 157
       } else {
151 158
         that.onClose();

+ 29 - 8
pages/test/report.js

@@ -27,16 +27,23 @@ Page({
27 27
     var listRight = [];
28 28
     var listSkip = [];
29 29
     var listWrong = [];
30
+    TestTask.TestRightStr=[];
31
+    TestTask.TestWrongStr=[];
32
+    TestTask.TestSkipStr=[];
33
+
30 34
     if (list) {
31 35
       for (var i = 0; i < list.length; i++) {
32 36
         if (list[i].Result == 1) {
33 37
           listRight.push(list[i]);
38
+          TestTask.TestRightStr.push(list[i].Word);
34 39
         }
35 40
         else if (list[i].Result == -1) {
36 41
           listWrong.push(list[i]);
42
+          TestTask.TestWrongStr.push(list[i].Word);
37 43
         }
38 44
         else if (list[i].Result == 0) {
39 45
           listSkip.push(list[i]);
46
+          TestTask.TestSkipStr.push(list[i].Word);
40 47
         }
41 48
       }
42 49
 
@@ -78,9 +85,9 @@ Page({
78 85
         List: result,
79 86
         NumberTotal: list.length,
80 87
       });
81
-
88
+      
82 89
       if (that.data.ReportType=="new")
83
-        that.saveInfo();
90
+        that.saveInfo(TestTask);
84 91
 
85 92
       wx.setNavigationBarTitle({
86 93
         title: "报告"
@@ -130,7 +137,7 @@ Page({
130 137
   },
131 138
   buildCard: function () {
132 139
     var that = this;
133
-    var arr = [];
140
+    var arr = [],TestExistStr=[];
134 141
     for (var i = 0; i < that.data.List.length; i++) {
135 142
       for (var j = 0; j < that.data.List[i].List.length; j++) {
136 143
         if (that.data.List[i].List[j].Css === "Select") {
@@ -145,6 +152,11 @@ Page({
145 152
           obj.LimitTime = common.formatTime(new Date());
146 153
           obj.FontSize = item.FontSize;
147 154
           arr.push(obj);
155
+          TestExistStr.push(item.Word);
156
+        }
157
+        else if (that.data.List[i].List[j].Css === "Select2") {
158
+          var item = that.data.List[i].List[j];
159
+          TestExistStr.push(item.Word);
148 160
         }
149 161
       }
150 162
     }
@@ -163,6 +175,9 @@ Page({
163 175
         });
164 176
         if (buildCardNumber >= arr.length) {
165 177
           clearInterval(intervalBuild);
178
+          var TestTask={};
179
+          TestTask.TestExistStr=TestExistStr;
180
+          that.saveInfo(TestTask);
166 181
           that.setData({
167 182
             IsBuild: 2,
168 183
           });
@@ -192,16 +207,22 @@ Page({
192 207
       delta: delta,
193 208
     });
194 209
   },
195
-  saveInfo: function () {
210
+  saveInfo: function (TestTask) {
196 211
     var that = this;
197 212
     clearInterval(intervalBuild);
198 213
     var userid = app.globalData.userInfo.UserID;
199 214
     var param1 = wx.getStorageSync("TestTask");
200
-    param1.TestRight = this.data.NumberRight;
201
-    param1.TestWrong = this.data.NumberWrong;
202
-    param1.TestSkip = this.data.NumberSkip;
203 215
     param1.TestTotal = param1.List.length;
204
-    param1.List = JSON.stringify(param1.List);
216
+    if (TestTask.TestRightStr)
217
+      param1.TestRightStr=TestTask.TestRightStr.join("");
218
+    if (TestTask.TestWrongStr)
219
+      param1.TestWrongStr=TestTask.TestWrongStr.join("");
220
+    if (TestTask.TestSkipStr)
221
+      param1.TestSkipStr=TestTask.TestSkipStr.join("");
222
+    if (TestTask.TestExistStr)
223
+      param1.TestExistStr=TestTask.TestExistStr.join("");
224
+    //param1.List = JSON.stringify(param1.List);
225
+    delete param1.List;
205 226
     main.postData('InsertTestReport?UserID=' + userid, param1, function (data) {
206 227
       if (data)
207 228
         TestReportID = data;

Diferenças do arquivo suprimidas por serem muito extensas
+ 1550 - 0
utils/constant.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 62 - 1556
utils/main.js