浏览代码

百度统计:统计交卷耗时

Michael Wang 5 年之前
父节点
当前提交
70ce30a4e5
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 9 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -635,6 +635,7 @@ export default {
       });
       });
     },
     },
     async realSubmitPaper(showConfirmTime = 0) {
     async realSubmitPaper(showConfirmTime = 0) {
+      this.__submitPaperStartTime = Date.now();
       this.$Spin.show({
       this.$Spin.show({
         render: () => {
         render: () => {
           return <div style="font-size: 44px">正在交卷,请耐心等待...</div>;
           return <div style="font-size: 44px">正在交卷,请耐心等待...</div>;
@@ -709,6 +710,14 @@ export default {
       }
       }
       this.submitLock = false;
       this.submitLock = false;
       this.$Spin.hide();
       this.$Spin.hide();
+      this.__submitPaperEndTime = Date.now();
+      window._hmt.push([
+        "_trackEvent",
+        "交卷耗时",
+        Math.floor(
+          (this.__submitPaperEndTime - this.__submitPaperStartTime) / 1000
+        ) + "秒",
+      ]);
     },
     },
     examQuestion() {
     examQuestion() {
       return (
       return (