chengjie 6 年之前
父节点
当前提交
3002b51feb
共有 6 个文件被更改,包括 1682 次插入1591 次删除
  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

文件差异内容过多而无法显示
+ 3 - 3
app.js


+ 27 - 20
pages/test/index.js

@@ -142,22 +142,22 @@ Page({
142
             Image: "../images/examine_subject_a009.png"
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
         //   Name: "英语常用词",
162
         //   Name: "英语常用词",
163
         //   Name2: "英语常用词",
163
         //   Name2: "英语常用词",
@@ -268,13 +268,20 @@ Page({
268
     var id = e.currentTarget.dataset.id;
268
     var id = e.currentTarget.dataset.id;
269
     var userid = app.globalData.userInfo.UserID;
269
     var userid = app.globalData.userInfo.UserID;
270
     //todo
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
         wx.setStorageSync("TestTask", data);
281
         wx.setStorageSync("TestTask", data);
274
         wx.navigateTo({
282
         wx.navigateTo({
275
-          url: "./report?type=edit&id="+id,
283
+          url: "./report?type=edit",
276
         });
284
         });
277
-      }
278
     });
285
     });
279
   },
286
   },
280
   onUnload: function () {
287
   onUnload: function () {

+ 11 - 4
pages/test/list.js

@@ -138,14 +138,21 @@ Page({
138
 
138
 
139
       if (id) {
139
       if (id) {
140
         var reporttype = e.currentTarget.dataset.type;
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
             that.onClose();
152
             that.onClose();
145
             wx.navigateTo({
153
             wx.navigateTo({
146
               url: "./item?type=" + reporttype,
154
               url: "./item?type=" + reporttype,
147
             });
155
             });
148
-          }
149
         });
156
         });
150
       } else {
157
       } else {
151
         that.onClose();
158
         that.onClose();

+ 29 - 8
pages/test/report.js

@@ -27,16 +27,23 @@ Page({
27
     var listRight = [];
27
     var listRight = [];
28
     var listSkip = [];
28
     var listSkip = [];
29
     var listWrong = [];
29
     var listWrong = [];
30
+    TestTask.TestRightStr=[];
31
+    TestTask.TestWrongStr=[];
32
+    TestTask.TestSkipStr=[];
33
+
30
     if (list) {
34
     if (list) {
31
       for (var i = 0; i < list.length; i++) {
35
       for (var i = 0; i < list.length; i++) {
32
         if (list[i].Result == 1) {
36
         if (list[i].Result == 1) {
33
           listRight.push(list[i]);
37
           listRight.push(list[i]);
38
+          TestTask.TestRightStr.push(list[i].Word);
34
         }
39
         }
35
         else if (list[i].Result == -1) {
40
         else if (list[i].Result == -1) {
36
           listWrong.push(list[i]);
41
           listWrong.push(list[i]);
42
+          TestTask.TestWrongStr.push(list[i].Word);
37
         }
43
         }
38
         else if (list[i].Result == 0) {
44
         else if (list[i].Result == 0) {
39
           listSkip.push(list[i]);
45
           listSkip.push(list[i]);
46
+          TestTask.TestSkipStr.push(list[i].Word);
40
         }
47
         }
41
       }
48
       }
42
 
49
 
@@ -78,9 +85,9 @@ Page({
78
         List: result,
85
         List: result,
79
         NumberTotal: list.length,
86
         NumberTotal: list.length,
80
       });
87
       });
81
-
88
+      
82
       if (that.data.ReportType=="new")
89
       if (that.data.ReportType=="new")
83
-        that.saveInfo();
90
+        that.saveInfo(TestTask);
84
 
91
 
85
       wx.setNavigationBarTitle({
92
       wx.setNavigationBarTitle({
86
         title: "报告"
93
         title: "报告"
@@ -130,7 +137,7 @@ Page({
130
   },
137
   },
131
   buildCard: function () {
138
   buildCard: function () {
132
     var that = this;
139
     var that = this;
133
-    var arr = [];
140
+    var arr = [],TestExistStr=[];
134
     for (var i = 0; i < that.data.List.length; i++) {
141
     for (var i = 0; i < that.data.List.length; i++) {
135
       for (var j = 0; j < that.data.List[i].List.length; j++) {
142
       for (var j = 0; j < that.data.List[i].List.length; j++) {
136
         if (that.data.List[i].List[j].Css === "Select") {
143
         if (that.data.List[i].List[j].Css === "Select") {
@@ -145,6 +152,11 @@ Page({
145
           obj.LimitTime = common.formatTime(new Date());
152
           obj.LimitTime = common.formatTime(new Date());
146
           obj.FontSize = item.FontSize;
153
           obj.FontSize = item.FontSize;
147
           arr.push(obj);
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
         if (buildCardNumber >= arr.length) {
176
         if (buildCardNumber >= arr.length) {
165
           clearInterval(intervalBuild);
177
           clearInterval(intervalBuild);
178
+          var TestTask={};
179
+          TestTask.TestExistStr=TestExistStr;
180
+          that.saveInfo(TestTask);
166
           that.setData({
181
           that.setData({
167
             IsBuild: 2,
182
             IsBuild: 2,
168
           });
183
           });
@@ -192,16 +207,22 @@ Page({
192
       delta: delta,
207
       delta: delta,
193
     });
208
     });
194
   },
209
   },
195
-  saveInfo: function () {
210
+  saveInfo: function (TestTask) {
196
     var that = this;
211
     var that = this;
197
     clearInterval(intervalBuild);
212
     clearInterval(intervalBuild);
198
     var userid = app.globalData.userInfo.UserID;
213
     var userid = app.globalData.userInfo.UserID;
199
     var param1 = wx.getStorageSync("TestTask");
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
     param1.TestTotal = param1.List.length;
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
     main.postData('InsertTestReport?UserID=' + userid, param1, function (data) {
226
     main.postData('InsertTestReport?UserID=' + userid, param1, function (data) {
206
       if (data)
227
       if (data)
207
         TestReportID = data;
228
         TestReportID = data;

文件差异内容过多而无法显示
+ 1550 - 0
utils/constant.js


文件差异内容过多而无法显示
+ 62 - 1556
utils/main.js