Commit 64c84ff2 by zhujian

'fix;bug'

parent e75fa81d
...@@ -173,7 +173,7 @@ class GraphicsEditor extends React.Component { ...@@ -173,7 +173,7 @@ class GraphicsEditor extends React.Component {
const textLength = this.editorInt.txt.text().replace(/\&nbsp\;/ig, ' ').length + videoCount + imageCount; const textLength = this.editorInt.txt.text().replace(/\&nbsp\;/ig, ' ').length + videoCount + imageCount;
this.setState({ textLength }, () => { this.setState({ textLength }, () => {
if (textLength > maxLimit) { if (textLength > maxLimit) {
message.warning('超过字数限定'); // message.warning('超过字数限定');
} }
onChange(html, this.state.textLength); onChange(html, this.state.textLength);
}) })
......
...@@ -365,8 +365,8 @@ function AddExam(props: any) { ...@@ -365,8 +365,8 @@ function AddExam(props: any) {
checked={needPhone == 'NEED_PHONE_VERIFY'} checked={needPhone == 'NEED_PHONE_VERIFY'}
onChange={(val) => { setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY') }} onChange={(val) => { setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY') }}
></Switch> ></Switch>
<div style={{ position: 'relative', top: 3, left: 8, color: "#999" }}><p>开启:需要验证手机号才能参加考试</p> <div style={{ position: 'relative', top: 3, left: 8, color: "#999" }}><p>开启:需要绑定手机号的用户才能参加考试</p>
<p>关闭:仅需微信/企业微信授权登录验证</p></div> <p>关闭:微信/企业微信登陆直接参加考试</p></div>
</div> </div>
</Form.Item> </Form.Item>
......
...@@ -109,7 +109,7 @@ function ExamData(props: any) { ...@@ -109,7 +109,7 @@ function ExamData(props: any) {
dataIndex: "questionStem", dataIndex: "questionStem",
ellipsis: true, ellipsis: true,
width: 350, width: 350,
render: (val:any) => { render: (val: any) => {
var handleVal = val; var handleVal = val;
handleVal = handleVal.replace(/<(?!img|input).*?>/g, ""); handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、"); handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
...@@ -177,7 +177,7 @@ function ExamData(props: any) { ...@@ -177,7 +177,7 @@ function ExamData(props: any) {
if (filters.questionType) { if (filters.questionType) {
console.log(233232) console.log(233232)
_query.questionType = filters.questionType; _query.questionType = filters.questionType;
_query.current =1; _query.current = 1;
} else { } else {
delete _query.questionType delete _query.questionType
} }
...@@ -213,31 +213,47 @@ function ExamData(props: any) { ...@@ -213,31 +213,47 @@ function ExamData(props: any) {
style={{ position: "absolute", left: "-10000px" }} style={{ position: "absolute", left: "-10000px" }}
></a> ></a>
<div className="dataPanal"> <div className="dataPanal">
<div className="item"> {
!!examData.singleChoiceCnt && <div className="item">
<div className="num">{(examData.singleChoiceAccuracy || 0) * 100}%</div> <div className="num">{(examData.singleChoiceAccuracy || 0) * 100}%</div>
<div className="percent">正确率</div> <div className="percent">正确率</div>
<div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fa;</span> 单选题 <span>(共{examData.singleChoiceCnt}题)</span></div></div> <div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fa;</span> 单选题 <span>(共{examData.singleChoiceCnt}题)</span></div></div>
</div> </div>
<div className="item"> }
{
!!examData.multiChoiceCnt && <div className="item">
<div className="num">{(examData.multiChoiceAccuracy || 0) * 100}%</div> <div className="num">{(examData.multiChoiceAccuracy || 0) * 100}%</div>
<div className="percent">正确率</div> <div className="percent">正确率</div>
<div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fb;</span>多选题 <span>(共{examData.multiChoiceCnt}题)</span></div></div> <div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fb;</span>多选题 <span>(共{examData.multiChoiceCnt}题)</span></div></div>
</div> </div>
<div className="item"> }
{
!!examData.judgeCnt && <div className="item">
<div className="num">{(examData.judgeAccuracy || 0) * 100}%</div> <div className="num">{(examData.judgeAccuracy || 0) * 100}%</div>
<div className="percent">正确率</div> <div className="percent">正确率</div>
<div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fc;</span>判断题 <span>(共{examData.judgeCnt}题)</span></div></div> <div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fc;</span>判断题 <span>(共{examData.judgeCnt}题)</span></div></div>
</div> </div>
<div className="item"> }
{
!!examData.gapFillingCnt && <div className="item">
<div className="num">{(examData.gapFillingAccuracy || 0) * 100}%</div> <div className="num">{(examData.gapFillingAccuracy || 0) * 100}%</div>
<div className="percent">正确率</div> <div className="percent">正确率</div>
<div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fd;</span>填空题 <span>(共{examData.gapFillingCnt}题)</span></div></div> <div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fd;</span>填空题 <span>(共{examData.gapFillingCnt}题)</span></div></div>
</div> </div>
<div className="item"> }
{
!!examData.indefiniteChoiceCnt && <div className="item">
<div className="num">{(examData.indefiniteChoiceAccuracy || 0) * 100}%</div> <div className="num">{(examData.indefiniteChoiceAccuracy || 0) * 100}%</div>
<div className="percent">正确率</div> <div className="percent">正确率</div>
<div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fe;</span>不定项选择题 <span>(共{examData.indefiniteChoiceCnt}题)</span></div></div> <div className="subTitle"><div className="type"><span className="icon iconfont">&#xe7fe;</span>不定项选择题 <span>(共{examData.indefiniteChoiceCnt}题)</span></div></div>
</div> </div>
}
</div> </div>
{ {
!!allData && <Button style={{ marginBottom: 12, marginTop: 12 }} onClick={download} >导出</Button> !!allData && <Button style={{ marginBottom: 12, marginTop: 12 }} onClick={download} >导出</Button>
......
...@@ -48,6 +48,7 @@ class ExamShareModal extends React.Component { ...@@ -48,6 +48,7 @@ class ExamShareModal extends React.Component {
// 下载海报 // 下载海报
handleDownloadPoster = () => { handleDownloadPoster = () => {
const { data } = this.props;
const dom = document.querySelector('#poster'); const dom = document.querySelector('#poster');
html2canvas(dom, { html2canvas(dom, {
useCORS: true, useCORS: true,
...@@ -56,7 +57,7 @@ class ExamShareModal extends React.Component { ...@@ -56,7 +57,7 @@ class ExamShareModal extends React.Component {
const { courseName } = this.props.data; const { courseName } = this.props.data;
const dataUrl = canvas.toDataURL('image/png'); const dataUrl = canvas.toDataURL('image/png');
downloadDOM.href = dataUrl; downloadDOM.href = dataUrl;
downloadDOM.download = `${courseName}.png`; downloadDOM.download = `${data.examName}.png`;
downloadDOM.click(); downloadDOM.click();
}); });
} }
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
display: flex; display: flex;
.item{ .item{
text-align: center; text-align: center;
width: 29.9%; // width: 29.9%;
position: relative; position: relative;
flex: 1;
.num{ .num{
font-size: 26px; font-size: 26px;
...@@ -60,6 +61,12 @@ ...@@ -60,6 +61,12 @@
right: 0px; right: 0px;
} }
&:last-child{
&:after{
display: none;
}
}
} }
.exstatus{ .exstatus{
width: 4px; width: 4px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment