|
@@ -89,7 +89,7 @@ function BarOption3(titles, source, data1, data2, color1, color2) {
|
|
|
yAxisIndex: 0,
|
|
|
barWidth: 30,
|
|
|
data: data1.map((item, index) => ({
|
|
|
- value: item,
|
|
|
+ value: formatPercent(item[0], item[1], true),
|
|
|
itemStyle: { color: index % 2 ? color1[0] : color1[1] },
|
|
|
label: {
|
|
|
show: true,
|
|
@@ -97,7 +97,7 @@ function BarOption3(titles, source, data1, data2, color1, color2) {
|
|
|
align: 'right',
|
|
|
position: [360, 5],
|
|
|
fontSize: 16,
|
|
|
- formatter: item,
|
|
|
+ formatter: `${item[0]}/${item[1]} ${formatPercent(item[0], item[1], false)}`,
|
|
|
},
|
|
|
})),
|
|
|
},
|
|
@@ -107,7 +107,7 @@ function BarOption3(titles, source, data1, data2, color1, color2) {
|
|
|
yAxisIndex: 1,
|
|
|
barWidth: 30,
|
|
|
data: data2.map((item, index) => ({
|
|
|
- value: item,
|
|
|
+ value: parseInt(item, 10),
|
|
|
itemStyle: { color: index % 2 ? color2[0] : color2[1] },
|
|
|
label: {
|
|
|
show: true,
|
|
@@ -115,7 +115,7 @@ function BarOption3(titles, source, data1, data2, color1, color2) {
|
|
|
align: 'right',
|
|
|
fontSize: 16,
|
|
|
position: [360, 5],
|
|
|
- formatter: item,
|
|
|
+ formatter: formatMinuteSecond(parseInt(item, 10)),
|
|
|
},
|
|
|
})),
|
|
|
},
|
|
@@ -130,7 +130,7 @@ function BarOption2(title, data, legend, color) {
|
|
|
textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
|
|
|
},
|
|
|
tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
+ trigger: 'item',
|
|
|
},
|
|
|
legend: {
|
|
|
show: legend.length > 1,
|
|
@@ -169,7 +169,10 @@ function lineOption1(title, data, legend, color) {
|
|
|
left: '0',
|
|
|
},
|
|
|
tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: (params) => {
|
|
|
+ return formatSeconds(params.value[params.seriesIndex + 1]);
|
|
|
+ },
|
|
|
},
|
|
|
legend: {
|
|
|
show: legend.length > 1,
|
|
@@ -202,6 +205,10 @@ function lineOption1(title, data, legend, color) {
|
|
|
}
|
|
|
|
|
|
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,
|
|
@@ -274,7 +281,7 @@ function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
- formatter: `{a|${value}}`,
|
|
|
+ formatter: `{a|${formatSeconds(value)}}`,
|
|
|
rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
|
|
|
},
|
|
|
},
|
|
@@ -284,7 +291,7 @@ function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
- formatter: `{a|${allValue}}`,
|
|
|
+ formatter: `{a|全站${formatSeconds(allValue)}}`,
|
|
|
rich: { a: { fontSize: 12, color: '#686872' } },
|
|
|
},
|
|
|
},
|
|
@@ -303,7 +310,7 @@ function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
- formatter: `{a|${avgCorrect}}`,
|
|
|
+ formatter: `{a|${formatSeconds(avgCorrect)}}`,
|
|
|
rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
|
|
|
},
|
|
|
},
|
|
@@ -314,7 +321,7 @@ function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
- formatter: `{a|${avgIncorrent}}`,
|
|
|
+ formatter: `{a|${formatSeconds(avgIncorrent)}}`,
|
|
|
rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
|
|
|
},
|
|
|
},
|
|
@@ -529,42 +536,46 @@ export default class extends Page {
|
|
|
default:
|
|
|
}
|
|
|
this.setState({ report: result, paper: result.paper });
|
|
|
- });
|
|
|
- switch (info) {
|
|
|
- case 'question':
|
|
|
- // 题目回顾列表
|
|
|
- Question.questionReport(id).then(result => {
|
|
|
- switch (result.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;
|
|
|
+ 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.diff = QuestionDifficultSort[row.question.difficult];
|
|
|
+ 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;
|
|
|
- }
|
|
|
+ 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() {
|
|
@@ -608,11 +619,11 @@ export default class extends Page {
|
|
|
order = field;
|
|
|
// direction = 'desc';
|
|
|
}
|
|
|
- list.sort((a, b) => {
|
|
|
+ list.sort((b, a) => {
|
|
|
const aValue = a[order];
|
|
|
- const bValue = a[order];
|
|
|
+ const bValue = b[order];
|
|
|
if (aValue === bValue) {
|
|
|
- return a.no < b.no ? -1 : a.no > b.no ? 1 : 0;
|
|
|
+ return b.no - a.no;
|
|
|
}
|
|
|
return aValue > bValue ? -1 : 1;
|
|
|
});
|
|
@@ -849,13 +860,11 @@ export default class extends Page {
|
|
|
<div className="detail">
|
|
|
<div className="block">
|
|
|
<div className="t1">总耗时</div>
|
|
|
- <div className="t2">{formatMinute(detail.info.userTime, true)}</div>
|
|
|
- <div className="t3">min</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">{formatMinute(detail.info.userTime - detail.info.time, true)}</div>
|
|
|
- <div className="t3">min</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">
|
|
@@ -923,8 +932,8 @@ export default class extends Page {
|
|
|
this.questionSort('correct');
|
|
|
}}>正误<GIcon name={order === 'correct' ? 'arrow-down' : 'arrow-up'} active={order === 'correct'} /></th>
|
|
|
<th className="point" onClick={() => {
|
|
|
- this.questionSort('diff');
|
|
|
- }}>难度<GIcon name={order === 'diff' ? 'arrow-down' : 'arrow-up'} active={order === 'diff'} /></th>
|
|
|
+ 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>
|
|
@@ -978,13 +987,11 @@ export default class extends Page {
|
|
|
<div className="detail">
|
|
|
<div className="block">
|
|
|
<div className="t1">总耗时</div>
|
|
|
- <div className="t2">{formatMinute(info.userTime, true)}</div>
|
|
|
- <div className="t3">min</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">{formatMinute(info.userTime - info.time, true)}</div>
|
|
|
- <div className="t3">min</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">
|
|
@@ -1019,11 +1026,11 @@ export default class extends Page {
|
|
|
<div className="detail-1">
|
|
|
<div className="block">
|
|
|
<div className="t1">平均用时</div>
|
|
|
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime / info.userNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '$1<div class="t3">$2</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]+)(m|min|h|hour|s)/g, '$1<div class="t3">$2</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
|
|
@@ -1072,7 +1079,7 @@ export default class extends Page {
|
|
|
<div className="detail-1">
|
|
|
<div className="block">
|
|
|
<div className="t1">平均用时</div>
|
|
|
- <div className="t2" dangerouslySetInnerHTML={{ __html: formatSeconds(info.userTime / info.userNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '$1<div class="t3">$2</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>
|
|
@@ -1087,7 +1094,7 @@ export default class extends Page {
|
|
|
return row.key;
|
|
|
}),
|
|
|
place.map(row => {
|
|
|
- return formatPercent(row.userCorrect, row.userNumber);
|
|
|
+ return [row.userCorrect, row.userNumber];
|
|
|
}),
|
|
|
place.map(row => {
|
|
|
return row.userTime / row.userNumber;
|
|
@@ -1160,31 +1167,25 @@ export default class extends Page {
|
|
|
<div className="block">
|
|
|
<div className="t1">总耗时</div>
|
|
|
<div className="t1">
|
|
|
- <div className="t2">{formatMinute((subject.verbal || {}).userTime, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">{formatMinute((subject.quant || {}).userTime, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">{formatMinute((subject.ir || {}).userTime, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">{formatMinute((subject.verbal || {}).userTime - (subject.verbal || {}).time, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">{formatMinute((subject.quant || {}).userTime - (subject.quant || {}).time, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">{formatMinute((subject.ir || {}).userTime - (subject.ir || {}).time, true)}</div>
|
|
|
- <div className="t3">min</div>
|
|
|
+ <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">
|
|
@@ -1235,7 +1236,7 @@ export default class extends Page {
|
|
|
<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]+)(m|min|h|hour|s)/g, '$1<div class="t3">$2</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
|
|
@@ -1418,7 +1419,7 @@ export default class extends Page {
|
|
|
return row.key;
|
|
|
}),
|
|
|
subjectDetail.place.map(row => {
|
|
|
- return formatPercent(row.userCorrect, row.userNumber);
|
|
|
+ return [row.userCorrect, row.userNumber];
|
|
|
}),
|
|
|
subjectDetail.place.map(row => {
|
|
|
return row.userTime / row.userNumber;
|