YATAI_attentionCheck.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <template>
  2. <div>
  3. <!-- LOGO -->
  4. <div class="desc_wrap" v-show="!testResultStrShow">
  5. <div
  6. style="
  7. width: 70%;
  8. height: 100%;
  9. background: rgb(248, 248, 248);
  10. opacity: 1;
  11. border-radius: 12px;
  12. margin: 0 auto;
  13. "
  14. >
  15. <div class="left_part">
  16. <div id="left_top">
  17. <div>
  18. <div id="setting">
  19. <img src="../../assets/9551.png" alt="" />
  20. </div>
  21. <div id="text">
  22. <span>操作提示:</span>
  23. </div>
  24. </div>
  25. </div>
  26. <div style="margin: 100px auto; width: 80%; text-align: justify;text-justify: distribute-all-lines;">
  27. <p v-html="subjectInfo.testDescription"></p>
  28. <!-- <p>{{subjectInfo.description}}</p> -->
  29. </div>
  30. </div>
  31. <div
  32. class="right_part"
  33. :style="{
  34. background:
  35. 'url(' + require('../../assets/page' + taskId + '.png') + ')',
  36. 'background-size': '100% 100%',
  37. }"
  38. >
  39. <div id="title">
  40. <span>{{ subjectInfo.name }}</span>
  41. </div>
  42. <div style="position: absolute; bottom: 30px; right: 20%">
  43. <el-button type="primary" class="start" v-if="buttonShow" @click="startTest()">{{
  44. buttonName
  45. }}</el-button>
  46. <el-button type="primary" class="start" v-if="buttonShow" @click="walkBack()"
  47. >去玩儿其他游戏</el-button
  48. >
  49. <!-- <el-button type="primary" class="start" @click="startTest()">{{
  50. buttonName
  51. }}</el-button> -->
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div style="width: 650px; margin: 20px auto; line-height: 2">
  57. <!-- 20211126-cyh 为了不让学生们看到测试结果暂时注释 -->
  58. <!-- <p v-show="testResultStrShow" style="margin-top: 20%; font-size: 30px" class="txt-center">
  59. {{ testResultStr }}
  60. </p> -->
  61. <div v-show="testResultStrShow" class="txt-center">
  62. <p style="font-size: 16px; color: #666666; margin: 40px 0 10px">
  63. 本游戏结束,点击更多游戏按钮查看更多游戏
  64. </p>
  65. <el-button
  66. class="scaleButto"
  67. style="margin-top: 60px"
  68. type="primary"
  69. @click="moreGame"
  70. >更多游戏</el-button
  71. >
  72. </div>
  73. </div>
  74. <!-- <h1 class="txt-center">
  75. {{ subjectInfo.name }}
  76. </h1>
  77. <div style="width: 650px; margin: 20px auto; line-height: 2">
  78. <p
  79. style="text-align: left; text-indent: 2em"
  80. v-html="subjectInfo.testDescription"
  81. >
  82. </p>
  83. <div class="txt-center" v-show="testResultStr">
  84. <p style="font-size: 16px; color: #666666; margin: 40px 0 10px">
  85. 本游戏结束,点击更多游戏按钮查看更多游戏
  86. </p>
  87. <el-button
  88. class="scaleButto"
  89. style="margin-top: 60px"
  90. type="primary"
  91. @click="moreGame"
  92. >更多游戏</el-button
  93. >
  94. </div>
  95. </div> -->
  96. <!-- <div class="txt-center" v-show="testResultStr">
  97. <p style="font-size: 16px; color: #666666; margin: 40px 0 10px">
  98. 本游戏结束,点击更多游戏按钮查看更多游戏
  99. </p>
  100. <el-button
  101. class="scaleButto"
  102. style="margin-top: 60px"
  103. type="primary"
  104. @click="moreGame"
  105. >更多游戏</el-button
  106. >
  107. </div> -->
  108. <div
  109. class="txt-center"
  110. v-if="testFlag"
  111. :class="{ testMainDiv: !testFlag, activeTask: testFlag }"
  112. @click.left="userClick('L')"
  113. @click.right="userClick('R')"
  114. @contextmenu.prevent=""
  115. >
  116. <div
  117. :class="{ aa: testTypeCode !== 1 }"
  118. style="width: 50%; margin-left: 10%; margin-top: 24px"
  119. >
  120. <el-progress
  121. class="main_progress"
  122. :text-inside="true"
  123. :format="format"
  124. :stroke-width="24"
  125. :percentage="(count / 145) * 100"
  126. ></el-progress>
  127. </div>
  128. <img
  129. @click="screenState()"
  130. src="../../assets/small-big.png"
  131. alt=""
  132. style="
  133. height: 48px;
  134. width: 48px;
  135. position: fixed;
  136. top: 24px;
  137. right: 22px;
  138. cursor: pointer;
  139. "
  140. />
  141. <div class="glass">
  142. <div class="glassPad">
  143. <p v-show="countDownShow" class="countdownStr">
  144. {{ countDownStr }}
  145. </p>
  146. <p
  147. v-show="!countDownShow"
  148. style="
  149. font-size: 20px;
  150. text-align: center;
  151. margin-bottom: 40px;
  152. height: 50px;
  153. line-height: 50px;
  154. "
  155. v-html="pic3_0"
  156. ></p>
  157. <p
  158. v-show="pic3_1 !== '+' && !countDownShow"
  159. style="font-size: 30px; height: 50px; line-height: 50px"
  160. >
  161. </p>
  162. <p
  163. v-show="pic3_1 == '+' && !countDownShow"
  164. style="font-size: 30px; height: 50px; line-height: 50px"
  165. >
  166. <img
  167. src="../../assets/congnitiveAblitity/whiteFlag-new.png"
  168. alt=""
  169. style="width: 71px; height: 71px"
  170. />
  171. </p>
  172. <p
  173. v-show="!countDownShow"
  174. style="
  175. font-size: 20px;
  176. text-align: center;
  177. margin-top: 40px;
  178. height: 50px;
  179. line-height: 50px;
  180. "
  181. v-html="pic3_2"
  182. ></p>
  183. </div>
  184. <div
  185. class="correctRate"
  186. v-show="crIsShow && testTypeCode != 1"
  187. style="font-size: 22px; color: blue"
  188. >
  189. <p v-show="hasResponse && perIsTrue" style="color: blue">
  190. 正确率:{{ this.correctRate.toFixed(2) }}%,本次正确,反应时间:{{
  191. this.responseTime
  192. }}s
  193. </p>
  194. <p v-show="hasResponse && !perIsTrue" style="color: red">
  195. 正确率:{{ this.correctRate.toFixed(2) }}%,本次错误,反应时间:{{
  196. this.responseTime
  197. }}s
  198. </p>
  199. <p v-show="!hasResponse" style="color: red">
  200. 正确率:{{ this.correctRate.toFixed(2) }}%,{{ this.responseTime }}
  201. </p>
  202. </div>
  203. </div>
  204. </div>
  205. <!-- <div style="text-align: center">
  206. <el-button
  207. class="scaleButton"
  208. type="primary"
  209. v-if="buttonShow"
  210. @click="startTest()"
  211. >{{ buttonName }}</el-button
  212. >
  213. <el-button
  214. class="scaleButton"
  215. type="primary"
  216. v-if="buttonShow"
  217. @click="walkBack()"
  218. >去玩儿其他游戏</el-button
  219. >
  220. </div> -->
  221. </div>
  222. </template>
  223. <script>
  224. import { arrowList } from "@/assets/data/attentionCheckData.js";
  225. import { oSessionStorage } from "../../utils/utils";
  226. import screenfull from "screenfull";
  227. export default {
  228. data() {
  229. return {
  230. userId: "",
  231. userTestResult: {},
  232. imgUrl: "",
  233. taskId: "", // 认知任务id
  234. subjectInfo: "", //认知任务详情
  235. buttonShow: true, // 控制按钮显示吟唱
  236. buttonName: "试玩一下", // 正式测试 // 重新练习
  237. testTypeCode: 0, // 0-练习测试 1-正式测试 2-重新测试
  238. testState: false, // 每个图片的测试状态,false表示测试结束、不在测试,true表示正在测试
  239. testFlag: false, // false表示未开始测试,true表示开始测试
  240. testResultStr: "", // 测试结果
  241. testResultStrShow: false, //测试结果展示
  242. currentAnswer: "", // 当前图片对应的是左键还是右键
  243. currentType: "", // 当前展示的类型,0,1,2,3,4(上、下、中、上下,无提示)
  244. numTrue: 0, // 点击正确的个数
  245. numAll: 0, // 全部点击次数
  246. isEnd: false, // 每一轮的测试(如测试练习阶段)是否结束
  247. startT: 0, // 开始显示图片的时间
  248. endT: 0, // 点击鼠标的时间
  249. st: 0, // 每轮测试开始的时间
  250. et: 0, // 当前时间
  251. // ft-ptimer4为定时器
  252. ft: null,
  253. ft1: null,
  254. ft2: null,
  255. ft3: null,
  256. ft4: null,
  257. ptimer: null,
  258. ptimer1: null,
  259. ptimer2: null,
  260. ptimer3: null,
  261. ptimer4: null,
  262. practiceTime: 120000, // 测试练习阶段的总时间,单位ms,2分钟
  263. formalTime: 300000, // 正式练习的时间,每轮5分钟,共2轮
  264. timePlus: 100, // 显示+号的时间
  265. timeCue: 150, // 显示*号提示的时间,标志版
  266. timeCueQuick: 50, // 显示*号提示的时间,快速版
  267. timeArrow: 1150, // 显示箭头的最长时间
  268. timeResult: 1000, // 测试练习时显示结果的时间
  269. correctRate: 0, // 正确率
  270. responseTime: 0, // 反应时间
  271. hasResponse: true, // 是否有反应
  272. perIsTrue: false, // 本次点击是否正确
  273. crIsShow: false, // 正确率和反应时间是否显示
  274. restTime: 10000, // 正式测试时每个阶段之间的休息时间
  275. phase: 0, // 正式测试的第几轮,共有3轮,每轮5分钟
  276. rnum: 0, // 标志提示的类型
  277. pic3_0: "", // 垂直显示的3张图片的第1张
  278. pic3_1: "", // 垂直显示的3张图片的第2张
  279. pic3_2: "", // 垂直显示的3张图片的第3张
  280. arrPos: 0, // 数组下标
  281. arr: null, // 随机排序后的数组
  282. CONSTANT_24: 12,
  283. CONSTANT_48: 48,
  284. pcount: 0, // 练习测试的次数
  285. fcount: 0, // 正式测试的次数
  286. count: 1,
  287. countDownTime: 0, //开始前的倒计时
  288. countDownStr: "试玩一下!",
  289. countDownShow: false,
  290. result: {
  291. userId: 0,
  292. rightRate: 0,
  293. totalResponseTime: 0,
  294. data: [],
  295. result: {},
  296. }, // 存放正式测试的结果
  297. d: {
  298. index: null,
  299. type: null,
  300. currentDir: null,
  301. userClickDir: null,
  302. consistency: -1,
  303. responseTime: 0,
  304. }, // 存放每次操作的结果(正式测试阶段)
  305. totalResponseTime: 0, // 总反应时间
  306. };
  307. },
  308. // 页面初始化函数
  309. created() {
  310. this.taskId = this.$route.query.taskId;
  311. this.init();
  312. },
  313. mounted() {
  314. var that = this;
  315. // screenfull.toggle();
  316. document.onkeydown = function (e) {
  317. let key = window.event.keyCode;
  318. if (key === 122) {
  319. e.preventDefault();
  320. screenfull.toggle();
  321. }
  322. };
  323. },
  324. methods: {
  325. screenState() {
  326. if (screenfull.isFullscreen) {
  327. //处于全屏状态
  328. screenfull.exit();
  329. //处于全屏状态则取消全屏状态
  330. } else {
  331. //不处于全屏状态
  332. screenfull.toggle();
  333. //不处于全屏状态则进入全屏状态
  334. }
  335. },
  336. // 初始化
  337. init() {
  338. this.subjectInfo = JSON.parse(oSessionStorage.getItem("subjectInfo"));
  339. },
  340. // 用户点击鼠标左键和右键
  341. userClick(clickFlag) {
  342. if (!this.testState || this.isEnd) {
  343. return;
  344. }
  345. this.perIsTrue = false;
  346. // 点击左键
  347. if (clickFlag === "L") {
  348. if (this.currentAnswer === "L") {
  349. this.numTrue++;
  350. this.d.index = this.numAll;
  351. this.d.type = this.currentType;
  352. this.d.currentDir = "L";
  353. this.d.userClickDir = "L";
  354. this.perIsTrue = true;
  355. } else {
  356. this.d.index = this.numAll;
  357. this.d.type = this.currentType;
  358. this.d.currentDir = "R";
  359. this.d.userClickDir = "L";
  360. }
  361. this.clickMouseLater();
  362. }
  363. // 点击右键
  364. else if (clickFlag === "R") {
  365. if (this.currentAnswer === "R") {
  366. this.numTrue++;
  367. this.d.index = this.numAll;
  368. this.d.type = this.currentType;
  369. this.d.currentDir = "R";
  370. this.d.userClickDir = "R";
  371. this.perIsTrue = true;
  372. } else {
  373. this.d.index = this.numAll;
  374. this.d.type = this.currentType;
  375. this.d.currentDir = "L";
  376. this.d.userClickDir = "R";
  377. }
  378. this.clickMouseLater();
  379. }
  380. },
  381. // 每次鼠标点完的操作
  382. format(percentage) {
  383. return percentage == 100 ? "游戏已完成" : "游戏进度";
  384. },
  385. clickMouseLater() {
  386. this.endT = new Date().getTime();
  387. this.correctRate = (this.numTrue / this.numAll).toFixed(2) * 100;
  388. this.responseTime = (this.endT - this.startT) / 1000;
  389. this.d.responseTime = this.endT - this.startT;
  390. this.totalResponseTime += this.endT - this.startT;
  391. this.hasResponse = true;
  392. clearTimeout(this.ptimer1);
  393. clearTimeout(this.ptimer2);
  394. clearTimeout(this.ptimer3);
  395. this.testState = false;
  396. this.rnum = 0;
  397. this.startT = 0;
  398. this.endT = 0;
  399. if (this.testTypeCode === 0 || this.testTypeCode === 2) {
  400. this.pcount--;
  401. this.pic3_0 = "&#160";
  402. this.pic3_1 = "+";
  403. this.pic3_2 = "&#160";
  404. // 如果是练习测试阶段,则显示每次操作的结果
  405. this.crIsShow = true;
  406. this.ptimer4 = setTimeout(() => {
  407. this.crIsShow = false;
  408. this.handlePerPic(
  409. this.timePlus,
  410. this.timeCue,
  411. this.timeCueQuick,
  412. this.timeArrow,
  413. this.practiceTime
  414. );
  415. }, this.timeResult);
  416. return;
  417. } else {
  418. // 正式练习阶段
  419. this.fcount--;
  420. if (this.testTypeCode == 1) {
  421. this.count++;
  422. }
  423. console.log("count:" + this.count);
  424. this.result.data.push(this.d);
  425. this.d = {
  426. index: null,
  427. type: null,
  428. currentDir: null,
  429. userClickDir: null,
  430. responseTime: 0,
  431. };
  432. this.pic3_0 = "&#160";
  433. this.pic3_1 = "+";
  434. this.pic3_2 = "&#160";
  435. // 400ms到1600ms
  436. var randomtime = Math.random() * (1600 - 400 + 1) + 400;
  437. this.ptimer4 = setTimeout(() => {
  438. this.handlePerPic(
  439. this.timePlus,
  440. this.timeCue,
  441. this.timeCueQuick,
  442. this.timeArrow,
  443. this.formalTime
  444. );
  445. clearTimeout(this.ptimer4);
  446. }, randomtime);
  447. }
  448. },
  449. screen() {
  450. screenfull.request();
  451. },
  452. screenExit() {
  453. screenfull.exit();
  454. },
  455. // 开始测试
  456. startTest() {
  457. if (
  458. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == "" ||
  459. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == null
  460. ) {
  461. this.$message.error("请先登录!");
  462. return;
  463. }
  464. this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  465. // 开始测试
  466. this.testFlag = true;
  467. this.isEnd = false;
  468. this.pcount = this.CONSTANT_24;
  469. this.fcount = this.CONSTANT_48;
  470. // 如果是测试练习或重新测试
  471. if (this.testTypeCode === 0 || this.testTypeCode === 2) {
  472. this.arrPos = 0;
  473. this.arr = this.shuffle(arrowList);
  474. this.handlePractisePhase();
  475. }
  476. // 如果是正式测试
  477. else if (this.testTypeCode === 1) {
  478. this.numTrue = 0;
  479. this.numAll = 0;
  480. this.arrPos = 0;
  481. this.arr = this.shuffle(arrowList);
  482. //开始正式测试
  483. this.handleFormalPhase();
  484. }
  485. },
  486. // 练习测试的处理
  487. handlePractisePhase() {
  488. this.st = new Date().getTime();
  489. this.screen();
  490. // 本轮测试共pcount次
  491. this.handlePerPic(
  492. this.timePlus,
  493. this.timeCue,
  494. this.timeCueQuick,
  495. this.timeArrow,
  496. this.practiceTime
  497. );
  498. },
  499. // 正式测试的处理,phase(int型)表示第几阶段
  500. handleFormalPhase() {
  501. //console.log("类型:", this.testTypeCode, "rest:", this.restTime);
  502. // console.log("开始第1轮测试.");
  503. this.st = new Date().getTime();
  504. this.screen();
  505. this.handlePerPic(
  506. this.timePlus,
  507. this.timeCue,
  508. this.timeCueQuick,
  509. this.timeArrow,
  510. this.formalTime
  511. );
  512. },
  513. // 每个箭头图片的处理,timePlus:+号的显示时间;timeCue:*号正常的提示时间;timeCueQuick: *号快速的提示时间
  514. // timeArrow:箭头的提示时间;timePhase为每一阶段测试的总时间
  515. // 默认:timePlus:0.5s timeCue:1s timeCueQuick:0.5 timeArrow:1s 每个周期总时间为3s
  516. handlePerPic(timePlus, timeCue, timeCueQuick, timeArrow, timePhase) {
  517. this.et = new Date().getTime();
  518. //console.log(this.numAll + 1, ':', (this.et - this.st) / 1000);
  519. // 练习测试
  520. //当刚进来的时候是阶段是0
  521. //打开然后阶段加1
  522. //倒计时5秒然后再重新调用该方法
  523. if (this.phase === 0) {
  524. this.phase += 1;
  525. this.countDownShow = true;
  526. this.countDownTime = 6;
  527. let myInterval = setInterval(() => {
  528. this.countDownTime--;
  529. this.countDownStr = this.countDownTime;
  530. if (this.countDownTime == 0) {
  531. this.countDownShow = false;
  532. //console.log("开始第2轮测试.");
  533. this.arrPos = 0;
  534. this.arr = this.shuffle(arrowList);
  535. this.fcount = this.CONSTANT_48;
  536. //this.countDown();
  537. this.st = new Date().getTime();
  538. this.handlePerPic(
  539. this.timePlus,
  540. this.timeCue,
  541. this.timeCueQuick,
  542. this.timeArrow,
  543. this.formalTime
  544. );
  545. clearInterval(myInterval);
  546. this.countDownTime = this.restTime / 1000;
  547. }
  548. }, 1000);
  549. return;
  550. //倒计时5秒
  551. }
  552. // 练习测试
  553. if (
  554. this.pcount == 0 &&
  555. (this.testTypeCode === 0 || this.testTypeCode === 2)
  556. ) {
  557. this.phase = 0;
  558. // 如果这是最后一轮,则直接结束
  559. //console.log("结束练习测试.");
  560. this.isEnd = true;
  561. this.pic3_0 = "&#160";
  562. this.pic3_1 = "&#160";
  563. this.pic3_2 = "&#160";
  564. this.practiseEndHandle();
  565. clearTimeout(this.ptimer1);
  566. clearTimeout(this.ptimer2);
  567. clearTimeout(this.ptimer3);
  568. return;
  569. }
  570. // 正式测试
  571. if (this.fcount == 0 && this.testTypeCode === 1) {
  572. // 新一轮的开始时间
  573. // this.st = new Date().getTime();
  574. //console.log("结束第", this.phase, "轮测试.");
  575. this.countDownShow = true;
  576. // this.countDownStr = "第" + this.phase + "轮已结束!";
  577. this.countDownStr = "休息一下";
  578. this.pic3_0 = "&#160";
  579. this.pic3_1 = "&#160";
  580. this.pic3_2 = "&#160";
  581. clearTimeout(this.ptimer1);
  582. clearTimeout(this.ptimer2);
  583. clearTimeout(this.ptimer3);
  584. this.phase++;
  585. // 开始正式阶段的第二轮测试
  586. if (this.phase === 2) {
  587. // 显示倒计时
  588. //console.log("开始第2轮测试倒计时");
  589. this.countDownShow = true;
  590. this.countDownTime = this.restTime / 1000;
  591. let myInterval = setInterval(() => {
  592. this.countDownTime--;
  593. this.countDownStr = this.countDownTime;
  594. if (this.countDownTime == 0) {
  595. this.countDownShow = false;
  596. //console.log("开始第2轮测试.");
  597. this.arrPos = 0;
  598. this.arr = this.shuffle(arrowList);
  599. this.fcount = this.CONSTANT_48;
  600. //this.countDown();
  601. this.st = new Date().getTime();
  602. this.handlePerPic(
  603. this.timePlus,
  604. this.timeCue,
  605. this.timeCueQuick,
  606. this.timeArrow,
  607. this.formalTime
  608. );
  609. clearInterval(myInterval);
  610. this.countDownTime = this.restTime / 1000;
  611. }
  612. }, 1000);
  613. return;
  614. } else if (this.phase == 3) {
  615. // 显示倒计时
  616. //console.log("开始第3轮测试倒计时");
  617. this.countDownShow = true;
  618. this.countDownTime = this.restTime / 1000;
  619. let myInterval = setInterval(() => {
  620. this.countDownTime--;
  621. this.countDownStr = this.countDownTime;
  622. if (this.countDownTime == 0) {
  623. this.countDownShow = false;
  624. //console.log("开始第3轮测试.");
  625. this.arrPos = 0;
  626. this.arr = this.shuffle(arrowList);
  627. this.fcount = this.CONSTANT_48;
  628. this.st = new Date().getTime();
  629. this.handlePerPic(
  630. this.timePlus,
  631. this.timeCue,
  632. this.timeCueQuick,
  633. this.timeArrow,
  634. this.formalTime
  635. );
  636. clearInterval(myInterval);
  637. this.countDownTime = this.restTime / 1000;
  638. }
  639. }, 1000);
  640. return;
  641. } else if (this.phase === 4) {
  642. //console.log("sucessfully end.");
  643. // 正式测试结束
  644. this.isEnd = true;
  645. this.testFlag = false;
  646. this.testState = false;
  647. // this.$router.go(-1);
  648. //this.picList = [];
  649. this.correctRate = (this.numTrue / this.numAll).toFixed(2) * 100;
  650. //console.log("data:"+this.result.data)
  651. var resData = this.computeData(this.result.data);
  652. this.result.result = resData;
  653. this.testResultStr =
  654. "总正确率:" +
  655. this.correctRate +
  656. "%, 总次数: " +
  657. this.numAll +
  658. ", 正确次数: " +
  659. this.numTrue;
  660. this.numAll = 0;
  661. this.numTrue = 0;
  662. this.buttonShow = false;
  663. this.result.userId = this.userId;
  664. this.result.rightRate = this.correctRate;
  665. //this.result.totalResponseTime = this.totalResponseTime;
  666. this.result.totalResponseTime = this.result.result.responseTimeAll;
  667. this.result.testPlanId = this.$route.query.testPlanId || "";
  668. //console.log("res: ", this.result);
  669. // 将结果传给服务器
  670. // //20211126-cyh
  671. //为了不让学生们看到测试结果暂时注释
  672. //
  673. this.testResultStrShow = true;
  674. this.$http.post(
  675. `cognize/ANT_YATAI`,
  676. this.result,
  677. (response) => {
  678. if (response.code == 200) {
  679. this.$message({
  680. message: "游戏结束!",
  681. type: "success",
  682. });
  683. } else {
  684. this.$message({
  685. message: "哇哦,服务器开小差了!",
  686. type: "error",
  687. });
  688. }
  689. this.subjectInfo.testDescription = "";
  690. }
  691. );
  692. //
  693. //
  694. return;
  695. }
  696. this.fcount = 4;
  697. }
  698. // 每一个阶段测试的图片的次数加1
  699. this.numAll++;
  700. // 设置当前箭头为白色
  701. // 屏幕中先显示+号
  702. this.pic3_0 = "&#160";
  703. this.pic3_1 = "+";
  704. this.pic3_2 = "&#160";
  705. // 随机产生提示(1-4之间)
  706. // 1*出现表示上方,2表示下方,3表示中央,4表示上下都出现,5表示不出现
  707. this.rnum = parseInt(Math.random() * (5 - 1 + 1) + 1);
  708. // [0, 47]
  709. //let arrowIndex = parseInt(Math.random() * (47 - 0 + 1) + 0);
  710. let arrowIndex = this.arr[this.arrPos].id;
  711. this.arrPos++;
  712. this.currentConsistency = arrowList[arrowIndex].consistency;
  713. this.d.consistency = arrowList[arrowIndex].consistency;
  714. if (arrowIndex >= 0 && arrowIndex <= 11) {
  715. // 没有*出现
  716. timePlus = 0;
  717. this.currentType = 4;
  718. } else {
  719. // timePlus时间后显示*
  720. this.ptimer1 = setTimeout(() => {
  721. // 设置提示
  722. if (arrowList[arrowIndex].cue == "up") {
  723. // 上方
  724. this.pic3_0 = "✱";
  725. this.pic3_1 = "+";
  726. this.pic3_2 = "&#160";
  727. this.currentType = 0;
  728. } else if (arrowList[arrowIndex].cue == "down") {
  729. // 下方
  730. this.pic3_0 = "&#160";
  731. this.pic3_1 = "+";
  732. this.pic3_2 = "✱";
  733. this.currentType = 1;
  734. } else if (arrowList[arrowIndex].cue == "center") {
  735. // 中央
  736. this.pic3_0 = "&#160";
  737. this.pic3_1 = "✱";
  738. this.pic3_2 = "&#160";
  739. this.currentType = 2;
  740. } else if (arrowList[arrowIndex].cue == "double") {
  741. // 上下方
  742. this.pic3_0 = "✱";
  743. this.pic3_1 = "+";
  744. this.pic3_2 = "✱";
  745. this.currentType = 3;
  746. }
  747. clearTimeout(this.ptimer1);
  748. }, timePlus);
  749. }
  750. // 提示出现的时间
  751. let _timeCue = timeCue;
  752. let _px = setTimeout(() => {
  753. // *显示完后400ms不显示东西
  754. this.pic3_0 = "&#160";
  755. this.pic3_1 = "+";
  756. this.pic3_2 = "&#160";
  757. }, timePlus + _timeCue);
  758. // 设置箭头,如果rnum=3或4则提示之后马上(0.05s后)显示箭头
  759. // if (this.rnum === 3 || this.rnum === 4) {
  760. // _timeCue = 50;
  761. // }
  762. // timePlus + timeCue + 400ms后显示箭头
  763. this.ptimer2 = setTimeout(() => {
  764. // 设置箭头
  765. if (arrowList[arrowIndex].position == "up") {
  766. // 上方
  767. this.pic3_0 = `<span style='font-size:40px;'>${arrowList[arrowIndex].arrow}</span>`;
  768. this.pic3_1 = "+";
  769. this.pic3_2 = "&#160";
  770. } else if (arrowList[arrowIndex].position == "down") {
  771. // 下方
  772. this.pic3_0 = "&#160";
  773. this.pic3_1 = "+";
  774. this.pic3_2 = `<span style='font-size:40px;'>${arrowList[arrowIndex].arrow}</span>`;
  775. }
  776. this.currentAnswer = arrowList[arrowIndex].answer;
  777. // 正在测试
  778. this.testState = true;
  779. this.startT = new Date().getTime();
  780. clearTimeout(this.ptimer2);
  781. }, timePlus + _timeCue + 400);
  782. // 在[timePlus+timeCue,timePlus+timeCue+timeArrow]之间如果没反应,则判错
  783. this.ptimer3 = setTimeout(() => {
  784. if (this.testState == true) {
  785. // 清除定时器
  786. clearTimeout(this.ptimer1);
  787. clearTimeout(this.ptimer2);
  788. clearTimeout(this.ptimer3);
  789. this.testState = false;
  790. this.rnum = 0;
  791. this.startT = 0;
  792. this.endT = 0;
  793. // 显示提示
  794. this.correctRate = (this.numTrue / this.numAll).toFixed(2) * 100;
  795. this.responseTime = "没有反应!";
  796. this.hasResponse = false;
  797. this.fcount--;
  798. if (this.testTypeCode == 1) {
  799. this.count++;
  800. }
  801. if (this.testTypeCode === 0 || this.testTypeCode === 2) {
  802. this.pic3_0 = "&#160";
  803. this.pic3_1 = "+";
  804. this.pic3_2 = "&#160";
  805. // 如果是练习测试阶段,则显示提示
  806. this.pcount--;
  807. this.crIsShow = true;
  808. this.ptimer4 = setTimeout(() => {
  809. this.crIsShow = false;
  810. this.handlePerPic(
  811. timePlus,
  812. timeCue,
  813. timeCueQuick,
  814. timeArrow,
  815. timePhase
  816. );
  817. clearTimeout(this.ptimer4);
  818. }, this.timeResult);
  819. return;
  820. }
  821. // 400ms到1600ms
  822. this.d.index = this.numAll;
  823. this.d.type = this.currentType;
  824. this.d.currentDir = this.currentAnswer;
  825. this.d.userClickDir = "";
  826. this.d.responseTime = this.timeArrow;
  827. this.totalResponseTime += this.timeArrow;
  828. //console.log("thisd:")
  829. //console.log(this.d)
  830. this.result.data.push(this.d);
  831. this.d = {
  832. index: null,
  833. type: null,
  834. currentDir: null,
  835. userClickDir: null,
  836. responseTime: 0,
  837. };
  838. var randomtime = Math.random() * (1600 - 400 + 1) + 400;
  839. this.ptimer4 = setTimeout(() => {
  840. this.handlePerPic(
  841. this.timePlus,
  842. this.timeCue,
  843. this.timeCueQuick,
  844. this.timeArrow,
  845. timePhase
  846. );
  847. clearTimeout(this.ptimer4);
  848. }, randomtime);
  849. }
  850. }, timePlus + _timeCue + timeArrow + 400);
  851. },
  852. countDown() {
  853. // 测试时间倒计时
  854. let myInterval = setInterval(() => {
  855. this.countDownTime--;
  856. this.countDownStr = this.countDownTime;
  857. if (this.countDownTime == 0) {
  858. this.countDownShow = false;
  859. //计算测试结果
  860. this.showTargetNow();
  861. // 清除定时器
  862. clearInterval(myInterval);
  863. this.countDownTime = 5;
  864. }
  865. }, 1000);
  866. },
  867. practiseEndHandle() {
  868. this.screenState();
  869. this.isEnd = true;
  870. this.testFlag = false;
  871. this.testState = false;
  872. this.correctRate = (this.numTrue / this.numAll).toFixed(2) * 100;
  873. //20211126-cyh
  874. //为了不让学生们看到测试结果暂时注释
  875. // this.testResultStr =
  876. // "最后测试结果:" +
  877. // this.correctRate +
  878. // "%, 总次数: " +
  879. // this.numAll +
  880. // ", 正确次数: " +
  881. // this.numTrue;
  882. if (this.correctRate < 45) {
  883. this.countDownStr = "试玩一下!";
  884. this.buttonName = "再试一下";
  885. this.numTrue = 0;
  886. this.numAll = 0;
  887. this.pcount = this.CONSTANT_24;
  888. this.$message({
  889. message: "没有通过练习游戏哦,加油!",
  890. type: "warning",
  891. });
  892. this.screenExit();
  893. this.testTypeCode = 2;
  894. } else {
  895. this.countDownStr = "马上开始!";
  896. this.buttonName = "开始游戏";
  897. this.testTypeCode = 1;
  898. this.$message({
  899. message: "试玩通过!开始游戏",
  900. type: "success",
  901. });
  902. this.screenExit();
  903. }
  904. },
  905. walkBack() {
  906. this.$router.push({ path: "/welcome/CognitiveAbility" });
  907. },
  908. // 实现数组随机排序
  909. shuffle(arr) {
  910. var len = arr.length;
  911. for (var i = 0; i < len; i++) {
  912. var a = parseInt(Math.random() * len);
  913. var temp = arr[a];
  914. arr[a] = arr[i];
  915. arr[i] = temp;
  916. }
  917. return arr;
  918. },
  919. // 计算正式测试的结果
  920. computeData(data) {
  921. //data = this.result.data;
  922. //命中次数:总命中次数、不同实验(一致性、不一致性)和不同线索下的命中次数
  923. // var hitsAll = 0;
  924. // var hitscongruent = 0;
  925. // var hitsincongruent = 0;
  926. // var hitsNoCue = 0;
  927. // var hitsNeutralCue = 0;
  928. // var hitsSpatialCue = 0;
  929. // var inhitscongruent = 0;
  930. // var inhitsincongruent = 0;
  931. // var inhitsNoCue = 0;
  932. // var inhitsNeutralCue = 0;
  933. // var inhitsSpatialCue = 0;
  934. // for (let i = 0; i < data.length; i++) {
  935. // if (data[i].currentDir === data[i].userClickDir) {
  936. // hitsAll++;
  937. // if (data[i].consistency === 1) {
  938. // hitscongruent++;
  939. // } else if (data[i].consistency === 0) {
  940. // hitsincongruent++;
  941. // }
  942. // if (data[i].type === 4) {
  943. // hitsNoCue++;
  944. // } else if (data[i].type === 2 || data[i].type === 3) {
  945. // hitsNeutralCue++;
  946. // } else if (data[i].type === 0 || data[i].type === 1) {
  947. // hitsSpatialCue++;
  948. // }
  949. // } else {
  950. // // 没有命中
  951. // if (data[i].consistency === 1) {
  952. // inhitscongruent++;
  953. // } else if (data[i].consistency === 0) {
  954. // inhitsincongruent++;
  955. // }
  956. // if (data[i].type === 4) {
  957. // inhitsNoCue++;
  958. // } else if (data[i].type === 2 || data[i].type === 3) {
  959. // inhitsNeutralCue++;
  960. // } else if (data[i].type === 0 || data[i].type === 1) {
  961. // inhitsSpatialCue++;
  962. // }
  963. // }
  964. // }
  965. // //命中率:全部命中率:正确点击次数/全部点击次数
  966. // var hitRate = hitsAll / 144;
  967. // //命中率:不同实验(一致性、不一致性)和不同线索下的命中率
  968. // var congruentHitRate = hitscongruent / (hitscongruent + inhitscongruent);
  969. // var incongruentHitRate =
  970. // hitsincongruent / (hitsincongruent + inhitsincongruent);
  971. // var noCueHitRate = hitsNoCue / (inhitsNoCue + hitsNoCue);
  972. // var neutralCueHitRate =
  973. // hitsNeutralCue / (inhitsNeutralCue + hitsNeutralCue);
  974. // var spatialCueHitRate =
  975. // hitsSpatialCue / (inhitsSpatialCue + hitsSpatialCue);
  976. // //RT:反应时
  977. // var responseTimeAll = 0;
  978. // //反应时以及不同实验(一致性、不一致性)和不同线索下的平均反应时
  979. // var responseTimeCongruent = 0;
  980. // var responseTimeIncongruent = 0;
  981. // var responseTimeNoCue = 0;
  982. // var responseTimeNeutralCue = 0;
  983. // var responseTimeSpatialCue = 0;
  984. // for (let i = 0; i < data.length; i++) {
  985. // responseTimeAll += data[i].responseTime;
  986. // if (data[i].consistency === 1) {
  987. // responseTimeCongruent += data[i].responseTime;
  988. // } else if (data[i].consistency === 0) {
  989. // responseTimeIncongruent += data[i].responseTime;
  990. // }
  991. // if (data[i].type === 4) {
  992. // responseTimeNoCue += data[i].responseTime;
  993. // } else if (data[i].type === 2 || data[i].type === 3) {
  994. // responseTimeNeutralCue += data[i].responseTime;
  995. // } else if (data[i].type === 0 || data[i].type === 1) {
  996. // responseTimeSpatialCue += data[i].responseTime;
  997. // }
  998. // }
  999. // var avgresponseTimeCongruent =
  1000. // responseTimeCongruent / (hitscongruent + inhitscongruent);
  1001. // var avgresponseTimeIncongruent =
  1002. // responseTimeIncongruent / (hitsincongruent + inhitscongruent);
  1003. // var avgresponseTimeNoCue = responseTimeNoCue / (inhitsNoCue + hitsNoCue);
  1004. // var avgresponseTimeNeutralCue =
  1005. // responseTimeNeutralCue / (inhitsNeutralCue + hitsNeutralCue);
  1006. // var avgresponseTimeSpatialCue =
  1007. // responseTimeSpatialCue / (inhitsSpatialCue + hitsSpatialCue);
  1008. // //警报分数(无刺激条件试验的反应时减去中性试验的反应时)
  1009. // var warnScore = responseTimeNoCue - responseTimeNeutralCue;
  1010. // //定向分数(中性试验的反应时减去空间条件下的反应时)
  1011. // var directionScore = responseTimeNeutralCue - responseTimeSpatialCue;
  1012. // //冲突分数(不一致试验的反应时减去一致试验的反应时)
  1013. // var conflictScore = responseTimeIncongruent - responseTimeCongruent;
  1014. //命中次数:总命中次数、不同实验(一致性、不一致性)和不同线索下的命中次数
  1015. var hitsAll = 0;
  1016. var hitscongruent = 0;
  1017. var hitsincongruent = 0;
  1018. var hitsNoCue = 0;
  1019. var hitsNeutralCue = 0;
  1020. var hitsSpatialCue = 0;
  1021. var inhitscongruent = 0;
  1022. var inhitsincongruent = 0;
  1023. var inhitsNoCue = 0;
  1024. var inhitsNeutralCue = 0;
  1025. var inhitsSpatialCue = 0;
  1026. for (let i = 0; i < data.length; i++) {
  1027. if (data[i].currentDir === data[i].userClickDir) {
  1028. hitsAll++;
  1029. if (data[i].consistency === 1) {
  1030. hitscongruent++;
  1031. } else if (data[i].consistency === 0) {
  1032. hitsincongruent++;
  1033. }
  1034. if (data[i].type === 3) {
  1035. hitsNoCue++;
  1036. } else if (data[i].type === 2) {
  1037. hitsNeutralCue++;
  1038. } else if (data[i].type === 0 || data[i].type === 1) {
  1039. hitsSpatialCue++;
  1040. }
  1041. } else {
  1042. // 没有命中
  1043. if (data[i].consistency === 1) {
  1044. inhitscongruent++;
  1045. } else if (data[i].consistency === 0) {
  1046. inhitsincongruent++;
  1047. }
  1048. if (data[i].type === 3) {
  1049. inhitsNoCue++;
  1050. } else if (data[i].type === 2) {
  1051. inhitsNeutralCue++;
  1052. } else if (data[i].type === 0 || data[i].type === 1) {
  1053. inhitsSpatialCue++;
  1054. }
  1055. }
  1056. }
  1057. //命中率:全部命中率:正确点击次数/全部点击次数
  1058. var hitRate = (hitsAll / 144).toFixed(2);
  1059. //命中率:不同实验(一致性、不一致性)和不同线索下的命中率
  1060. var congruentHitRate = (
  1061. hitscongruent /
  1062. (hitscongruent + inhitscongruent)
  1063. ).toFixed(2);
  1064. var incongruentHitRate = (
  1065. hitsincongruent /
  1066. (hitsincongruent + inhitsincongruent)
  1067. ).toFixed(2);
  1068. var noCueHitRate = (hitsNoCue / (inhitsNoCue + hitsNoCue)).toFixed(2);
  1069. var neutralCueHitRate = (
  1070. hitsNeutralCue /
  1071. (inhitsNeutralCue + hitsNeutralCue)
  1072. ).toFixed(2);
  1073. var spatialCueHitRate = (
  1074. hitsSpatialCue /
  1075. (inhitsSpatialCue + hitsSpatialCue)
  1076. ).toFixed(2);
  1077. //RT:反应时
  1078. var responseTimeAll = 0;
  1079. //反应时以及不同实验(一致性、不一致性)和不同线索下的平均反应时
  1080. var responseTimeCongruent = 0;
  1081. var responseTimeIncongruent = 0;
  1082. var responseTimeNoCue = 0;
  1083. var responseTimeNeutralCue = 0;
  1084. var responseTimeSpatialCue = 0;
  1085. for (let i = 0; i < data.length; i++) {
  1086. responseTimeAll += data[i].responseTime;
  1087. if (data[i].consistency === 1) {
  1088. responseTimeCongruent += data[i].responseTime;
  1089. } else if (data[i].consistency === 0) {
  1090. responseTimeIncongruent += data[i].responseTime;
  1091. }
  1092. if (data[i].type === 3) {
  1093. responseTimeNoCue += data[i].responseTime;
  1094. } else if (data[i].type === 2) {
  1095. responseTimeNeutralCue += data[i].responseTime;
  1096. } else if (data[i].type === 0 || data[i].type === 1) {
  1097. responseTimeSpatialCue += data[i].responseTime;
  1098. }
  1099. }
  1100. var avgresponseTimeCongruent = (
  1101. responseTimeCongruent /
  1102. (hitscongruent + inhitscongruent)
  1103. ).toFixed(2);
  1104. var avgresponseTimeIncongruent = (
  1105. responseTimeIncongruent /
  1106. (hitsincongruent + inhitscongruent)
  1107. ).toFixed(2);
  1108. var avgresponseTimeNoCue = (
  1109. responseTimeNoCue /
  1110. (inhitsNoCue + hitsNoCue)
  1111. ).toFixed(2);
  1112. var avgresponseTimeNeutralCue = (
  1113. responseTimeNeutralCue /
  1114. (inhitsNeutralCue + hitsNeutralCue)
  1115. ).toFixed(2);
  1116. var avgresponseTimeSpatialCue = (
  1117. responseTimeSpatialCue /
  1118. (inhitsSpatialCue + hitsSpatialCue)
  1119. ).toFixed(2);
  1120. //警报分数(无刺激条件试验的反应时减去中性试验的反应时)
  1121. var warnScore = responseTimeNoCue - responseTimeNeutralCue;
  1122. //定向分数(中性试验的反应时减去空间条件下的反应时)
  1123. var directionScore = responseTimeNeutralCue - responseTimeSpatialCue;
  1124. //冲突分数(不一致试验的反应时减去一致试验的反应时)
  1125. var conflictScore = responseTimeIncongruent - responseTimeCongruent;
  1126. // console.log(
  1127. // hitsAll // 总命中次数
  1128. // hitscongruent, // 一致性命中次数
  1129. // hitsincongruent, // 不一致性命中次数
  1130. // hitsNoCue, // NoCue命中次数
  1131. // hitsNeutralCue, // NeutralCue命中次数
  1132. // hitsSpatialCue, //SpatialCue命中次数
  1133. // hitRate, // 命中率
  1134. // congruentHitRate, // 一致性命中率
  1135. // incongruentHitRate, // 不一致性命中率
  1136. // noCueHitRate, // noCue命中率
  1137. // neutralCueHitRate, // neutralCue命中率
  1138. // spatialCueHitRate, // spatialCue命中率
  1139. // responseTimeAll, // 反应时 ,前面加avg的表示的是平均反应时
  1140. // responseTimeCongruent, // 一致性反应时
  1141. // responseTimeIncongruent, // 不一致性反应时
  1142. // responseTimeNoCue, // NoCue反应时
  1143. // responseTimeNeutralCue, // NeutralCue
  1144. // responseTimeSpatialCue, // 警报分数(无刺激条件试验的反应时减去中性试验的反应时)
  1145. // warnScore, // 定向分数(中性试验的反应时减去空间条件下的反应时)
  1146. // directionScore, // 冲突分数(不一致试验的反应时减去一致试验的反应时)
  1147. // );
  1148. var computeResult = {};
  1149. computeResult.hitsAll = hitsAll;
  1150. computeResult.hitscongruent = hitscongruent;
  1151. computeResult.hitsincongruent = hitsincongruent;
  1152. computeResult.hitsNoCue = hitsNoCue;
  1153. computeResult.hitsNeutralCue = hitsNeutralCue;
  1154. computeResult.hitsSpatialCue = hitsSpatialCue; //命中率:全部命中率:正确点击次数/全部点击次数
  1155. computeResult.hitRate = hitRate; //命中率:不同实验(一致性、不一致性)和不同线索下的命中率
  1156. computeResult.congruentHitRate = congruentHitRate;
  1157. computeResult.incongruentHitRate = incongruentHitRate;
  1158. computeResult.noCueHitRate = noCueHitRate;
  1159. computeResult.neutralCueHitRate = neutralCueHitRate;
  1160. computeResult.spatialCueHitRate = spatialCueHitRate; //RT:反应时
  1161. computeResult.responseTimeAll = responseTimeAll; //反应时以及不同实验(一致性、不一致性)和不同线索下的平均反应时
  1162. computeResult.responseTimeCongruent = responseTimeCongruent;
  1163. computeResult.responseTimeIncongruent = responseTimeIncongruent;
  1164. computeResult.responseTimeNoCue = responseTimeNoCue;
  1165. computeResult.responseTimeNeutralCue = responseTimeNeutralCue;
  1166. computeResult.responseTimeSpatialCue = responseTimeSpatialCue;
  1167. computeResult.avgresponseTimeCongruent = avgresponseTimeCongruent;
  1168. computeResult.avgresponseTimeIncongruent = avgresponseTimeIncongruent;
  1169. computeResult.avgresponseTimeNoCue = avgresponseTimeNoCue;
  1170. computeResult.avgresponseTimeNeutralCue = avgresponseTimeNeutralCue;
  1171. computeResult.avgresponseTimeSpatialCue = avgresponseTimeSpatialCue; //警报分数(无刺激条件试验的反应时减去中性试验的反应时)
  1172. computeResult.warnScore = warnScore; //定向分数(中性试验的反应时减去空间条件下的反应时)
  1173. computeResult.directionScore = directionScore; //冲突分数(不一致试验的反应时减去一致试验的反应时)
  1174. computeResult.conflictScore = conflictScore;
  1175. return computeResult;
  1176. },
  1177. // 更多游戏
  1178. moreGame() {
  1179. this.$router.push("/welcome/CognitiveAbility");
  1180. },
  1181. },
  1182. };
  1183. </script>
  1184. <style scoped>
  1185. .testMainDiv {
  1186. margin: 0 auto;
  1187. margin-top: 10px;
  1188. background: gray;
  1189. background-size: cover;
  1190. /* text-align:center; */
  1191. width: 500px;
  1192. height: 300px;
  1193. /* object-fit:fill; */
  1194. }
  1195. .activeTask {
  1196. background: url(../../assets/congnitiveAblitity/speed-bg.png) no-repeat center;
  1197. background-size: cover;
  1198. /* background: gray; */
  1199. position: fixed;
  1200. top: 0;
  1201. left: 0;
  1202. right: 0;
  1203. bottom: 0;
  1204. }
  1205. .scaleName {
  1206. margin-top: 70px;
  1207. background-size: cover;
  1208. }
  1209. .scaleButton {
  1210. margin-top: 20px;
  1211. margin-bottom: 20px;
  1212. background-size: cover;
  1213. }
  1214. .aa {
  1215. visibility: hidden;
  1216. }
  1217. .glassPad {
  1218. width: 100%;
  1219. position: absolute;
  1220. left: 50%;
  1221. top: 50%;
  1222. transform: translate(-50%, -50%);
  1223. }
  1224. .correctRate {
  1225. position: absolute;
  1226. left: 50%;
  1227. bottom: 10%;
  1228. transform: translateX(-50%);
  1229. }
  1230. </style>