dev_aliyun2
harry 5 years ago
parent 0a532d6984
commit 769584ca24

@ -179,7 +179,7 @@ class CommonWorkDetailIndex extends Component {
}
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
document.title=course_name === undefined ? "" : course_name;
document.title = course_name === undefined ? "" : course_name;
console.log(category_id)
return (
@ -205,32 +205,32 @@ class CommonWorkDetailIndex extends Component {
background: #fff;
}
`}</style>
{current_user && <CBreadcrumb items={[
{ to: current_user&&current_user.first_category_url , name: course_name},
{ to: `/classrooms/${courseId}/${moduleEngName}/${category_id}`, name: category_name },
window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/classrooms/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' },
// 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名”
window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name },
// window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' },
// { name: childModuleName }
]}></CBreadcrumb>}
<div style={{ width:'100%',height:'52px'}} >
<span className=" fl color-black summaryname" title={`${homework_name && homework_name.length > 36 ? homework_name : ''}`}
style={{height: 'auto'}}
>
{homework_name}
{/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */}
</span>
<CoursesListType
typelist={homework_status}
typesylename={"mt12"}
/>
{category && <a className="color-grey-6 fr font-16 ml30 mt5 mr20" onClick={this.goback} style={{ marginRight: '26px'}}>返回</a>}
{this.state.update_atta &&
{current_user && <CBreadcrumb items={[
{ to: current_user && current_user.first_category_url, name: course_name },
{ to: `/classrooms/${courseId}/${moduleEngName}/${category_id}`, name: category_name },
window.location.pathname.indexOf('appraise') == -1 ? {} : { to: `/classrooms/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' },
// 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名”
window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name },
// window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' },
// { name: childModuleName }
]}></CBreadcrumb>}
<div style={{ width: '100%', height: '52px' }} >
<span className=" fl color-black summaryname" title={`${homework_name && homework_name.length > 36 ? homework_name : ''}`}
style={{ height: 'auto' }}
>
{homework_name}
{/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */}
</span>
<CoursesListType
typelist={homework_status}
typesylename={"mt12"}
/>
{category && <a className="color-grey-6 fr font-16 ml30 mt5 mr20" onClick={this.goback} style={{ marginRight: '26px' }}>返回</a>}
{this.state.update_atta &&
<React.Fragment>
{this.state.accessoryVisible === true ? <AccessoryModal
{...this.props}
@ -251,30 +251,30 @@ class CommonWorkDetailIndex extends Component {
}
</div>
{ noTab !== true && <div className="stud-class-set bor-bottom-greyE floatSpinParent">
<div className="mt10 clearfix edu-back-white poll_list pl5">
<Link
onClick={() => this.setState({moduleName: '作品列表'})}
className={`${isListModule ? 'active' : '' } `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link
onClick={() => this.setState({moduleName: '作业描述'})}
className={`${childModuleName == '作业描述' ? 'active' : '' } `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link>
{view_answer == true && <Link
onClick={() => this.setState({moduleName: '参考答案'})}
className={`${childModuleName == '参考答案' ? 'active' : '' } `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
<Link
onClick={() => this.setState({moduleName: '设置'})}
className={`${childModuleName == '设置' ? 'active' : '' } `}
style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"}</Link>
{/* { this.props.tabRightComponents } */}
<React.Fragment>
<style>{`
{noTab !== true && <div className="stud-class-set bor-bottom-greyE floatSpinParent">
<div className="mt10 clearfix edu-back-white poll_list pl5">
<Link
onClick={() => this.setState({ moduleName: '作品列表' })}
className={`${isListModule ? 'active' : ''} `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link
onClick={() => this.setState({ moduleName: '作业描述' })}
className={`${childModuleName == '作业描述' ? 'active' : ''} `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link>
{view_answer == true && <Link
onClick={() => this.setState({ moduleName: '参考答案' })}
className={`${childModuleName == '参考答案' ? 'active' : ''} `}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
<Link
onClick={() => this.setState({ moduleName: '设置' })}
className={`${childModuleName == '设置' ? 'active' : ''} `}
style={{ paddingLeft: this.props.isAdmin() ? '38px' : '20px' }}
to={`/classrooms/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin() ? "设置" : "得分规则"}</Link>
{/* { this.props.tabRightComponents } */}
<React.Fragment>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
@ -369,102 +369,101 @@ class CommonWorkDetailIndex extends Component {
{/* 内容区 */}
<Switch {...this.props}>
{/* 作业设置 */}
{/* http://localhost:3007/classrooms/1309/homework/9300/setting */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/list"
render={
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homework/:workId/list"
render={
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作业设置 */}
{/* http://localhost:3007/classrooms/1309/homework/9300/setting */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
</Switch>
</div>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/list"
render={
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/common_homework/:workId/list"
render={
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/common_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/list"
render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/question"
render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/classrooms/:coursesId/group_homework/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
</Switch>
</div>
</div>
</div>
@ -473,4 +472,4 @@ class CommonWorkDetailIndex extends Component {
}
}
export default ( CommonWorkDetailIndex) ;
export default (CommonWorkDetailIndex);

@ -283,7 +283,7 @@ class ExerciseReviewAndAnswer extends Component {
changeQuestionStatus = (No, flag) => {
this.setState(
(prevState) => ({
question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }})
question_status: update(prevState.question_status, { [No]: { ques_status: { $set: flag } } })
})
)
}
@ -291,12 +291,12 @@ class ExerciseReviewAndAnswer extends Component {
showSetScore = (key, flag, position, type, id) => {
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
}),()=>{
if (position && type && (flag == undefined || flag==false)) {
$("#input_"+position+"_"+type).focus();
$("html").animate({ scrollTop: $("#Anchor_"+position+"_"+type).offset().top - 150 });
if(id){
exercise_questions: update(prevState.exercise_questions, { [key]: { setScore: { $set: flag == undefined || flag == false ? true : false } } })
}), () => {
if (position && type && (flag == undefined || flag == false)) {
$("#input_" + position + "_" + type).focus();
$("html").animate({ scrollTop: $("#Anchor_" + position + "_" + type).offset().top - 150 });
if (id) {
let { ajustSore } = this.state;
let obj = ajustSore.filter(obj => obj.id === id).length > 0;
if (!obj) {
@ -327,7 +327,7 @@ class ExerciseReviewAndAnswer extends Component {
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}})
ajustSore: update(prevState.ajustSore, { [index]: { setTip: { $set: "请输入数字" } } })
})
)
return;
@ -338,7 +338,7 @@ class ExerciseReviewAndAnswer extends Component {
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}})
ajustSore: update(prevState.ajustSore, { [index]: { inputSore: { $set: value }, setTip: { $set: "" } } })
})
)
}
@ -353,7 +353,7 @@ class ExerciseReviewAndAnswer extends Component {
var index = ajustSore.map(function (item) { return item.id; }).indexOf(id);
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}})
ajustSore: update(prevState.ajustSore, { [index]: { desc: { $set: value } } })
})
)
}
@ -372,7 +372,7 @@ class ExerciseReviewAndAnswer extends Component {
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}})
ajustSore: update(prevState.ajustSore, { [index]: { setTip: { $set: "请输入分数" } } })
})
)
return;
@ -383,7 +383,7 @@ class ExerciseReviewAndAnswer extends Component {
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}})
ajustSore: update(prevState.ajustSore, { [index]: { setTip: { $set: "分数必须大于或者等于0" } } })
})
)
return;
@ -394,7 +394,7 @@ class ExerciseReviewAndAnswer extends Component {
// })
this.setState(
(prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}})
ajustSore: update(prevState.ajustSore, { [index]: { setTip: { $set: "分数不能大于当前题目的分数" } } })
})
)
return;
@ -441,7 +441,7 @@ class ExerciseReviewAndAnswer extends Component {
//console.log(index+" "+ids);
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}),
exercise_questions: update(prevState.exercise_questions, { [index]: { user_answer: { $set: ids } } }),
})
)
}
@ -450,7 +450,7 @@ class ExerciseReviewAndAnswer extends Component {
changeA_flag = (index, status) => {
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }})
exercise_questions: update(prevState.exercise_questions, { [index]: { a_flag: { $set: status } } })
})
)
}
@ -582,9 +582,9 @@ class ExerciseReviewAndAnswer extends Component {
}
// 返回
returnBtn = () =>{
let coursesId=this.props.match.params.coursesId;
let eId=this.props.match.params.Id;
returnBtn = () => {
let coursesId = this.props.match.params.coursesId;
let eId = this.props.match.params.Id;
this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`)
}
@ -645,397 +645,6 @@ class ExerciseReviewAndAnswer extends Component {
document.title = courseName && courseName;
return (
<div className="newMain" style={{ paddingTop: "0px" }}>
<Spin size="large" spinning={isSpin}>
<style>{`
.inputNumber30{
height:30px;
width:115px;
}
.inputNumber30 .ant-input-number-input-wrap{
line-height: 28px;
}
.inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{
height: 28px;
}
.setRadioStyle{
width:100%;
cursor:pointer;
}
.setRadioStyle > span:last-child{
flex:1;
display:flex;
}
.setRadioStyle .ant-radio,.setRadioStyle .ant-checkbox{
height:16px;
margin-top:5px;
}
.standardAnswer.editormd-html-preview,.answerStyle.editormd-html-preview{
width:100%!important
}
`}</style>
{/*<p style={{height:"60px"}}></p>*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalsBottomval={modalsBottomval}
modalCancel={ModalCancel}
modalSave={ModalSave}
loadtype={Loadtype}
/>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/classrooms/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" to={`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>&gt;
<span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span>
</p>
<p className="clearfix">
<span className="color-grey-3 font-24 fl lineh-40" >{exercise && exercise.exercise_name}</span>
<span className="fl mt8">
<CoursesListType typelist={[`${statudmap[exercise && exercise.exercise_status]}`]} typesylename={""} />
</span>
{
(isAdmin || ( isStudent && exercise && user_exercise_status == 1)) ?
<WordsBtn className="fr font-16 lineh-40" style="grey" onClick={this.returnBtn}>返回</WordsBtn>
:
time && time != 0 ?
<div className="fr">
<Countdown value={this.state.Datetime} onFinish={this.autoCommitExercise} />
</div>
:""
}
{/*<div className="fr remainingTime">*/}
{/* <li>{ hour >= 10 ? hour : '0'+hour}</li>*/}
{/* <span>:</span>*/}
{/* <li>{ minute >= 10 ? minute : '0'+minute}</li>*/}
{/* <span>:</span>*/}
{/* <li>{ second >= 10 ? second : '0'+second}</li>*/}
{/*</div>*/}
{
isAdmin && <WordsBtn className="fr font-16 lineh-40 mr30" style="blue" onClick={this.RepeatExercise}>打回重做</WordsBtn>
}
</p>
{
exercise && exercise.exercise_description &&
<p className="color-grey-3 edu-back-white padding15 mt30">{exercise.exercise_description}</p>
}
<p className="padding20-30 clearfix">
{
exercise_types && exercise_types.q_singles > 0 &&
<span className="color-grey-9 mr15">单选题 {exercise_types.q_singles} , {exercise_types && exercise_types.q_singles_scores} </span>
}
{
exercise_types && exercise_types.q_doubles > 0 &&
<span className="color-grey-9 mr15">多选题 {exercise_types.q_doubles} , {exercise_types && exercise_types.q_doubles_scores} </span>
}
{
exercise_types && exercise_types.q_judges > 0 &&
<span className="color-grey-9 mr15">判断题 {exercise_types.q_judges} , {exercise_types && exercise_types.q_judges_scores} </span>
}
{
exercise_types && exercise_types.q_nulls > 0 &&
<span className="color-grey-9 mr15">填空题 {exercise_types.q_nulls} , {exercise_types && exercise_types.q_nulls_scores} </span>
}
{
exercise_types && exercise_types.q_mains > 0 &&
<span className="color-grey-9 mr15">简答题 {exercise_types.q_mains} , {exercise_types && exercise_types.q_mains_scores} </span>
}
{
exercise && exercise.exercise_description &&
<p className="color-grey-3 edu-back-white padding15 mt30">{exercise.exercise_description}</p>
}
<span className="color-grey-3 fr"><span className="color-orange-tip"> {exercise_types &&exercise_types.q_scores} </span></span>
<span className="color-grey-3 fr">合计<span className="color-blue"> {exercise_types &&exercise_types.q_counts} </span></span>
</p>
<div className="edu-back-white">
<div className={ questionPanelFixed==true ? "questionsfixed padding30":"questionsNo padding30"} style={{borderBottom:"none"}}>
<span className="clearfix font-16">
{
exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span>
}
{
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
<span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exerciseTotalScore }</span> </span>
}
</span>
{
exercise_types && exercise_types.q_shixuns > 0 &&
<span className="color-grey-9 mr15">实训题 {exercise_types.q_shixuns} , {exercise_types && exercise_types.q_shixuns_scores} </span>
}
<span className="color-grey-3 fr"><span className="color-orange-tip"> {exercise_types && exercise_types.q_scores} </span></span>
<span className="color-grey-3 fr">合计<span className="color-blue"> {exercise_types && exercise_types.q_counts} </span></span>
</p>
<div className="edu-back-white">
<div className={questionPanelFixed == true ? "questionsfixed padding30" : "questionsNo padding30"} style={{ borderBottom: "none" }}>
<span className="clearfix font-16">
{
exercise_start_at && <span className="fl color-grey-9">开始答题时间{exercise_start_at && moment(exercise_start_at).format(format)}</span>
}
{
exercise_scores && exercise_scores.subjective_scores.length > 0 &&
<div>
<p className="clearfix">
<span className="mr40 answered ml20">已答</span>
<span className="unanswer">未答</span>
</p>
<ul className="clearfix leaderNav">
{
question_status && question_status.map((item, key) => {
return (
<a className={item.ques_status == 1 ? "acted" : ""} onClick={() => this.scrollToAnchor(`${item.ques_number}`)}>{item.ques_number}</a>
)
})
}
</ul>
</div>
}
</div>
}
{
//学生身份 且试卷还未截止
isStudent && exercise && exercise.exercise_status == 2 ?
<div className="mt20">
<p className="clearfix">
<span className="mr40 answered ml20">已答</span>
<span className="unanswer">未答</span>
</p>
<ul className="clearfix leaderNav">
{
question_status && question_status.map((item,key)=>{
return(
<a className={item.ques_status == 1 ? "acted" : ""} onClick={()=>this.scrollToAnchor(`${item.ques_number}`)}>{item.ques_number}</a>
)
})
}
</ul>
</div>:""
}
</div>
{/* 试卷题目 */}
<div>
{
exercise_questions && exercise_questions.map((item,key)=>{
let list = ajustSore && ajustSore.filter(obj => obj.id === item.question_id);
return(
<div className="bor-top-greyE pt30 pb30" id={"Anchor_"+parseInt(key+1)}>
<p className="clearfix font-16 pl30 pr30">
<span className="color-blue mr5">{item.q_position}{type[item.question_type]}</span><span className="color-grey-9 mr5">({item.question_score})</span>
<span className="fr">
{
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ?
<WordsBtn style="blue" className="ml20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分</WordsBtn>:""
}
{
// 简答题,未评分的显示未批
isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ?
<span className="color-red fl ml20">未批</span>:""
}
{
// 客观题:老师||学生(试卷已截止且答案公开)显示正确答案
item.question_type < 3 && item.standard_answer_show ?
<span className="font-16 fl ml20">
正确答案{ item.standard_answer_show }
</span>:""
}
{
//(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
<span className="font-16 ml20 fl">
<span><span className={parseInt(item.answer_status) == 0 ?"color-red":parseInt(item.answer_status) == 1 ?"color-green":"color-orange-tip"}>{item.user_score}</span> </span>
</span> : ""
}
{
//实训题 ,答题
item.question_type == 5 &&
<a href={"/shixuns/"+item.shixun_identifier+"/challenges"} target="_blank" class="font-16 color-blue fl" target={"_blank"}>实训详情</a>
}
</span>
</p>
<li className="break_word mt15 mb15 pl30 pr30">
{/* <p className="standardAnswer markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML1(item.question_type == 5 ? item.shixun_name : item.question_title).replace(/▁/g,"▁▁▁")}}></p> */}
<MarkdownToHtml content={(item.question_type == 5 ? item.shixun_name : item.question_title)} selector={'answer_' + key}
className="standardAnswer"
></MarkdownToHtml>
</li>
{
// 选择题和判断题共用
(item.question_type == 0 || item.question_type == 2) &&
<Single
{...this.props}
{...this.state}
exercise={exercise}
questionType={item}
user_exercise_status={user_exercise_status}
changeOption={(index,ids)=>this.changeOption(index,ids)}
changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)}
index={key}
></Single>
}
{
// 多选题
item.question_type == 1 &&
<Multiple
{...this.props}
{...this.state}
exercise={exercise}
questionType={item}
user_exercise_status={user_exercise_status}
changeOption={(index,ids)=>this.changeOption(index,ids)}
changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)}
index={key}
></Multiple>
}
{
// 填空题
item.question_type == 3 &&
<FillEmpty
{...this.props}
{...this.state}
exercise={exercise}
questionType={item}
user_exercise_status={user_exercise_status}
changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)}
index={key}
></FillEmpty>
}
{
// 简答题
item.question_type == 4 &&
<SimpleAnswer
{...this.props}
{...this.state}
exercise={exercise}
questionType={item}
user_exercise_status={user_exercise_status}
changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)}
changeA_flag={(index,status)=>this.changeA_flag(index,status)}
index={key}
></SimpleAnswer>
}
{
// 实训题
item.question_type == 5 &&
<ShixunAnswer
{...this.props}
{...this.state}
exercise={exercise}
questionType={item}
user_exercise_status={user_exercise_status}
id={this.state.Id}
index={key}
></ShixunAnswer>
}
{
//调分理由部分
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
<div className="ml30 mr30 bor-top-greyE pt30 mt20 clearfix df">
<img src={getImageUrl(`images/${item.question_comments.user_picture}`)} width="48" height="48" className="radius mr10"/>
<div className="flex1">
<li className="lineh-20 mb7">
<span className="color-grey-3 mr20">{item.question_comments.user_name}</span>
<span className="color-grey-9 mr20">{moment(item.question_comments.updated_at).format(format)}</span>
</li>
<li className="break_word lineh-20">{item.question_comments.comment}</li>
</div>
</div>
}
{
// 调分输入部分
isAdmin && ((item.setScore && item.question_type == 3) || (item.setScore && item.question_type == 1) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))?
<div className="ml30 mr30 bor-top-greyE pt20 mt20" id={`${"Anchor_"+item.q_position+"_"+item.question_type}`}>
<div className="edu-txt-right">
<span><span className="color-red">*</span></span>
<li className="fr">
<p>
<InputNumber
placeholder="请填写分数"
min={0}
// max={item.question_score}
value={list && list.length>0 && list[0].inputSore}
step={0.1}
precision={1}
className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={(value)=>this.inputScore(value,item.question_id)}
id={`${"input_"+item.q_position+"_"+item.question_type}`}
></InputNumber>
<span className="ml5"></span>
{
parseInt(item.answer_status) == 0 && item.question_type == 4 ? <span className="color-red ml10 font-16">未评分</span> : ''
}
<ActionBtn style="blue" className="middle ml20" onClick={()=>this.setAction(key,item.question_id,item.question_score,item.user_score)}>确认</ActionBtn>
</p>
{
list && list.length > 0 && list[0].setTip !="" ? <p className="color-red edu-txt-left">{ list[0].setTip }</p> :""
}
</li>
</div>
}
{
// 调分输入部分
isAdmin && ((item.setScore && item.question_type == 3) || (item.setScore && item.question_type == 1) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4)) ?
<div className="ml30 mr30 bor-top-greyE pt20 mt20" id={`${"Anchor_" + item.q_position + "_" + item.question_type}`}>
<div className="edu-txt-right">
<span><span className="color-red">*</span></span>
<li className="fr">
<p>
<InputNumber
placeholder="请填写分数"
min={0}
// max={item.question_score}
value={list && list.length > 0 && list[0].inputSore}
step={0.1}
precision={1}
className={list && list.length > 0 && list[0].setTip != "" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={(value) => this.inputScore(value, item.question_id)}
id={`${"input_" + item.q_position + "_" + item.question_type}`}
></InputNumber>
<span className="ml5"></span>
{
parseInt(item.answer_status) == 0 && item.question_type == 4 ? <span className="color-red ml10 font-16">未评分</span> : ''
}
<ActionBtn style="blue" className="middle ml20" onClick={() => this.setAction(key, item.question_id, item.question_score, item.user_score)}>确认</ActionBtn>
</p>
{
list && list.length > 0 && list[0].setTip != "" ? <p className="color-red edu-txt-left">{list[0].setTip}</p> : ""
}
</li>
</div>
<Textarea className="winput-100-150 mt20" value={list && list.length > 0 && list[0].desc} style={{ height: "180px" }} maxLength="100" onChange={(e) => this.changeScoreReasons(e, item.question_id)} placeholder="请您输入评语最大限制100个字符"></Textarea>
</div> : ""
}
</div>
)
})
}
</div>
</div>
{
isStudent && user_exercise_status == 0 ?
<p className="edu-txt-right mt20 clearfix">
<a className="defalutSubmitbtn fr" onClick={this.commitExercise}>交卷</a>
<a className="defalutCancelbtn fr mr20" onClick={this.saveExercise}>保存</a>
{
exercise && time != null ?
<span className="color-grey-9 font-12 mr20 fr lineh-40">保存或者离开页面后系统将持续计时到达时长系统将自动交卷</span>
: ""
}
</p> : ""
}
</div>
</Spin>
</div>
)
}
}

Loading…
Cancel
Save