1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483 |
- import React from 'react';
- import { Link } from 'react-router-dom';
- import './index.less';
- import LineChart from '@src/components/LineChart';
- import BarChart from '@src/components/BarChart';
- import PieChart from '@src/components/PieChart';
- import Assets from '@src/components/Assets';
- import Page from '@src/containers/Page';
- import { formatDate, formatPercent, formatSeconds, formatMinute, formatSecond, formatMinuteSecond, getMap } from '@src/services/Tools';
- import { Icon, Tooltip } from 'antd';
- import { Question } from '../../../stores/question';
- import { Button } from '../../../components/Button';
- import Tabs from '../../../components/Tabs';
- import { Icon as GIcon } from '../../../components/Icon';
- import { QuestionNoteModal } from '../../../components/OtherModal';
- import { My } from '../../../stores/my';
- import {
- QuestionDifficult,
- ExaminationQuestionType,
- ExaminationSubject,
- } from '../../../../Constant';
- const QuestionDifficultMap = getMap(QuestionDifficult, 'value', 'label');
- const QuestionDifficultSort = getMap(QuestionDifficult, 'value', 'sort');
- function BarOption3(titles, source, data1, data2, color1, color2) {
- return {
- title: [
- {
- text: titles[0],
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: 100,
- top: 15,
- },
- {
- text: titles[1],
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: 195,
- top: 15,
- },
- {
- text: titles[2],
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: 695,
- top: 15,
- },
- ],
- grid: [{ width: 250, x: 200, bottom: 30 }, { width: 250, x: 700, bottom: 30 }],
- xAxis: [
- {
- gridIndex: 0,
- show: false,
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- },
- {
- gridIndex: 1,
- show: false,
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- },
- ],
- yAxis: [
- {
- gridIndex: 0,
- type: 'category',
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- offset: 15,
- data: source,
- axisLabel: { color: '#686872', fontSize: 16 },
- },
- {
- gridIndex: 1,
- type: 'category',
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- axisLabel: { show: false },
- },
- ],
- series: [
- {
- type: 'bar',
- xAxisIndex: 0,
- yAxisIndex: 0,
- barWidth: 30,
- data: data1.map((item, index) => ({
- value: formatPercent(item[0], item[1], true),
- itemStyle: { color: index % 2 ? color1[0] : color1[1] },
- label: {
- show: true,
- color: '#303036',
- align: 'right',
- position: [360, 5],
- fontSize: 16,
- formatter: `${item[0]}/${item[1]} ${formatPercent(item[0], item[1], false)}`,
- },
- })),
- },
- {
- type: 'bar',
- xAxisIndex: 1,
- yAxisIndex: 1,
- barWidth: 30,
- data: data2.map((item, index) => ({
- value: parseInt(item, 10),
- itemStyle: { color: index % 2 ? color2[0] : color2[1] },
- label: {
- show: true,
- color: '#303036',
- align: 'right',
- fontSize: 16,
- position: [360, 5],
- formatter: formatMinuteSecond(parseInt(item, 10)),
- },
- })),
- },
- ],
- };
- }
- function BarOption2(title, data, legend, color) {
- return {
- title: {
- text: title,
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- },
- tooltip: {
- trigger: 'item',
- formatter: (params) => {
- return `${params.value[params.seriesIndex + 1]}%`;
- },
- },
- legend: {
- show: legend.length > 1,
- data: legend,
- right: 20,
- },
- color,
- dataset: {
- source: [['type', ...legend], ...data],
- },
- grid: { left: 30, right: 30, height: 300 },
- xAxis: {
- type: 'category',
- axisLabel: { color: '#686872' },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- },
- yAxis: {
- type: 'value',
- min: 0,
- max: 100,
- axisLabel: { color: '#686872' },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- },
- series: legend.map(() => ({
- type: 'bar',
- barWidth: 40,
- })),
- };
- }
- function lineOption1(title, data, legend, color) {
- return {
- title: {
- text: title,
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: '0',
- },
- tooltip: {
- trigger: 'item',
- formatter: (params) => {
- return formatSeconds(params.value[params.seriesIndex + 1]);
- },
- },
- legend: {
- show: legend.length > 1,
- data: legend,
- right: 20,
- },
- color,
- grid: { left: 30, right: 30, height: 300 },
- xAxis: {
- type: 'category',
- axisLabel: { color: '#686872' },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- },
- yAxis: {
- type: 'value',
- min: 0,
- max: 100,
- axisLabel: { color: '#686872' },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- },
- dataset: {
- source: [['type', ...legend], ...data],
- },
- series: legend.map(() => ({
- type: 'line',
- smooth: true,
- symbol: 'circle',
- })),
- };
- }
- function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
- value = parseInt(value, 10);
- allValue = parseInt(allValue, 10);
- avgCorrect = parseInt(avgCorrect, 10);
- avgIncorrent = parseInt(avgIncorrent, 10);
- const xAxis1 = [
- {
- gridIndex: 0,
- type: 'category',
- axisTick: { show: false },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- splitLine: { show: false },
- },
- {
- gridIndex: 1,
- type: 'category',
- axisTick: { show: false },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- splitLine: { show: false },
- data: [
- {
- value: 'Avg Time\nCorrect',
- textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
- },
- {
- value: 'Avg Time\nIncorrect',
- textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
- },
- ],
- },
- ];
- const xAxis2 = {
- type: 'category',
- axisTick: { show: false },
- axisLine: { lineStyle: { color: '#D1D6DF' } },
- splitLine: { show: false },
- };
- const yAxis1 = [
- {
- gridIndex: 0,
- show: false,
- min: 0,
- max: 100,
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- },
- {
- gridIndex: 1,
- show: false,
- min: 0,
- max: 100,
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- },
- ];
- const yAxis2 = {
- show: false,
- min: 0,
- max: 100,
- axisTick: { show: false },
- axisLine: { show: false },
- splitLine: { show: false },
- };
- const data1 = {
- type: 'bar',
- barWidth: 50,
- xAxisIndex: 0,
- yAxisIndex: 0,
- data: [
- {
- value,
- itemStyle: { color: '#7AA7DC' },
- label: {
- show: true,
- position: 'top',
- formatter: `{a|${formatSeconds(value)}}`,
- rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
- },
- },
- {
- value: allValue,
- itemStyle: { color: '#598FCF' },
- label: {
- show: true,
- position: 'top',
- formatter: `{a|全站${formatSeconds(allValue)}}`,
- rich: { a: { fontSize: 12, color: '#686872' } },
- },
- },
- ],
- };
- const data2 = {
- type: 'bar',
- barWidth: 50,
- xAxisIndex: 1,
- yAxisIndex: 1,
- data: [
- {
- value: avgCorrect,
- name: 'Avg Time\nCorrect',
- itemStyle: { color: '#7775CA' },
- label: {
- show: true,
- position: 'top',
- formatter: `{a|${formatSeconds(avgCorrect)}}`,
- rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
- },
- },
- {
- value: avgIncorrent,
- name: 'Avg Time\nIncorrect',
- itemStyle: { color: '#9396C9' },
- label: {
- show: true,
- position: 'top',
- formatter: `{a|${formatSeconds(avgIncorrent)}}`,
- rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
- },
- },
- ],
- };
- return {
- title: [
- {
- text: title,
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: '0',
- },
- {
- text: 'Avg Time\nTotal',
- textAlign: 'center',
- textVerticalAlign: 'middle',
- textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
- bottom: '2%',
- left: '26%',
- },
- ],
- xAxis: avgCorrect ? xAxis1 : xAxis2,
- yAxis: avgCorrect ? yAxis1 : yAxis2,
- grid: avgCorrect ? [{ width: 200, x: 72 }, { width: 350, x: 272 }] : { width: 200, left: '30%' },
- series: avgCorrect ? [data1, data2] : [data1],
- };
- }
- function pieOption1(title, userCorrect, userNumber, totalCorrect, totalNumber) {
- const value = formatPercent(userCorrect, userNumber);
- const allValue = formatPercent(totalCorrect, totalNumber);
- return {
- title: [
- {
- text: title,
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: '0',
- },
- {
- text: `${value}%`,
- textAlign: 'center',
- textVerticalAlign: 'middle',
- textStyle: { color: value < 50 ? '#f19057' : '#7AA7DC', fontSize: 45 },
- subtext: `${userCorrect}/${userNumber}`,
- subtextStyle: { color: '#686872', fontSize: 16 },
- top: '35%',
- left: '49%',
- },
- ],
- series: [
- {
- type: 'pie',
- radius: ['64%', '70%'],
- label: {
- show: false,
- },
- hoverAnimation: false,
- animation: false,
- data: [
- {
- value: allValue,
- itemStyle: { color: '#7775CA' },
- label: {
- show: true,
- position: 'outside',
- formatter: `{a|全站用户}:{b|${allValue}%}`,
- rich: {
- a: {
- color: '#686872',
- fontSize: 16,
- },
- b: {
- color: '#6865FD',
- fontSize: 16,
- },
- },
- },
- },
- {
- value: 100 - allValue,
- itemStyle: { color: '#e1e1e1' },
- emphasis: { itemStyle: { color: '#e1e1e1' } },
- },
- ],
- },
- {
- type: 'pie',
- radius: ['45%', '61%'],
- label: {
- show: false,
- },
- hoverAnimation: false,
- animation: false,
- data: [
- { value, itemStyle: { color: value < 50 ? '#f19057' : '#7AA7DC' } },
- { value: 100 - value, itemStyle: { color: '#e1e1e1' }, emphasis: { itemStyle: { color: '#e1e1e1' } } },
- ],
- },
- ],
- };
- }
- function pieOption2(title, value1, value2, value3, total) {
- return {
- title: [
- {
- text: title,
- textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
- left: '0',
- },
- {
- text: `${total}`,
- textAlign: 'center',
- textVerticalAlign: 'middle',
- textStyle: { color: '#686872', fontSize: 60 },
- subtext: '综合实力',
- subtextStyle: { color: '#686872', fontSize: 14 },
- top: '35%',
- left: '49.5%',
- },
- ],
- series: [
- {
- type: 'pie',
- radius: ['50%', '80%'],
- startAngle: 30,
- hoverAnimation: false,
- animation: false,
- data: [
- {
- value: value1,
- itemStyle: { color: '#6865FD' },
- label: {
- position: 'outside',
- formatter: `{a|逻辑关系} {b|${value1}}`,
- rich: {
- a: {
- color: '#686872',
- fontSize: 18,
- },
- b: {
- color: '#6865FD',
- fontSize: 18,
- },
- },
- },
- },
- {
- value: value2,
- itemStyle: { color: '#6EC28D' },
- label: {
- position: 'outside',
- formatter: `{a|句子结构} {b|${value2}}`,
- rich: {
- a: {
- color: '#686872',
- fontSize: 18,
- },
- b: {
- color: '#6EC28D',
- fontSize: 18,
- },
- },
- },
- },
- {
- value: value3,
- itemStyle: { color: '#598FCF' },
- label: {
- position: 'outside',
- formatter: `{a|阅读速度} {b|${value3}}`,
- rich: {
- a: {
- color: '#686872',
- fontSize: 18,
- },
- b: {
- color: '#598FCF',
- fontSize: 18,
- },
- },
- },
- },
- ],
- },
- ],
- };
- }
- export default class extends Page {
- initState() {
- return { tab: 'main', report: { paperModule: '' } };
- }
- initData() {
- const { id } = this.params;
- const { info = '' } = this.state.search;
- Question.detailReport(id).then(result => {
- switch (result.paperModule) {
- case 'sentence':
- this.refreshSentence(result);
- break;
- case 'textbook':
- this.refreshTextbook(result);
- break;
- case 'exercise':
- this.refreshExercise(result);
- break;
- case 'examination':
- this.refreshExamination(result);
- break;
- default:
- }
- this.setState({ report: result, paper: result.paper });
- return result;
- })
- .then(report => {
- switch (info) {
- case 'question':
- // 题目回顾列表
- Question.questionReport(id).then(result => {
- switch (report.paperModule) {
- case 'sentence':
- result = result.map((row) => {
- row.struct = row.detail.subject && row.detail.predicate && row.detail.object ? 0 : 1;
- row.logic = row.detail.options ? 0 : 1;
- row.note = row.note ? 1 : 0;
- row.collect = row.collect ? 1 : 0;
- return row;
- });
- break;
- case 'textbook':
- case 'exercise':
- result = result.map((row) => {
- row.correct = row.isCorrect ? 0 : 1;
- row.difficult = QuestionDifficultSort[row.question.difficult];
- row.place = row.question.place;
- row.note = row.note ? 1 : 0;
- row.collect = row.collect ? 1 : 0;
- return row;
- });
- this.refreshExercise(result);
- break;
- default:
- }
- this.setState({ list: result });
- });
- break;
- default:
- break;
- }
- });
- }
- refreshSentence() {
- const { info = '' } = this.state.search;
- switch (info) {
- case 'question':
- break;
- default:
- }
- }
- refreshTextbook() {
- this.refreshExercise();
- }
- refreshExamination() {
- const { info = '' } = this.state.search;
- switch (info) {
- case 'score':
- break;
- default:
- }
- }
- refreshExercise() {
- const { info = '' } = this.state.search;
- switch (info) {
- case 'question':
- break;
- default:
- }
- }
- questionSort(field) {
- let { order } = this.state;
- const { list = [] } = this.state;
- if (order === field) {
- order = 'no';
- // direction = 'asc';
- } else {
- order = field;
- // direction = 'desc';
- }
- list.sort((b, a) => {
- const aValue = a[order];
- const bValue = b[order];
- if (aValue === bValue) {
- return b.no - a.no;
- }
- if (order === 'no') {
- return b.no - a.no;
- }
- return bValue > aValue ? -1 : 1;
- });
- // if (direction === 'desc') {
- // list.reverse();
- // }
- this.setState({ order, list });
- }
- toggleCollect(index) {
- const { list } = this.state;
- const userQuestion = list[index];
- if (!userQuestion.collect) {
- My.addQuestionCollect(userQuestion.questionNo.id).then(() => {
- userQuestion.collect = true;
- this.setState({ list });
- });
- } else {
- My.delQuestionCollect(userQuestion.questionNo.id).then(() => {
- userQuestion.collect = false;
- this.setState({ list });
- });
- }
- }
- note(index) {
- const { list } = this.state;
- const userQuestion = list[index];
- const { questionNo } = userQuestion;
- My.getQuestionNote(questionNo.id)
- .then(result => {
- this.setState({ questionNo, note: result || {}, showNote: true, index });
- });
- }
- renderView() {
- const { report = {}, search = {} } = this.state;
- const { info } = search;
- switch (report.paperModule) {
- case 'sentence':
- if (info === 'question') {
- return this.renderSentenceQuestion();
- }
- return this.renderSentence();
- case 'textbook':
- if (info === 'question') {
- return this.renderExerciseQuestion();
- }
- return this.renderTextbook();
- case 'exercise':
- if (info === 'question') {
- return this.renderExerciseQuestion();
- }
- return this.renderExercise();
- case 'examination':
- return this.renderExamination();
- default:
- return <div />;
- }
- }
- renderSentence() {
- const { paper = {}, report = {}, search = {} } = this.state;
- const { info } = search;
- const { user } = this.props;
- return (
- <div className="sentence">
- <div className="header">
- <div className="content">
- <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
- <div className="btns">
- <Button size="small" radius onClick={() => {
- linkTo('/');
- }}>返回首页</Button>
- {!info && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}?info=question`);
- }}>题目回顾</Button>}
- {info === 'question' && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}`);
- }}>详细报告</Button>}
- </div>
- <div className="right">
- <div className="text">{user.info.nickname}</div>
- <div className="desc">练习次数{paper.times + 1}</div>
- <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
- </div>
- </div>
- </div>
- {info === 'question' && this.renderSentenceQuestion()}
- {!info && this.renderSentenceDetail()}
- </div>
- );
- }
- renderTextbook() {
- return this.renderExercise();
- }
- renderExercise() {
- const { paper = {}, report = {}, search = {} } = this.state;
- const { info } = search;
- const { user } = this.props;
- return (
- <div className="exercise">
- <div className="header">
- <div className="content">
- <div className="title">Report for「练习」{paper.title}</div>
- <div className="btns">
- <Button size="small" radius onClick={() => {
- linkTo('/');
- }}>返回首页</Button>
- {!info && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}?info=question`);
- }}>题目回顾</Button>}
- {info === 'question' && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}`);
- }}>详细报告</Button>}
- </div>
- <div className="right">
- <div className="text">{user.info.nickname}</div>
- <div className="desc">练习次数{paper.times + 1}</div>
- <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
- </div>
- </div>
- </div>
- {info === 'question' && this.renderExerciseQuestion()}
- {!info && this.renderExerciseDetail()}
- </div>
- );
- }
- renderExamination() {
- const { paper = {}, report = {}, search = {} } = this.state;
- const { info } = search;
- const { user } = this.props;
- return (
- <div className="examination">
- <div className="header">
- <div className="content">
- <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
- <div className="btns">
- <Button size="small" radius onClick={() => {
- linkTo('/');
- }}>返回首页</Button>
- {!info && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}?info=score`);
- }}>成绩单</Button>}
- {info === 'score' && <Button size="small" radius onClick={() => {
- linkTo(`/paper/report/${report.id}`);
- }}>详细报告</Button>}
- </div>
- <div className="right">
- <div className="text">{user.info.nickname}</div>
- <div className="desc">练习次数{paper.times + 1}</div>
- <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
- </div>
- </div>
- </div>
- {info === 'score' && this.renderExaminationScore()}
- {!info && this.renderExaminationDetail()}
- </div>
- );
- }
- renderSentenceQuestion() {
- const { report, list, order, showNote, note = {}, questionNo = {} } = this.state;
- return <div className='sentence question'>
- <div className='header'>
- <div className='content'>
- <div className='title'>题目回顾</div>
- <Button className='back' radius onClick={() => {
- linkTo(`/paper/report/${report.id}`);
- }}>返回长难句报告</Button>
- </div>
- </div>
- <div className='body'>
- <div className='content'>
- <div className='tip'><Assets name='notice' />点击题目查看详情</div>
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th width='420'>题目</th>
- <th className="point" onClick={() => {
- this.questionSort('struct');
- }}>句子结构<GIcon name={order === 'struct' ? 'arrow-down' : 'arrow-up'} active={order === 'struct'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('logic');
- }}>逻辑关系<GIcon name={order === 'logic' ? 'arrow-down' : 'arrow-up'} active={order === 'logic'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('userTime');
- }}>用时<GIcon name={order === 'userTime' ? 'arrow-down' : 'arrow-up'} active={order === 'userTime'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('collect');
- }}>收藏<GIcon name={order === 'collect' ? 'arrow-down' : 'arrow-up'} active={order === 'collect'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('note');
- }}>笔记<GIcon name={order === 'note' ? 'arrow-down' : 'arrow-up'} active={order === 'note'} /></th>
- </tr>
- </thead>
- <tbody>
- {(list || []).map((row, index) => {
- return <tr>
- <td>{row.no}</td>
- <td>
- <div className='n'><Link to={`/paper/question/${row.id}`}>{(row.questionNo || {}).title}</Link></div>
- <div className='desc'>{row.question.description}</div>
- </td>
- <td><GIcon name={row.detail.subject && row.detail.predicate && row.detail.object ? 'right' : 'error'} noHover /></td>
- <td><GIcon name={row.detail.options ? 'right' : 'error'} noHover /></td>
- <td>{formatMinuteSecond(row.userTime)}</td>
- <td><GIcon name='star' active={row.collect} onClick={() => this.toggleCollect(index)} /></td>
- <td><GIcon name='note' active={row.note} onClick={() => this.note(index)} /></td>
- </tr>;
- })}
- </tbody>
- </table>
- </div>
- </div>
- <QuestionNoteModal show={showNote} defaultData={note} questionNo={questionNo} onConfirm={() => {
- list[this.state.index].note = true;
- this.setState({ showNote: false, list });
- }} onCancel={() => this.setState({ showNote: false })} />
- </div>;
- }
- renderSentenceDetail() {
- const { report = {} } = this.state;
- const { detail = {} } = report;
- return <div>
- <div className="body">
- <div className="content">
- <div className="title">完成情况</div>
- <div className="detail">
- <div className="block">
- <div className="t1">总耗时</div>
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
- </div>
- {detail.info.userTime > detail.info.time && <div className="block">
- <div className="t1">超出建议用时</div>
- <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>') }} />
- </div>}
- <div className="line" />
- <div className="block">
- <div className="t1">完成题目</div>
- <div className="t2">{detail.info.userNumber}</div>
- <div className="t3">题</div>
- </div>
- {detail.info.userNumber !== detail.info.questionNumber && <div className="block">
- <div className="t1">剩余未做</div>
- <div className="t2">{detail.info.questionNumber || 0 - detail.info.userNumber}</div>
- <div className="t3">题</div>
- </div>}
- </div>
- </div>
- </div>
- <div className="body gray">
- <div className="content">
- <div className="title">基本情况</div>
- <div className="block-wrapper">
- <div className="block">
- <PieChart option={pieOption1('正确率', detail.info.userCorrect, detail.info.userNumber, detail.info.totalCorrect, detail.info.totalNumber)} />
- </div>
- <div className="block">
- <BarChart option={barOption1('用时', detail.info.userTime / detail.info.userNumber, detail.info.totalTime / detail.info.totalNumber, detail.info.correctTime, detail.info.incorrectTime)} />
- </div>
- </div>
- </div>
- </div>
- <div className="body">
- <div className="content">
- <div className="title">能力评估</div>
- <PieChart option={pieOption2('综合得分', detail.ability.logic, detail.ability.struct, detail.ability.speed, detail.ability.score)} />
- </div>
- </div>
- <div className="body gray">
- <div className="content t-c">
- <Button size="lager" width={200} radius onClick={() => linkTo('/exercise?tab=sentence')}>
- 继续做题
- </Button>
- </div>
- </div>
- </div>;
- }
- renderExerciseQuestion() {
- const { report, list, order, showNote, note = {}, questionNo = {} } = this.state;
- return <div className='sentence question'>
- <div className='header'>
- <div className='content'>
- <div className='title'>题目回顾</div>
- <Button className='back' radius onClick={() => {
- linkTo(`/paper/report/${report.id}`);
- }}>返回练习报告</Button>
- </div>
- </div>
- <div className='body'>
- <div className='content'>
- <div className='tip'><Assets name='notice' />点击题目查看详情</div>
- <table>
- <thead>
- <tr>
- <th>序号</th>
- <th width='340'>题目</th>
- <th className="point" onClick={() => {
- this.questionSort('correct');
- }}>正误<GIcon name={order === 'correct' ? 'arrow-down' : 'arrow-up'} active={order === 'correct'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('difficult');
- }}>难度<GIcon name={order === 'difficult' ? 'arrow-down' : 'arrow-up'} active={order === 'difficult'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('userTime');
- }}>用时<GIcon name={order === 'userTime' ? 'arrow-down' : 'arrow-up'} active={order === 'userTime'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('place');
- }}>主要考点<GIcon name={order === 'place' ? 'arrow-down' : 'arrow-up'} active={order === 'place'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('collect');
- }}>收藏<GIcon name={order === 'collect' ? 'arrow-down' : 'arrow-up'} active={order === 'collect'} /></th>
- <th className="point" onClick={() => {
- this.questionSort('note');
- }}>笔记<GIcon name={order === 'note' ? 'arrow-down' : 'arrow-up'} active={order === 'note'} /></th>
- </tr>
- </thead>
- <tbody>
- {(list || []).map((row, index) => {
- return <tr>
- <td>{row.no}</td>
- <td>
- <div className='n'><Link to={`/paper/question/${row.id}`}>{(row.questionNo || {}).title}</Link></div>
- <div className='desc'>{row.question.description}</div>
- </td>
- <td><GIcon name={row.isCorrect ? 'right' : 'error'} noHover /></td>
- <td>{row.question.difficult}</td>
- <td>{formatMinuteSecond(row.userTime)}</td>
- <td>{row.question.place}</td>
- <td><GIcon name='star' active={row.collect} onClick={() => this.toggleCollect(index)} /></td>
- <td><GIcon name='note' active={row.note} onClick={() => this.note(index)} /></td>
- </tr>;
- })}
- </tbody>
- </table>
- </div>
- </div>
- <QuestionNoteModal show={showNote} defaultData={note} questionNo={questionNo} onConfirm={() => {
- list[this.state.index].note = true;
- this.setState({ showNote: false, list });
- }} onCancel={() => this.setState({ showNote: false })} />
- </div>;
- }
- renderExerciseDetail() {
- const { report = {} } = this.state;
- let { detail = {} } = report;
- detail = detail || {};
- const { pace = [], info = {}, difficult = [], place = [], limit = {} } = detail;
- return <div>
- <div className="body">
- <div className="content">
- <div className="title">完成情况</div>
- <div className="detail">
- <div className="block">
- <div className="t1">总耗时</div>
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
- </div>
- {info.userTime > info.time && <div className="block">
- <div className="t1">超出建议用时</div>
- <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>') }} />
- </div>}
- <div className="line" />
- <div className="block">
- <div className="t1">完成题目</div>
- <div className="t2">{info.userNumber}</div>
- <div className="t3">题</div>
- </div>
- {info.userNumber !== info.questionNumber && <div className="block">
- <div className="t1">剩余未做</div>
- <div className="t2">{info.questionNumber - info.userNumber}</div>
- <div className="t3">题</div>
- </div>}
- </div>
- </div>
- </div>
- <div className="body gray">
- <div className="content">
- <div className="title">基本情况</div>
- <div className="block-wrapper">
- <div className="block">
- <PieChart option={pieOption1('正确率', info.userCorrect, info.userNumber, info.totalCorrect, info.totalNumber)} />
- </div>
- <div className="block">
- <BarChart option={barOption1('用时', info.userTime / info.userNumber, info.totalTime / info.totalNumber, info.correctTime, info.incorrectTime)} />
- </div>
- </div>
- </div>
- </div>
- <div className="body">
- <div className="content">
- <div className="title">PACE</div>
- <div className="detail-1">
- <div className="block">
- <div className="t1">平均用时</div>
- <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>') }} />
- </div>
- <div className="block all">
- <div className="t1">全站用户</div>
- <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>') }} />
- </div>
- </div>
- <LineChart
- height={400}
- option={lineOption1(
- '每题用时情况',
- pace.map(row => {
- return [`${row.no}`, row.userTime, row.time];
- }),
- ['我的', '全站'],
- ['#7AA7DC', '#8684df'],
- )}
- />
- </div>
- </div>
- {report.paperModule !== 'textbook' && <div className="body gray">
- <div className="content">
- <div className="title">难度分析</div>
- <div className="detail-1">
- <div className="block">
- <div className="t1">正确率</div>
- <div className="t2">{formatPercent(info.userCorrect, info.userNumber, false)}</div>
- </div>
- <div className="block all">
- <div className="t1">全站用户</div>
- <div className="t2">{formatPercent(info.totalCorrect, info.totalNumber, false)}</div>
- </div>
- </div>
- <BarChart
- height={400}
- option={BarOption2(
- '正确率',
- difficult.map(row => {
- return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber), formatPercent(row.totalCorrect, row.totalNumber)];
- }),
- ['我的', '全站'],
- ['#8684df', '#5195e5'],
- )}
- />
- </div>
- </div>}
- <div className="body">
- <div className="content">
- <div className="title">知识体系分析</div>
- <div className="detail-1">
- <div className="block">
- <div className="t1">平均用时</div>
- <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>') }} />
- </div>
- <div className="block all">
- <div className="t1">正确率</div>
- <div className="t2">{formatPercent(info.userCorrect, info.userNumber, false)}</div>
- </div>
- </div>
- <BarChart
- height={400}
- option={BarOption3(
- ['知识点', '正确率分析', '用时分析'],
- place.map(row => {
- return row.key;
- }),
- place.map(row => {
- return [row.userCorrect, row.userNumber];
- }),
- place.map(row => {
- return row.userTime / row.userNumber;
- }),
- ['#7AA7DC', '#BFD4EE'],
- ['#8684df', '#C3C3E5'],
- )}
- />
- </div>
- </div>
- <div className="body gray">
- <div className="content">
- <div className="title">实战提醒</div>
- {info.userTime > info.time && <div className="tip">
- <div className="t1">在实战限时情况下,本套题正确率为 </div>
- <div className="t2">{formatPercent(limit.userCorrect, limit.userNumber)}</div>
- <Tooltip title="仅统计在建议时间内完成题目正确率情况,更接近实战表现"><Icon type="question-circle" theme="filled" /></Tooltip>
- </div>}
- {info.userTime <= info.time && <div className="tip">
- <div className="t1">目前的做题速度已达到实战标准!很棒!请继续保持!</div>
- </div>}
- </div>
- </div>
- <div className="body">
- <div className="content t-c">
- <Button size="lager" width={200} radius onClick={() => linkTo('/exercise')}>
- 继续做题
- </Button>
- </div>
- </div>
- </div>;
- }
- renderTextbookQuestion() {
- return this.renderExerciseQuestion();
- }
- renderExaminationDetail() {
- const { report = {}, tab } = this.state;
- const { detail = {} } = report;
- const { subject = {} } = detail;
- const subjectDetail = tab === 'main' ? null : (subject || {})[tab] || { info: {}, defficlt: [], place: [], pace: [] };
- return <div>
- <div className="body">
- <div className="content">
- <Tabs
- type="division"
- theme="gray"
- active={tab}
- space={7}
- tabs={[
- { key: 'main', name: '总览 Overview' },
- { key: 'verbal', name: '语文 Verbal' },
- { key: 'quant', name: '数学 Quant' },
- { key: 'ir', name: '综合推理 IR' },
- ]}
- onChange={(value) => {
- this.setState({ tab: value });
- }}
- />
- {!subjectDetail && <div className="list">
- <div className="title">完成情况</div>
- <div className="detail">
- <div className="block">
- <div className="t1" />
- <div className="t4">Verbal</div>
- <div className="t4">Quant</div>
- <div className="t4">IR</div>
- </div>
- <div className="block">
- <div className="t1">总耗时</div>
- <div className="t1">
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.verbal || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
- </div>
- <div className="t1">
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.quant || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
- </div>
- <div className="t1">
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds((subject.ir || {}).userTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '$1<div class="t3">$2</div>') }} />
- </div>
- </div>
- <div className="block">
- <div className="t1">超出建议用时</div>
- <div className="t1">
- <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>') }} />
- </div>
- <div className="t1">
- <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>') }} />
- </div>
- <div className="t1">
- <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>') }} />
- </div>
- </div>
- <div className="block">
- <div className="t1" />
- <div className="t1">
- <div className="line" />
- </div>
- <div className="t1">
- <div className="line" />
- </div>
- <div className="t1">
- <div className="line" />
- </div>
- </div>
- <div className="block">
- <div className="t1">完成题目</div>
- <div className="t1">
- <div className="t2">{(subject.verbal || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- <div className="t1">
- <div className="t2">{(subject.quant || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- <div className="t1">
- <div className="t2">{(subject.ir || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- </div>
- <div className="block">
- <div className="t1">剩余未做</div>
- <div className="t1">
- <div className="t2">{(subject.verbal || {}).questionNumber - (subject.verbal || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- <div className="t1">
- <div className="t2">{(subject.quant || {}).questionNumber - (subject.quant || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- <div className="t1">
- <div className="t2">{(subject.ir || {}).questionNumber - (subject.ir || {}).userNumber}</div>
- <div className="t3">题</div>
- </div>
- </div>
- </div></div>}
- {subjectDetail && <div>
- <div className="title">PACE</div>
- <div className="detail-1">
- <div className="block">
- <div className="t1">平均用时</div>
- <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>') }} />
- </div>
- </div>
- <LineChart
- height={400}
- option={lineOption1(
- '每题用时情况',
- subjectDetail.pace.map(row => {
- return [`${row.no}`, row.userTime];
- }),
- ['我的'],
- ['#A3A8BF'],
- )}
- />
- <div className="m-b-4" />
- <LineChart
- height={400}
- option={lineOption1(
- '累计用时情况',
- (function (sd) {
- let userTime = 0;
- let time = 0;
- sd.pace.map(row => {
- userTime += row.userTime;
- time += row.time;
- return [`${row.no}`, userTime, time];
- });
- }(subjectDetail)),
- ['我的', '建议'],
- ['#A3A8BF', '#7AA7DC'],
- )}
- />
- </div>}
- </div>
- </div>
- {!subjectDetail && <div className="body gray">
- <div className="content">
- <div className="title">成绩单</div>
- <table>
- <thead>
- <tr>
- <th>Question format</th>
- <th>Total</th>
- <th>Correct</th>
- <th>%Correct</th>
- <th>
- Avg Time
- </th>
- <th>
- Avg Time
- <br />
- Correct
- </th>
- <th>
- Avg Time
- <br />
- Incorrect
- </th>
- <th>
- Avg Diff
- <br />
- Correct
- </th>
- <th>
- Avg Diff
- <br />
- Incorrect
- </th>
- </tr>
- </thead>
- <tbody>
- {ExaminationQuestionType.map(row => {
- const typeDetail = detail.type[row.value];
- return <tr>
- <td>{row.long}</td>
- <td>{typeDetail.info.questionNumber}</td>
- <td>{typeDetail.info.userCorrect}</td>
- <td>
- {formatPercent(typeDetail.info.userCorrect, typeDetail.info.userNumber)}
- </td>
- <td>
- {formatSecond(typeDetail.info.userTime / typeDetail.info.userNumber)}
- </td>
- <td>
- {formatSecond(typeDetail.info.correctTime / typeDetail.info.userCorrect)}
- </td>
- <td>
- {formatSecond(typeDetail.info.incorrectTime / typeDetail.info.userNumber - typeDetail.info.userCorrect)}
- </td>
- <td>{typeDetail.info.avgDiffCorrect}</td>
- <td>{typeDetail.info.avgDiffIncorrect}</td>
- </tr>;
- })}
- </tbody>
- </table>
- </div>
- </div>}
- {subjectDetail && <div className="body gray">
- <div className="content">
- <div className="title">基本情况</div>
- <table>
- <thead>
- <tr>
- <th>%Correct</th>
- <th>Avg Time</th>
- <th>
- Avg Time
- <br />
- Correct
- </th>
- <th>
- Avg Time
- <br />
- Incorrect
- </th>
- <th>
- Avg Diff
- <br />
- Correct
- </th>
- <th>
- Avg Diff
- <br />
- Incorrect
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- {formatPercent(subjectDetail.info.userCorrect, subjectDetail.info.userNumber)}
- <br />
- <span>{subjectDetail.info.userCorrect}题/{subjectDetail.info.userNumber}题</span>
- </td>
- <td>
- {formatSecond(subjectDetail.info.userTime / subjectDetail.info.userNumber)}
- <br />
- <span>{formatMinute(subjectDetail.info.userTime)}min/{subjectDetail.info.userNumber}题</span>
- </td>
- <td>
- {formatSecond(subjectDetail.info.correctTime / subjectDetail.info.userCorrect)}
- <br />
- <span>{formatMinute(subjectDetail.info.correctTime)}min/{subjectDetail.info.userCorrect}题</span>
- </td>
- <td>
- {formatSecond(subjectDetail.info.incorrectTime / subjectDetail.info.userNumber - subjectDetail.info.userCorrect)}
- <br />
- <span>{formatMinute(subjectDetail.info.incorrectTime)}min/{subjectDetail.info.userNumber}题</span>
- </td>
- <td>{subjectDetail.info.avgDiffCorrect}</td>
- <td>{subjectDetail.info.avgDiffIncorrect}</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>}
- {subjectDetail && <div className="body">
- <div className="content">
- <div className="title">难度分析</div>
- <BarChart
- height={400}
- option={BarOption2(
- '正确率',
- subjectDetail.difficult.map(row => {
- return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber)];
- }),
- ['我的'],
- ['#989FC1'],
- )}
- />
- </div>
- </div>}
- {subjectDetail && <div className="body gray">
- <div className="content">
- <div className="title">知识体系分析</div>
- <BarChart
- height={400}
- option={BarOption3(
- ['知识点', '正确率分析', '用时分析'],
- subjectDetail.place.map(row => {
- return row.key;
- }),
- subjectDetail.place.map(row => {
- return [row.userCorrect, row.userNumber];
- }),
- subjectDetail.place.map(row => {
- return row.userTime / row.userNumber;
- }),
- ['#92AFD2', '#BFD4EE'],
- ['#989FC1', '#CCCCDC'],
- )}
- />
- </div>
- </div>}
- </div >;
- }
- renderExaminationScore() {
- const { report = {} } = this.state;
- const { score } = report;
- return <div className="body">
- <div className="content">
- <div className="title">成绩单</div>
- <table>
- <thead>
- <tr>
- <th>学科</th>
- <th>分数</th>
- <th>排名</th>
- <th>题目</th>
- </tr>
- </thead>
- <tbody>
- {ExaminationSubject.map(row => {
- return <tr>
- <td>{row.long}</td>
- <td>{row.ignore ? '--' : score[`${row.value}Score`]}</td>
- <td>{row.ignore ? '--' : score[`${row.value}Rank`]}</td>
- <td><Button size="small" radius onClick={() => {
- Question.getDetailByNo(report.id, 1, row.value).then((r) => {
- linkTo(`/paper/question/${r.id}`);
- });
- }}>回顾</Button></td></tr>;
- })}
- <tr>
- <td>Total</td>
- <td>{score.totalScore}</td>
- <td>{score.totalRank}</td>
- <td><Button size="small" radius onClick={() => {
- Question.getDetailByNo(report.id, 1).then((r) => {
- linkTo(`/paper/question/${r.id}`);
- });
- }}>回顾</Button></td></tr>;
- </tbody>
- </table>
- </div>
- </div>;
- }
- }
|