page.js 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477
  1. import React from 'react';
  2. import { Link } from 'react-router-dom';
  3. import './index.less';
  4. import LineChart from '@src/components/LineChart';
  5. import BarChart from '@src/components/BarChart';
  6. import PieChart from '@src/components/PieChart';
  7. import Assets from '@src/components/Assets';
  8. import Page from '@src/containers/Page';
  9. import { formatDate, formatPercent, formatSeconds, formatMinute, formatSecond, formatMinuteSecond, getMap } from '@src/services/Tools';
  10. import { Icon, Tooltip } from 'antd';
  11. import { Question } from '../../../stores/question';
  12. import { Button } from '../../../components/Button';
  13. import Tabs from '../../../components/Tabs';
  14. import { Icon as GIcon } from '../../../components/Icon';
  15. import { QuestionNoteModal } from '../../../components/OtherModal';
  16. import { My } from '../../../stores/my';
  17. import {
  18. QuestionDifficult,
  19. ExaminationQuestionType,
  20. ExaminationSubject,
  21. } from '../../../../Constant';
  22. const QuestionDifficultMap = getMap(QuestionDifficult, 'value', 'label');
  23. const QuestionDifficultSort = getMap(QuestionDifficult, 'value', 'sort');
  24. function BarOption3(titles, source, data1, data2, color1, color2) {
  25. return {
  26. title: [
  27. {
  28. text: titles[0],
  29. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  30. left: 100,
  31. top: 15,
  32. },
  33. {
  34. text: titles[1],
  35. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  36. left: 195,
  37. top: 15,
  38. },
  39. {
  40. text: titles[2],
  41. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  42. left: 695,
  43. top: 15,
  44. },
  45. ],
  46. grid: [{ width: 250, x: 200, bottom: 30 }, { width: 250, x: 700, bottom: 30 }],
  47. xAxis: [
  48. {
  49. gridIndex: 0,
  50. show: false,
  51. axisTick: { show: false },
  52. axisLine: { show: false },
  53. splitLine: { show: false },
  54. },
  55. {
  56. gridIndex: 1,
  57. show: false,
  58. axisTick: { show: false },
  59. axisLine: { show: false },
  60. splitLine: { show: false },
  61. },
  62. ],
  63. yAxis: [
  64. {
  65. gridIndex: 0,
  66. type: 'category',
  67. axisTick: { show: false },
  68. axisLine: { show: false },
  69. splitLine: { show: false },
  70. offset: 15,
  71. data: source,
  72. axisLabel: { color: '#686872', fontSize: 16 },
  73. },
  74. {
  75. gridIndex: 1,
  76. type: 'category',
  77. axisTick: { show: false },
  78. axisLine: { show: false },
  79. splitLine: { show: false },
  80. axisLabel: { show: false },
  81. },
  82. ],
  83. series: [
  84. {
  85. type: 'bar',
  86. xAxisIndex: 0,
  87. yAxisIndex: 0,
  88. barWidth: 30,
  89. data: data1.map((item, index) => ({
  90. value: formatPercent(item[0], item[1], true),
  91. itemStyle: { color: index % 2 ? color1[0] : color1[1] },
  92. label: {
  93. show: true,
  94. color: '#303036',
  95. align: 'right',
  96. position: [360, 5],
  97. fontSize: 16,
  98. formatter: `${item[0]}/${item[1]} ${formatPercent(item[0], item[1], false)}`,
  99. },
  100. })),
  101. },
  102. {
  103. type: 'bar',
  104. xAxisIndex: 1,
  105. yAxisIndex: 1,
  106. barWidth: 30,
  107. data: data2.map((item, index) => ({
  108. value: parseInt(item, 10),
  109. itemStyle: { color: index % 2 ? color2[0] : color2[1] },
  110. label: {
  111. show: true,
  112. color: '#303036',
  113. align: 'right',
  114. fontSize: 16,
  115. position: [360, 5],
  116. formatter: formatMinuteSecond(parseInt(item, 10)),
  117. },
  118. })),
  119. },
  120. ],
  121. };
  122. }
  123. function BarOption2(title, data, legend, color) {
  124. return {
  125. title: {
  126. text: title,
  127. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  128. },
  129. tooltip: {
  130. trigger: 'item',
  131. },
  132. legend: {
  133. show: legend.length > 1,
  134. data: legend,
  135. right: 20,
  136. },
  137. color,
  138. dataset: {
  139. source: [['type', ...legend], ...data],
  140. },
  141. grid: { left: 30, right: 30, height: 300 },
  142. xAxis: {
  143. type: 'category',
  144. axisLabel: { color: '#686872' },
  145. axisLine: { lineStyle: { color: '#D1D6DF' } },
  146. },
  147. yAxis: {
  148. type: 'value',
  149. min: 0,
  150. max: 100,
  151. axisLabel: { color: '#686872' },
  152. axisLine: { lineStyle: { color: '#D1D6DF' } },
  153. },
  154. series: legend.map(() => ({
  155. type: 'bar',
  156. barWidth: 40,
  157. })),
  158. };
  159. }
  160. function lineOption1(title, data, legend, color) {
  161. return {
  162. title: {
  163. text: title,
  164. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  165. left: '0',
  166. },
  167. tooltip: {
  168. trigger: 'item',
  169. formatter: (params) => {
  170. return formatSeconds(params.value[params.seriesIndex + 1]);
  171. },
  172. },
  173. legend: {
  174. show: legend.length > 1,
  175. data: legend,
  176. right: 20,
  177. },
  178. color,
  179. grid: { left: 30, right: 30, height: 300 },
  180. xAxis: {
  181. type: 'category',
  182. axisLabel: { color: '#686872' },
  183. axisLine: { lineStyle: { color: '#D1D6DF' } },
  184. },
  185. yAxis: {
  186. type: 'value',
  187. min: 0,
  188. max: 100,
  189. axisLabel: { color: '#686872' },
  190. axisLine: { lineStyle: { color: '#D1D6DF' } },
  191. },
  192. dataset: {
  193. source: [['type', ...legend], ...data],
  194. },
  195. series: legend.map(() => ({
  196. type: 'line',
  197. smooth: true,
  198. symbol: 'circle',
  199. })),
  200. };
  201. }
  202. function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
  203. value = parseInt(value, 10);
  204. allValue = parseInt(allValue, 10);
  205. avgCorrect = parseInt(avgCorrect, 10);
  206. avgIncorrent = parseInt(avgIncorrent, 10);
  207. const xAxis1 = [
  208. {
  209. gridIndex: 0,
  210. type: 'category',
  211. axisTick: { show: false },
  212. axisLine: { lineStyle: { color: '#D1D6DF' } },
  213. splitLine: { show: false },
  214. },
  215. {
  216. gridIndex: 1,
  217. type: 'category',
  218. axisTick: { show: false },
  219. axisLine: { lineStyle: { color: '#D1D6DF' } },
  220. splitLine: { show: false },
  221. data: [
  222. {
  223. value: 'Avg Time\nCorrect',
  224. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  225. },
  226. {
  227. value: 'Avg Time\nIncorrect',
  228. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  229. },
  230. ],
  231. },
  232. ];
  233. const xAxis2 = {
  234. type: 'category',
  235. axisTick: { show: false },
  236. axisLine: { lineStyle: { color: '#D1D6DF' } },
  237. splitLine: { show: false },
  238. };
  239. const yAxis1 = [
  240. {
  241. gridIndex: 0,
  242. show: false,
  243. min: 0,
  244. max: 100,
  245. axisTick: { show: false },
  246. axisLine: { show: false },
  247. splitLine: { show: false },
  248. },
  249. {
  250. gridIndex: 1,
  251. show: false,
  252. min: 0,
  253. max: 100,
  254. axisTick: { show: false },
  255. axisLine: { show: false },
  256. splitLine: { show: false },
  257. },
  258. ];
  259. const yAxis2 = {
  260. show: false,
  261. min: 0,
  262. max: 100,
  263. axisTick: { show: false },
  264. axisLine: { show: false },
  265. splitLine: { show: false },
  266. };
  267. const data1 = {
  268. type: 'bar',
  269. barWidth: 50,
  270. xAxisIndex: 0,
  271. yAxisIndex: 0,
  272. data: [
  273. {
  274. value,
  275. itemStyle: { color: '#7AA7DC' },
  276. label: {
  277. show: true,
  278. position: 'top',
  279. formatter: `{a|${formatSeconds(value)}}`,
  280. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  281. },
  282. },
  283. {
  284. value: allValue,
  285. itemStyle: { color: '#598FCF' },
  286. label: {
  287. show: true,
  288. position: 'top',
  289. formatter: `{a|全站${formatSeconds(allValue)}}`,
  290. rich: { a: { fontSize: 12, color: '#686872' } },
  291. },
  292. },
  293. ],
  294. };
  295. const data2 = {
  296. type: 'bar',
  297. barWidth: 50,
  298. xAxisIndex: 1,
  299. yAxisIndex: 1,
  300. data: [
  301. {
  302. value: avgCorrect,
  303. name: 'Avg Time\nCorrect',
  304. itemStyle: { color: '#7775CA' },
  305. label: {
  306. show: true,
  307. position: 'top',
  308. formatter: `{a|${formatSeconds(avgCorrect)}}`,
  309. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  310. },
  311. },
  312. {
  313. value: avgIncorrent,
  314. name: 'Avg Time\nIncorrect',
  315. itemStyle: { color: '#9396C9' },
  316. label: {
  317. show: true,
  318. position: 'top',
  319. formatter: `{a|${formatSeconds(avgIncorrent)}}`,
  320. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  321. },
  322. },
  323. ],
  324. };
  325. return {
  326. title: [
  327. {
  328. text: title,
  329. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  330. left: '0',
  331. },
  332. {
  333. text: 'Avg Time\nTotal',
  334. textAlign: 'center',
  335. textVerticalAlign: 'middle',
  336. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  337. bottom: '2%',
  338. left: '26%',
  339. },
  340. ],
  341. xAxis: avgCorrect ? xAxis1 : xAxis2,
  342. yAxis: avgCorrect ? yAxis1 : yAxis2,
  343. grid: avgCorrect ? [{ width: 200, x: 72 }, { width: 350, x: 272 }] : { width: 200, left: '30%' },
  344. series: avgCorrect ? [data1, data2] : [data1],
  345. };
  346. }
  347. function pieOption1(title, userCorrect, userNumber, totalCorrect, totalNumber) {
  348. const value = formatPercent(userCorrect, userNumber);
  349. const allValue = formatPercent(totalCorrect, totalNumber);
  350. return {
  351. title: [
  352. {
  353. text: title,
  354. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  355. left: '0',
  356. },
  357. {
  358. text: `${value}%`,
  359. textAlign: 'center',
  360. textVerticalAlign: 'middle',
  361. textStyle: { color: value < 50 ? '#f19057' : '#7AA7DC', fontSize: 45 },
  362. subtext: `${userCorrect}/${userNumber}`,
  363. subtextStyle: { color: '#686872', fontSize: 16 },
  364. top: '35%',
  365. left: '49%',
  366. },
  367. ],
  368. series: [
  369. {
  370. type: 'pie',
  371. radius: ['64%', '70%'],
  372. label: {
  373. show: false,
  374. },
  375. hoverAnimation: false,
  376. animation: false,
  377. data: [
  378. {
  379. value: allValue,
  380. itemStyle: { color: '#7775CA' },
  381. label: {
  382. show: true,
  383. position: 'outside',
  384. formatter: `{a|全站用户}:{b|${allValue}%}`,
  385. rich: {
  386. a: {
  387. color: '#686872',
  388. fontSize: 16,
  389. },
  390. b: {
  391. color: '#6865FD',
  392. fontSize: 16,
  393. },
  394. },
  395. },
  396. },
  397. {
  398. value: 100 - allValue,
  399. itemStyle: { color: '#e1e1e1' },
  400. emphasis: { itemStyle: { color: '#e1e1e1' } },
  401. },
  402. ],
  403. },
  404. {
  405. type: 'pie',
  406. radius: ['45%', '61%'],
  407. label: {
  408. show: false,
  409. },
  410. hoverAnimation: false,
  411. animation: false,
  412. data: [
  413. { value, itemStyle: { color: value < 50 ? '#f19057' : '#7AA7DC' } },
  414. { value: 100 - value, itemStyle: { color: '#e1e1e1' }, emphasis: { itemStyle: { color: '#e1e1e1' } } },
  415. ],
  416. },
  417. ],
  418. };
  419. }
  420. function pieOption2(title, value1, value2, value3, total) {
  421. return {
  422. title: [
  423. {
  424. text: title,
  425. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  426. left: '0',
  427. },
  428. {
  429. text: `${total}`,
  430. textAlign: 'center',
  431. textVerticalAlign: 'middle',
  432. textStyle: { color: '#686872', fontSize: 60 },
  433. subtext: '综合实力',
  434. subtextStyle: { color: '#686872', fontSize: 14 },
  435. top: '35%',
  436. left: '49.5%',
  437. },
  438. ],
  439. series: [
  440. {
  441. type: 'pie',
  442. radius: ['50%', '80%'],
  443. startAngle: 30,
  444. hoverAnimation: false,
  445. animation: false,
  446. data: [
  447. {
  448. value: value1,
  449. itemStyle: { color: '#6865FD' },
  450. label: {
  451. position: 'outside',
  452. formatter: `{a|逻辑关系} {b|${value1}}`,
  453. rich: {
  454. a: {
  455. color: '#686872',
  456. fontSize: 18,
  457. },
  458. b: {
  459. color: '#6865FD',
  460. fontSize: 18,
  461. },
  462. },
  463. },
  464. },
  465. {
  466. value: value2,
  467. itemStyle: { color: '#6EC28D' },
  468. label: {
  469. position: 'outside',
  470. formatter: `{a|句子结构} {b|${value2}}`,
  471. rich: {
  472. a: {
  473. color: '#686872',
  474. fontSize: 18,
  475. },
  476. b: {
  477. color: '#6EC28D',
  478. fontSize: 18,
  479. },
  480. },
  481. },
  482. },
  483. {
  484. value: value3,
  485. itemStyle: { color: '#598FCF' },
  486. label: {
  487. position: 'outside',
  488. formatter: `{a|阅读速度} {b|${value3}}`,
  489. rich: {
  490. a: {
  491. color: '#686872',
  492. fontSize: 18,
  493. },
  494. b: {
  495. color: '#598FCF',
  496. fontSize: 18,
  497. },
  498. },
  499. },
  500. },
  501. ],
  502. },
  503. ],
  504. };
  505. }
  506. export default class extends Page {
  507. initState() {
  508. return { tab: 'main', report: { paperModule: '' } };
  509. }
  510. initData() {
  511. const { id } = this.params;
  512. const { info = '' } = this.state.search;
  513. Question.detailReport(id).then(result => {
  514. switch (result.paperModule) {
  515. case 'sentence':
  516. this.refreshSentence(result);
  517. break;
  518. case 'textbook':
  519. this.refreshTextbook(result);
  520. break;
  521. case 'exercise':
  522. this.refreshExercise(result);
  523. break;
  524. case 'examination':
  525. this.refreshExamination(result);
  526. break;
  527. default:
  528. }
  529. this.setState({ report: result, paper: result.paper });
  530. return result;
  531. })
  532. .then(report => {
  533. switch (info) {
  534. case 'question':
  535. // 题目回顾列表
  536. Question.questionReport(id).then(result => {
  537. switch (report.paperModule) {
  538. case 'sentence':
  539. result = result.map((row) => {
  540. row.struct = row.detail.subject && row.detail.predicate && row.detail.object ? 0 : 1;
  541. row.logic = row.detail.options ? 0 : 1;
  542. row.note = row.note ? 1 : 0;
  543. row.collect = row.collect ? 1 : 0;
  544. return row;
  545. });
  546. break;
  547. case 'textbook':
  548. case 'exercise':
  549. result = result.map((row) => {
  550. row.correct = row.isCorrect ? 0 : 1;
  551. row.difficult = QuestionDifficultSort[row.question.difficult];
  552. row.place = row.question.place;
  553. row.note = row.note ? 1 : 0;
  554. row.collect = row.collect ? 1 : 0;
  555. return row;
  556. });
  557. this.refreshExercise(result);
  558. break;
  559. default:
  560. }
  561. this.setState({ list: result });
  562. });
  563. break;
  564. default:
  565. break;
  566. }
  567. });
  568. }
  569. refreshSentence() {
  570. const { info = '' } = this.state.search;
  571. switch (info) {
  572. case 'question':
  573. break;
  574. default:
  575. }
  576. }
  577. refreshTextbook() {
  578. this.refreshExercise();
  579. }
  580. refreshExamination() {
  581. const { info = '' } = this.state.search;
  582. switch (info) {
  583. case 'score':
  584. break;
  585. default:
  586. }
  587. }
  588. refreshExercise() {
  589. const { info = '' } = this.state.search;
  590. switch (info) {
  591. case 'question':
  592. break;
  593. default:
  594. }
  595. }
  596. questionSort(field) {
  597. let { order } = this.state;
  598. const { list = [] } = this.state;
  599. if (order === field) {
  600. order = 'no';
  601. // direction = 'asc';
  602. } else {
  603. order = field;
  604. // direction = 'desc';
  605. }
  606. list.sort((b, a) => {
  607. const aValue = a[order];
  608. const bValue = b[order];
  609. if (aValue === bValue) {
  610. return b.no - a.no;
  611. }
  612. return aValue > bValue ? -1 : 1;
  613. });
  614. // if (direction === 'desc') {
  615. // list.reverse();
  616. // }
  617. this.setState({ order, list });
  618. }
  619. toggleCollect(index) {
  620. const { list } = this.state;
  621. const userQuestion = list[index];
  622. if (!userQuestion.collect) {
  623. My.addQuestionCollect(userQuestion.questionNo.id).then(() => {
  624. userQuestion.collect = true;
  625. this.setState({ list });
  626. });
  627. } else {
  628. My.delQuestionCollect(userQuestion.questionNo.id).then(() => {
  629. userQuestion.collect = false;
  630. this.setState({ list });
  631. });
  632. }
  633. }
  634. note(index) {
  635. const { list } = this.state;
  636. const userQuestion = list[index];
  637. const { questionNo } = userQuestion;
  638. My.getQuestionNote(questionNo.id)
  639. .then(result => {
  640. this.setState({ questionNo, note: result || {}, showNote: true, index });
  641. });
  642. }
  643. renderView() {
  644. const { report = {}, search = {} } = this.state;
  645. const { info } = search;
  646. switch (report.paperModule) {
  647. case 'sentence':
  648. if (info === 'question') {
  649. return this.renderSentenceQuestion();
  650. }
  651. return this.renderSentence();
  652. case 'textbook':
  653. if (info === 'question') {
  654. return this.renderExerciseQuestion();
  655. }
  656. return this.renderTextbook();
  657. case 'exercise':
  658. if (info === 'question') {
  659. return this.renderExerciseQuestion();
  660. }
  661. return this.renderExercise();
  662. case 'examination':
  663. return this.renderExamination();
  664. default:
  665. return <div />;
  666. }
  667. }
  668. renderSentence() {
  669. const { paper = {}, report = {}, search = {} } = this.state;
  670. const { info } = search;
  671. const { user } = this.props;
  672. return (
  673. <div className="sentence">
  674. <div className="header">
  675. <div className="content">
  676. <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
  677. <div className="btns">
  678. <Button size="small" radius onClick={() => {
  679. linkTo('/');
  680. }}>返回首页</Button>
  681. {!info && <Button size="small" radius onClick={() => {
  682. linkTo(`/paper/report/${report.id}?info=question`);
  683. }}>题目回顾</Button>}
  684. {info === 'question' && <Button size="small" radius onClick={() => {
  685. linkTo(`/paper/report/${report.id}`);
  686. }}>详细报告</Button>}
  687. </div>
  688. <div className="right">
  689. <div className="text">{user.info.nickname}</div>
  690. <div className="desc">练习次数{paper.times + 1}</div>
  691. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  692. </div>
  693. </div>
  694. </div>
  695. {info === 'question' && this.renderSentenceQuestion()}
  696. {!info && this.renderSentenceDetail()}
  697. </div>
  698. );
  699. }
  700. renderTextbook() {
  701. return this.renderExercise();
  702. }
  703. renderExercise() {
  704. const { paper = {}, report = {}, search = {} } = this.state;
  705. const { info } = search;
  706. const { user } = this.props;
  707. return (
  708. <div className="exercise">
  709. <div className="header">
  710. <div className="content">
  711. <div className="title">Report for「练习」{paper.title}</div>
  712. <div className="btns">
  713. <Button size="small" radius onClick={() => {
  714. linkTo('/');
  715. }}>返回首页</Button>
  716. {!info && <Button size="small" radius onClick={() => {
  717. linkTo(`/paper/report/${report.id}?info=question`);
  718. }}>题目回顾</Button>}
  719. {info === 'question' && <Button size="small" radius onClick={() => {
  720. linkTo(`/paper/report/${report.id}`);
  721. }}>详细报告</Button>}
  722. </div>
  723. <div className="right">
  724. <div className="text">{user.info.nickname}</div>
  725. <div className="desc">练习次数{paper.times + 1}</div>
  726. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  727. </div>
  728. </div>
  729. </div>
  730. {info === 'question' && this.renderExerciseQuestion()}
  731. {!info && this.renderExerciseDetail()}
  732. </div>
  733. );
  734. }
  735. renderExamination() {
  736. const { paper = {}, report = {}, search = {} } = this.state;
  737. const { info } = search;
  738. const { user } = this.props;
  739. return (
  740. <div className="examination">
  741. <div className="header">
  742. <div className="content">
  743. <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
  744. <div className="btns">
  745. <Button size="small" radius onClick={() => {
  746. linkTo('/');
  747. }}>返回首页</Button>
  748. {!info && <Button size="small" radius onClick={() => {
  749. linkTo(`/paper/report/${report.id}?info=score`);
  750. }}>成绩单</Button>}
  751. {info === 'score' && <Button size="small" radius onClick={() => {
  752. linkTo(`/paper/report/${report.id}`);
  753. }}>详细报告</Button>}
  754. </div>
  755. <div className="right">
  756. <div className="text">{user.info.nickname}</div>
  757. <div className="desc">练习次数{paper.times + 1}</div>
  758. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  759. </div>
  760. </div>
  761. </div>
  762. {info === 'score' && this.renderExaminationScore()}
  763. {!info && this.renderExaminationDetail()}
  764. </div>
  765. );
  766. }
  767. renderSentenceQuestion() {
  768. const { report, list, order, showNote, note = {}, questionNo = {} } = this.state;
  769. return <div className='sentence question'>
  770. <div className='header'>
  771. <div className='content'>
  772. <div className='title'>题目回顾</div>
  773. <Button className='back' radius onClick={() => {
  774. linkTo(`/paper/report/${report.id}`);
  775. }}>返回长难句报告</Button>
  776. </div>
  777. </div>
  778. <div className='body'>
  779. <div className='content'>
  780. <div className='tip'><Assets name='notice' />点击题目查看详情</div>
  781. <table>
  782. <thead>
  783. <tr>
  784. <th>序号</th>
  785. <th width='420'>题目</th>
  786. <th className="point" onClick={() => {
  787. this.questionSort('struct');
  788. }}>句子结构<GIcon name={order === 'struct' ? 'arrow-down' : 'arrow-up'} active={order === 'struct'} /></th>
  789. <th className="point" onClick={() => {
  790. this.questionSort('logic');
  791. }}>逻辑关系<GIcon name={order === 'logic' ? 'arrow-down' : 'arrow-up'} active={order === 'logic'} /></th>
  792. <th className="point" onClick={() => {
  793. this.questionSort('userTime');
  794. }}>用时<GIcon name={order === 'userTime' ? 'arrow-down' : 'arrow-up'} active={order === 'userTime'} /></th>
  795. <th className="point" onClick={() => {
  796. this.questionSort('collect');
  797. }}>收藏<GIcon name={order === 'collect' ? 'arrow-down' : 'arrow-up'} active={order === 'collect'} /></th>
  798. <th className="point" onClick={() => {
  799. this.questionSort('note');
  800. }}>笔记<GIcon name={order === 'note' ? 'arrow-down' : 'arrow-up'} active={order === 'note'} /></th>
  801. </tr>
  802. </thead>
  803. <tbody>
  804. {(list || []).map((row, index) => {
  805. return <tr>
  806. <td>{row.no}</td>
  807. <td>
  808. <div className='n'><Link to={`/paper/question/${row.id}`}>{row.questionNo.title}</Link></div>
  809. <div className='desc'>{row.question.description}</div>
  810. </td>
  811. <td><GIcon name={row.detail.subject && row.detail.predicate && row.detail.object ? 'right' : 'error'} noHover /></td>
  812. <td><GIcon name={row.detail.options ? 'right' : 'error'} noHover /></td>
  813. <td>{formatMinuteSecond(row.userTime)}</td>
  814. <td><GIcon name='star' active={row.collect} onClick={() => this.toggleCollect(index)} /></td>
  815. <td><GIcon name='note' active={row.note} onClick={() => this.note(index)} /></td>
  816. </tr>;
  817. })}
  818. </tbody>
  819. </table>
  820. </div>
  821. </div>
  822. <QuestionNoteModal show={showNote} defaultData={note} questionNo={questionNo} onConfirm={() => {
  823. list[this.state.index].note = true;
  824. this.setState({ showNote: false, list });
  825. }} onCancel={() => this.setState({ showNote: false })} />
  826. </div>;
  827. }
  828. renderSentenceDetail() {
  829. const { report = {} } = this.state;
  830. const { detail = {} } = report;
  831. return <div>
  832. <div className="body">
  833. <div className="content">
  834. <div className="title">完成情况</div>
  835. <div className="detail">
  836. <div className="block">
  837. <div className="t1">总耗时</div>
  838. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  839. </div>
  840. {detail.info.userTime > detail.info.time && <div className="block">
  841. <div className="t1">超出建议用时</div>
  842. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.userTime - detail.info.time).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  843. </div>}
  844. <div className="line" />
  845. <div className="block">
  846. <div className="t1">完成题目</div>
  847. <div className="t2">{detail.info.userNumber}</div>
  848. <div className="t3">题</div>
  849. </div>
  850. {detail.info.userNumber !== detail.info.questionNumber && <div className="block">
  851. <div className="t1">剩余未做</div>
  852. <div className="t2">{detail.info.questionNumber || 0 - detail.info.userNumber}</div>
  853. <div className="t3">题</div>
  854. </div>}
  855. </div>
  856. </div>
  857. </div>
  858. <div className="body gray">
  859. <div className="content">
  860. <div className="title">基本情况</div>
  861. <div className="block-wrapper">
  862. <div className="block">
  863. <PieChart option={pieOption1('正确率', detail.info.userCorrect, detail.info.userNumber, detail.info.totalCorrect, detail.info.totalNumber)} />
  864. </div>
  865. <div className="block">
  866. <BarChart option={barOption1('用时', detail.info.userTime / detail.info.userNumber, detail.info.totalTime / detail.info.totalNumber, detail.info.correctTime, detail.info.incorrectTime)} />
  867. </div>
  868. </div>
  869. </div>
  870. </div>
  871. <div className="body">
  872. <div className="content">
  873. <div className="title">能力评估</div>
  874. <PieChart option={pieOption2('综合得分', detail.ability.logic, detail.ability.struct, detail.ability.speed, detail.ability.score)} />
  875. </div>
  876. </div>
  877. <div className="body gray">
  878. <div className="content t-c">
  879. <Button size="lager" width={200} radius onClick={() => linkTo('/exercise?tab=sentence')}>
  880. 继续做题
  881. </Button>
  882. </div>
  883. </div>
  884. </div>;
  885. }
  886. renderExerciseQuestion() {
  887. const { report, list, order, showNote, note = {}, questionNo = {} } = this.state;
  888. return <div className='sentence question'>
  889. <div className='header'>
  890. <div className='content'>
  891. <div className='title'>题目回顾</div>
  892. <Button className='back' radius onClick={() => {
  893. linkTo(`/paper/report/${report.id}`);
  894. }}>返回练习报告</Button>
  895. </div>
  896. </div>
  897. <div className='body'>
  898. <div className='content'>
  899. <div className='tip'><Assets name='notice' />点击题目查看详情</div>
  900. <table>
  901. <thead>
  902. <tr>
  903. <th>序号</th>
  904. <th width='340'>题目</th>
  905. <th className="point" onClick={() => {
  906. this.questionSort('correct');
  907. }}>正误<GIcon name={order === 'correct' ? 'arrow-down' : 'arrow-up'} active={order === 'correct'} /></th>
  908. <th className="point" onClick={() => {
  909. this.questionSort('difficult');
  910. }}>难度<GIcon name={order === 'difficult' ? 'arrow-down' : 'arrow-up'} active={order === 'difficult'} /></th>
  911. <th className="point" onClick={() => {
  912. this.questionSort('userTime');
  913. }}>用时<GIcon name={order === 'userTime' ? 'arrow-down' : 'arrow-up'} active={order === 'userTime'} /></th>
  914. <th className="point" onClick={() => {
  915. this.questionSort('place');
  916. }}>主要考点<GIcon name={order === 'place' ? 'arrow-down' : 'arrow-up'} active={order === 'place'} /></th>
  917. <th className="point" onClick={() => {
  918. this.questionSort('collect');
  919. }}>收藏<GIcon name={order === 'collect' ? 'arrow-down' : 'arrow-up'} active={order === 'collect'} /></th>
  920. <th className="point" onClick={() => {
  921. this.questionSort('note');
  922. }}>笔记<GIcon name={order === 'note' ? 'arrow-down' : 'arrow-up'} active={order === 'note'} /></th>
  923. </tr>
  924. </thead>
  925. <tbody>
  926. {(list || []).map((row, index) => {
  927. return <tr>
  928. <td>{row.no}</td>
  929. <td>
  930. <div className='n'><Link to={`/paper/question/${row.id}`}>{row.questionNo.title}</Link></div>
  931. <div className='desc'>{row.question.description}</div>
  932. </td>
  933. <td><GIcon name={row.isCorrect ? 'right' : 'error'} noHover /></td>
  934. <td>{row.question.difficult}</td>
  935. <td>{formatMinuteSecond(row.userTime)}</td>
  936. <td>{row.question.place}</td>
  937. <td><GIcon name='star' active={row.collect} onClick={() => this.toggleCollect(index)} /></td>
  938. <td><GIcon name='note' active={row.note} onClick={() => this.note(index)} /></td>
  939. </tr>;
  940. })}
  941. </tbody>
  942. </table>
  943. </div>
  944. </div>
  945. <QuestionNoteModal show={showNote} defaultData={note} questionNo={questionNo} onConfirm={() => {
  946. list[this.state.index].note = true;
  947. this.setState({ showNote: false, list });
  948. }} onCancel={() => this.setState({ showNote: false })} />
  949. </div>;
  950. }
  951. renderExerciseDetail() {
  952. const { report = {} } = this.state;
  953. let { detail = {} } = report;
  954. detail = detail || {};
  955. const { pace = [], info = {}, difficult = [], place = [], limit = {} } = detail;
  956. return <div>
  957. <div className="body">
  958. <div className="content">
  959. <div className="title">完成情况</div>
  960. <div className="detail">
  961. <div className="block">
  962. <div className="t1">总耗时</div>
  963. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  964. </div>
  965. {info.userTime > info.time && <div className="block">
  966. <div className="t1">超出建议用时</div>
  967. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime - info.time).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  968. </div>}
  969. <div className="line" />
  970. <div className="block">
  971. <div className="t1">完成题目</div>
  972. <div className="t2">{info.userNumber}</div>
  973. <div className="t3">题</div>
  974. </div>
  975. {info.userNumber !== info.questionNumber && <div className="block">
  976. <div className="t1">剩余未做</div>
  977. <div className="t2">{info.questionNumber - info.userNumber}</div>
  978. <div className="t3">题</div>
  979. </div>}
  980. </div>
  981. </div>
  982. </div>
  983. <div className="body gray">
  984. <div className="content">
  985. <div className="title">基本情况</div>
  986. <div className="block-wrapper">
  987. <div className="block">
  988. <PieChart option={pieOption1('正确率', info.userCorrect, info.userNumber, info.totalCorrect, info.totalNumber)} />
  989. </div>
  990. <div className="block">
  991. <BarChart option={barOption1('用时', info.userTime / info.userNumber, info.totalTime / info.totalNumber, info.correctTime, info.incorrectTime)} />
  992. </div>
  993. </div>
  994. </div>
  995. </div>
  996. <div className="body">
  997. <div className="content">
  998. <div className="title">PACE</div>
  999. <div className="detail-1">
  1000. <div className="block">
  1001. <div className="t1">平均用时</div>
  1002. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime / info.userNumber).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1003. </div>
  1004. <div className="block all">
  1005. <div className="t1">全站用户</div>
  1006. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.totalTime / info.totalNumber).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1007. </div>
  1008. </div>
  1009. <LineChart
  1010. height={400}
  1011. option={lineOption1(
  1012. '每题用时情况',
  1013. pace.map(row => {
  1014. return [`${row.no}`, row.userTime, row.time];
  1015. }),
  1016. ['我的', '全站'],
  1017. ['#7AA7DC', '#8684df'],
  1018. )}
  1019. />
  1020. </div>
  1021. </div>
  1022. {report.paperModule !== 'textbook' && <div className="body gray">
  1023. <div className="content">
  1024. <div className="title">难度分析</div>
  1025. <div className="detail-1">
  1026. <div className="block">
  1027. <div className="t1">正确率</div>
  1028. <div className="t2">{formatPercent(info.userCorrect, info.userNumber, false)}</div>
  1029. </div>
  1030. <div className="block all">
  1031. <div className="t1">全站用户</div>
  1032. <div className="t2">{formatPercent(info.totalCorrect, info.totalNumber, false)}</div>
  1033. </div>
  1034. </div>
  1035. <BarChart
  1036. height={400}
  1037. option={BarOption2(
  1038. '正确率',
  1039. difficult.map(row => {
  1040. return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber), formatPercent(row.totalCorrect, row.totalNumber)];
  1041. }),
  1042. ['我的', '全站'],
  1043. ['#8684df', '#5195e5'],
  1044. )}
  1045. />
  1046. </div>
  1047. </div>}
  1048. <div className="body">
  1049. <div className="content">
  1050. <div className="title">知识体系分析</div>
  1051. <div className="detail-1">
  1052. <div className="block">
  1053. <div className="t1">平均用时</div>
  1054. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime / info.userNumber).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1055. </div>
  1056. <div className="block all">
  1057. <div className="t1">正确率</div>
  1058. <div className="t2">{formatPercent(info.userCorrect, info.userNumber, false)}</div>
  1059. </div>
  1060. </div>
  1061. <BarChart
  1062. height={400}
  1063. option={BarOption3(
  1064. ['知识点', '正确率分析', '用时分析'],
  1065. place.map(row => {
  1066. return row.key;
  1067. }),
  1068. place.map(row => {
  1069. return [row.userCorrect, row.userNumber];
  1070. }),
  1071. place.map(row => {
  1072. return row.userTime / row.userNumber;
  1073. }),
  1074. ['#7AA7DC', '#BFD4EE'],
  1075. ['#8684df', '#C3C3E5'],
  1076. )}
  1077. />
  1078. </div>
  1079. </div>
  1080. <div className="body gray">
  1081. <div className="content">
  1082. <div className="title">实战提醒</div>
  1083. {info.userTime > info.time && <div className="tip">
  1084. <div className="t1">在实战限时情况下,本套题正确率为 </div>
  1085. <div className="t2">{formatPercent(limit.userCorrect, limit.userNumber)}</div>
  1086. <Tooltip title="仅统计在建议时间内完成题目正确率情况,更接近实战表现"><Icon type="question-circle" theme="filled" /></Tooltip>
  1087. </div>}
  1088. {info.userTime <= info.time && <div className="tip">
  1089. <div className="t1">目前的做题速度已达到实战标准!很棒!请继续保持!</div>
  1090. </div>}
  1091. </div>
  1092. </div>
  1093. <div className="body">
  1094. <div className="content t-c">
  1095. <Button size="lager" width={200} radius onClick={() => linkTo('/exercise')}>
  1096. 继续做题
  1097. </Button>
  1098. </div>
  1099. </div>
  1100. </div>;
  1101. }
  1102. renderTextbookQuestion() {
  1103. return this.renderExerciseQuestion();
  1104. }
  1105. renderExaminationDetail() {
  1106. const { report = {}, tab } = this.state;
  1107. const { detail = {} } = report;
  1108. const { subject = {} } = detail;
  1109. const subjectDetail = tab === 'main' ? null : (subject || {})[tab] || { info: {}, defficlt: [], place: [], pace: [] };
  1110. return <div>
  1111. <div className="body">
  1112. <div className="content">
  1113. <Tabs
  1114. type="division"
  1115. theme="gray"
  1116. active={tab}
  1117. space={7}
  1118. tabs={[
  1119. { key: 'main', name: '总览 Overview' },
  1120. { key: 'verbal', name: '语文 Verbal' },
  1121. { key: 'quant', name: '数学 Quant' },
  1122. { key: 'ir', name: '综合推理 IR' },
  1123. ]}
  1124. onChange={(value) => {
  1125. this.setState({ tab: value });
  1126. }}
  1127. />
  1128. {!subjectDetail && <div className="list">
  1129. <div className="title">完成情况</div>
  1130. <div className="detail">
  1131. <div className="block">
  1132. <div className="t1" />
  1133. <div className="t4">Verbal</div>
  1134. <div className="t4">Quant</div>
  1135. <div className="t4">IR</div>
  1136. </div>
  1137. <div className="block">
  1138. <div className="t1">总耗时</div>
  1139. <div className="t1">
  1140. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.verbal || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1141. </div>
  1142. <div className="t1">
  1143. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.quant || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1144. </div>
  1145. <div className="t1">
  1146. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.ir || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1147. </div>
  1148. </div>
  1149. <div className="block">
  1150. <div className="t1">超出建议用时</div>
  1151. <div className="t1">
  1152. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.verbal || {}).userTime - (subject.verbal || {}).time).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1153. </div>
  1154. <div className="t1">
  1155. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.quant || {}).userTime - (subject.quant || {}).time).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1156. </div>
  1157. <div className="t1">
  1158. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.ir || {}).userTime - (subject.ir || {}).time).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1159. </div>
  1160. </div>
  1161. <div className="block">
  1162. <div className="t1" />
  1163. <div className="t1">
  1164. <div className="line" />
  1165. </div>
  1166. <div className="t1">
  1167. <div className="line" />
  1168. </div>
  1169. <div className="t1">
  1170. <div className="line" />
  1171. </div>
  1172. </div>
  1173. <div className="block">
  1174. <div className="t1">完成题目</div>
  1175. <div className="t1">
  1176. <div className="t2">{(subject.verbal || {}).userNumber}</div>
  1177. <div className="t3">题</div>
  1178. </div>
  1179. <div className="t1">
  1180. <div className="t2">{(subject.quant || {}).userNumber}</div>
  1181. <div className="t3">题</div>
  1182. </div>
  1183. <div className="t1">
  1184. <div className="t2">{(subject.ir || {}).userNumber}</div>
  1185. <div className="t3">题</div>
  1186. </div>
  1187. </div>
  1188. <div className="block">
  1189. <div className="t1">剩余未做</div>
  1190. <div className="t1">
  1191. <div className="t2">{(subject.verbal || {}).questionNumber - (subject.verbal || {}).userNumber}</div>
  1192. <div className="t3">题</div>
  1193. </div>
  1194. <div className="t1">
  1195. <div className="t2">{(subject.quant || {}).questionNumber - (subject.quant || {}).userNumber}</div>
  1196. <div className="t3">题</div>
  1197. </div>
  1198. <div className="t1">
  1199. <div className="t2">{(subject.ir || {}).questionNumber - (subject.ir || {}).userNumber}</div>
  1200. <div className="t3">题</div>
  1201. </div>
  1202. </div>
  1203. </div></div>}
  1204. {subjectDetail && <div>
  1205. <div className="title">PACE</div>
  1206. <div className="detail-1">
  1207. <div className="block">
  1208. <div className="t1">平均用时</div>
  1209. <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(subjectDetail.info.userTime / subjectDetail.info.userNumber).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
  1210. </div>
  1211. </div>
  1212. <LineChart
  1213. height={400}
  1214. option={lineOption1(
  1215. '每题用时情况',
  1216. subjectDetail.pace.map(row => {
  1217. return [`${row.no}`, row.userTime];
  1218. }),
  1219. ['我的'],
  1220. ['#A3A8BF'],
  1221. )}
  1222. />
  1223. <div className="m-b-4" />
  1224. <LineChart
  1225. height={400}
  1226. option={lineOption1(
  1227. '累计用时情况',
  1228. (function (sd) {
  1229. let userTime = 0;
  1230. let time = 0;
  1231. sd.pace.map(row => {
  1232. userTime += row.userTime;
  1233. time += row.time;
  1234. return [`${row.no}`, userTime, time];
  1235. });
  1236. }(subjectDetail)),
  1237. ['我的', '建议'],
  1238. ['#A3A8BF', '#7AA7DC'],
  1239. )}
  1240. />
  1241. </div>}
  1242. </div>
  1243. </div>
  1244. {!subjectDetail && <div className="body gray">
  1245. <div className="content">
  1246. <div className="title">成绩单</div>
  1247. <table>
  1248. <thead>
  1249. <tr>
  1250. <th>Question format</th>
  1251. <th>Total</th>
  1252. <th>Correct</th>
  1253. <th>%Correct</th>
  1254. <th>
  1255. Avg Time
  1256. </th>
  1257. <th>
  1258. Avg Time
  1259. <br />
  1260. Correct
  1261. </th>
  1262. <th>
  1263. Avg Time
  1264. <br />
  1265. Incorrect
  1266. </th>
  1267. <th>
  1268. Avg Diff
  1269. <br />
  1270. Correct
  1271. </th>
  1272. <th>
  1273. Avg Diff
  1274. <br />
  1275. Incorrect
  1276. </th>
  1277. </tr>
  1278. </thead>
  1279. <tbody>
  1280. {ExaminationQuestionType.map(row => {
  1281. const typeDetail = detail.type[row.value];
  1282. return <tr>
  1283. <td>{row.long}</td>
  1284. <td>{typeDetail.info.questionNumber}</td>
  1285. <td>{typeDetail.info.userCorrect}</td>
  1286. <td>
  1287. {formatPercent(typeDetail.info.userCorrect, typeDetail.info.userNumber)}
  1288. </td>
  1289. <td>
  1290. {formatSecond(typeDetail.info.userTime / typeDetail.info.userNumber)}
  1291. </td>
  1292. <td>
  1293. {formatSecond(typeDetail.info.correctTime / typeDetail.info.userCorrect)}
  1294. </td>
  1295. <td>
  1296. {formatSecond(typeDetail.info.incorrectTime / typeDetail.info.userNumber - typeDetail.info.userCorrect)}
  1297. </td>
  1298. <td>{typeDetail.info.avgDiffCorrect}</td>
  1299. <td>{typeDetail.info.avgDiffIncorrect}</td>
  1300. </tr>;
  1301. })}
  1302. </tbody>
  1303. </table>
  1304. </div>
  1305. </div>}
  1306. {subjectDetail && <div className="body gray">
  1307. <div className="content">
  1308. <div className="title">基本情况</div>
  1309. <table>
  1310. <thead>
  1311. <tr>
  1312. <th>%Correct</th>
  1313. <th>Avg Time</th>
  1314. <th>
  1315. Avg Time
  1316. <br />
  1317. Correct
  1318. </th>
  1319. <th>
  1320. Avg Time
  1321. <br />
  1322. Incorrect
  1323. </th>
  1324. <th>
  1325. Avg Diff
  1326. <br />
  1327. Correct
  1328. </th>
  1329. <th>
  1330. Avg Diff
  1331. <br />
  1332. Incorrect
  1333. </th>
  1334. </tr>
  1335. </thead>
  1336. <tbody>
  1337. <tr>
  1338. <td>
  1339. {formatPercent(subjectDetail.info.userCorrect, subjectDetail.info.userNumber)}
  1340. <br />
  1341. <span>{subjectDetail.info.userCorrect}题/{subjectDetail.info.userNumber}题</span>
  1342. </td>
  1343. <td>
  1344. {formatSecond(subjectDetail.info.userTime / subjectDetail.info.userNumber)}
  1345. <br />
  1346. <span>{formatMinute(subjectDetail.info.userTime)}min/{subjectDetail.info.userNumber}题</span>
  1347. </td>
  1348. <td>
  1349. {formatSecond(subjectDetail.info.correctTime / subjectDetail.info.userCorrect)}
  1350. <br />
  1351. <span>{formatMinute(subjectDetail.info.correctTime)}min/{subjectDetail.info.userCorrect}题</span>
  1352. </td>
  1353. <td>
  1354. {formatSecond(subjectDetail.info.incorrectTime / subjectDetail.info.userNumber - subjectDetail.info.userCorrect)}
  1355. <br />
  1356. <span>{formatMinute(subjectDetail.info.incorrectTime)}min/{subjectDetail.info.userNumber}题</span>
  1357. </td>
  1358. <td>{subjectDetail.info.avgDiffCorrect}</td>
  1359. <td>{subjectDetail.info.avgDiffIncorrect}</td>
  1360. </tr>
  1361. </tbody>
  1362. </table>
  1363. </div>
  1364. </div>}
  1365. {subjectDetail && <div className="body">
  1366. <div className="content">
  1367. <div className="title">难度分析</div>
  1368. <BarChart
  1369. height={400}
  1370. option={BarOption2(
  1371. '正确率',
  1372. subjectDetail.difficult.map(row => {
  1373. return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber)];
  1374. }),
  1375. ['我的'],
  1376. ['#989FC1'],
  1377. )}
  1378. />
  1379. </div>
  1380. </div>}
  1381. {subjectDetail && <div className="body gray">
  1382. <div className="content">
  1383. <div className="title">知识体系分析</div>
  1384. <BarChart
  1385. height={400}
  1386. option={BarOption3(
  1387. ['知识点', '正确率分析', '用时分析'],
  1388. subjectDetail.place.map(row => {
  1389. return row.key;
  1390. }),
  1391. subjectDetail.place.map(row => {
  1392. return [row.userCorrect, row.userNumber];
  1393. }),
  1394. subjectDetail.place.map(row => {
  1395. return row.userTime / row.userNumber;
  1396. }),
  1397. ['#92AFD2', '#BFD4EE'],
  1398. ['#989FC1', '#CCCCDC'],
  1399. )}
  1400. />
  1401. </div>
  1402. </div>}
  1403. </div >;
  1404. }
  1405. renderExaminationScore() {
  1406. const { report = {} } = this.state;
  1407. const { score } = report;
  1408. return <div className="body">
  1409. <div className="content">
  1410. <div className="title">成绩单</div>
  1411. <table>
  1412. <thead>
  1413. <tr>
  1414. <th>学科</th>
  1415. <th>分数</th>
  1416. <th>排名</th>
  1417. <th>题目</th>
  1418. </tr>
  1419. </thead>
  1420. <tbody>
  1421. {ExaminationSubject.map(row => {
  1422. return <tr>
  1423. <td>{row.long}</td>
  1424. <td>{row.ignore ? '--' : score[`${row.value}Score`]}</td>
  1425. <td>{row.ignore ? '--' : score[`${row.value}Rank`]}</td>
  1426. <td><Button size="small" radius onClick={() => {
  1427. Question.getDetailByNo(report.id, 1, row.value).then((r) => {
  1428. linkTo(`/paper/question/${r.id}`);
  1429. });
  1430. }}>回顾</Button></td></tr>;
  1431. })}
  1432. <tr>
  1433. <td>Total</td>
  1434. <td>{score.totalScore}</td>
  1435. <td>{score.totalRank}</td>
  1436. <td><Button size="small" radius onClick={() => {
  1437. Question.getDetailByNo(report.id, 1).then((r) => {
  1438. linkTo(`/paper/question/${r.id}`);
  1439. });
  1440. }}>回顾</Button></td></tr>;
  1441. </tbody>
  1442. </table>
  1443. </div>
  1444. </div>;
  1445. }
  1446. }