caishi 5 years ago
commit 68ea96e61b

@ -263,7 +263,7 @@ class App extends Component {
<Switch>
{/*<Route path="/login" component={LoginRegisterPage}/>*/}
{/*认证*/}
{/*<Route path="/account" component={AccountPage}/>*/}
<Route path="/account" component={AccountPage}/>
{/*403*/}
<Route path="/403" component={Shixunauthority}/>

@ -39,18 +39,29 @@ class DMDEditor extends Component{
onChange = (val) => {
// this.setState({ value: val })
this.props.onChange(val)
if (this.state.showError == true) {
this.setState({showError: false})
}
}
showError = () => {
this.mdRef.current.showError()
this.setState({showError: true})
}
render(){
const { mdMode } = this.state;
const { mdMode, showError } = this.state;
const { initValue } = this.props;
let _style = {}
if (showError) {
_style.border = '1px solid red'
}
_style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'})
return(
<React.Fragment>
<style>{`
`}</style>
<div id="content_editorMd_show" className="new_li content_editorMd_show"
style={{display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'}}
style={_style}
dangerouslySetInnerHTML={{__html: initValue ? markdownToHTML(initValue):this.props.placeholder}}
onClick={this.toMDMode}
>

@ -238,6 +238,7 @@
width: 100%;
word-wrap: break-word;
margin-bottom: 4px;
margin-top: 4px;
}
.childComment .break_word_comments{
line-height: 22px;

@ -96,7 +96,7 @@ class CommentItemMDEditor extends Component {
}
render() {
const { match, history, item, user } = this.props
const { match, history, item, user, buttonText } = this.props
if (!item) {
return <div></div>
}
@ -111,7 +111,7 @@ class CommentItemMDEditor extends Component {
</a>
</div>
<div id={`reply_message_${item.id}`} className="reply_to_message commentItemMDEditor"
style={{ paddingTop: '0px', paddingBottom: '20px', marginTop: '36px' }}
style={{ paddingTop: '0px', paddingBottom: '0px', marginTop: '36px' }}
>
<div id={`reply_message_editorMd_${item.id}`} className="editorMD" style={{ marginBottom: '0px'}}>
<textarea style={{'display': 'none'}}>
@ -119,11 +119,14 @@ class CommentItemMDEditor extends Component {
</div>
<div className="editor__resize" href="javascript:void(0);" style={{display: ''}}>调整高度</div>
<a id={`commitBtn_${item.id}`} href="javascript:void(0)"
onClick={this.onCommit} style={{ marginRight: '44px' }}
className="commentsbtn task-btn task-btn-blue fr " style={{display: ''}}>
发送
</a>
<div class="clearfix">
<a id={`commitBtn_${item.id}`} href="javascript:void(0)"
onClick={this.onCommit} style={{ marginRight: '44px' }}
className="commentsbtn task-btn task-btn-blue fr " style={{display: ''}}>
{ buttonText || '发送'}
</a>
</div>
</div>
</div>
);

@ -408,6 +408,7 @@ class Comments extends Component {
currentReplyComment={currentReplyComment}
item={item}
user={user}
buttonText={this.props.buttonText}
>
</CommentItemMDEditor>
}

File diff suppressed because it is too large Load Diff

@ -271,7 +271,7 @@ class Fileslistitem extends Component{
return(
<div className="mr50">
<span className="mr15 color-dark">{item.course_group_name}</span>
<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}</span>
<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD HH:mm')}</span>
</div>
)
})}
@ -289,7 +289,7 @@ class Fileslistitem extends Component{
{/*{moment(discussMessage.publish_time).fromNow()}*/}
{ discussMessage.publish_time===null?"":
discussMessage.is_publish===true?"":"发布于"}
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')}
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD HH:mm')}
</span>
</span>
{this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login?

@ -668,7 +668,7 @@ class Fileslists extends Component{
<div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {total_count} 个资源</span>
<span style={{"marginLeft":"16px"}}>已发布{public_count}</span>
{this.props.isAdmin()||this.props.isStudent()?<span style={{"marginLeft":"16px"}}>未发布{private_count}</span>:""}
<span style={{"marginLeft":"16px"}}>未发布{private_count}</span>
</div>
}
onPressEnter={this.onPressEnter}

@ -416,7 +416,7 @@ class TopicDetail extends Component {
const user = this._getUser();
this.setState({
comments: addNewComment(comments, _id, content, user)
comments: addNewComment(comments, _id, content, user, this)
})
const newMemo2 = Object.assign({}, this.state.memo);
newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
@ -526,8 +526,15 @@ class TopicDetail extends Component {
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
return (
<div className="edu-back-white edu-class-container edu-position course-message" id="forum_index_list"> {/* fl with100 */}
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="forum_index_list"> {/* fl with100 */}
<style>{`
.topicDetail #forum_list .return_btn.no_mr {
margin-right: 1px;
}
/* 有内容时,编辑器下方的边框*/
.topicDetail .borderBottom.commentInputs {
border-bottom: 1px solid rgb(238, 238, 238);
}
.independent {
background: rgb(250, 250, 250);
padding-bottom: 20px;
@ -658,7 +665,7 @@ class TopicDetail extends Component {
</div>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} buttonText={'发表'}></MemoDetailMDEditor>
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>
{/* onClick={ this.createNewComment }
enableReplyTo={true}

@ -226,8 +226,8 @@ class CommonWorkDetailIndex extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} calssName="color-dark">导出成绩</a></li>
<li><a href={exportUrl} calssName="color-dark">导出作品附件</a></li>
<li><a href={exportResultUrl} className="color-dark">导出成绩</a></li>
<li><a href={exportUrl} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -31,7 +31,7 @@ function renderScore(score, content) {
} else if (score >= 60) {
color = '#FF6800'
}
return <a href="javascript:;" style={{ color, minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
return <a href="javascript:;" style={{ color, cursor: 'default', minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
{score == null || score == undefined || score == '--' ? '--': (content || score)}
</a>
}
@ -93,7 +93,7 @@ function buildColumns(that, student_works) {
</div>
),
}]
if (!niPingAndIsStudent) {
if (!niPingAndIsStudent && isAdminOrStudent) {
columns.push({
width: 88,
title: '学号',
@ -105,7 +105,7 @@ function buildColumns(that, student_works) {
<a href="javascript:;"
title={record.student_id}
style={{color:'#9A9A9A', 'text-overflow': 'ellipsis', 'white-space': 'nowrap', 'width': '100px', display: 'block', overflow: 'hidden'
, margin: '0 auto'}}
, margin: '0 auto', cursor: 'default'}}
>{record.student_id}</a>
</span>
),
@ -121,7 +121,7 @@ function buildColumns(that, student_works) {
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.group_name}</a>
<a href="javascript:;" style={{color:'#9A9A9A', cursor: 'default'}}>{record.group_name}</a>
</span>
),
} )
@ -177,7 +177,7 @@ function buildColumns(that, student_works) {
}
return (
<span>
<a href="javascript:;" style={{color: color}}>
<a href="javascript:;" style={{color: color, cursor: 'default'}}>
{status === 0 ? "未提交" : status === 1 ? "按时提交" : status === 2 ? "延时提交" : ""}
</a>
</span>
@ -190,7 +190,7 @@ function buildColumns(that, student_works) {
render: (update_time, record) => (
<span>
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
<a href="javascript:;" style={{color:'#989898', cursor: 'default'}}>{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}</a>
</span>
),
}])
@ -450,17 +450,17 @@ class CommonWorkList extends Component{
}
teacherCommentOptionChange = (values, isAllChecked) => {
this.setState({arg_teacher_comment: isAllChecked ? [] : values}, () => {
this.setState({arg_teacher_comment: isAllChecked ? [] : values, page: 1}, () => {
this.fetchList()
})
}
statusOptionChange = (values, isAllChecked) => {
this.setState({arg_work_status: isAllChecked ? [] : values}, () => {
this.setState({arg_work_status: isAllChecked ? [] : values, page: 1}, () => {
this.fetchList()
})
}
courseGroupOptionChange = (values, isAllChecked) => {
this.setState({arg_course_group: isAllChecked ? [] : values}, () => {
this.setState({arg_course_group: isAllChecked ? [] : values, page: 1}, () => {
this.fetchList()
})
}
@ -648,7 +648,7 @@ class CommonWorkList extends Component{
<CheckAllGroup options={options_teacher_comment} label={'你的评阅:'} onChange={this.teacherCommentOptionChange}></CheckAllGroup>
<CheckAllGroup options={options_status} label={'作品状态:'} onChange={this.statusOptionChange}></CheckAllGroup>
{options_course_group.length > 1 && <CheckAllGroup options={options_course_group} label={'分班情况:'} onChange={this.courseGroupOptionChange} checkboxGroupStyle={{width: '86%'}}></CheckAllGroup>}
{options_course_group.length > 1 && <CheckAllGroup options={options_course_group} label={'分班情况:'} onChange={this.courseGroupOptionChange} checkboxGroupStyle={{width: '980px'}}></CheckAllGroup>}
{/* value={search} */}

@ -1,153 +1,153 @@
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn, MarkdownToHtml } from 'educoder';
import axios from 'axios';
import PublishRightnow from '../PublishRightnow'
import AccessoryModal from "../../coursesPublic/AccessoryModal";
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
let GraduationTasksnewtype=true;
const $ = window.$;
const Search = Input.Search;
const RadioGroup = Radio.Group;
class TabRightComponents extends Component{
constructor(props){
super(props)
this.publishModal = React.createRef();
this.endModal = React.createRef();
this.state={
accessoryVisible: false
}
}
componentDidMount() {
}
onToPublishClick = () => {
}
// 补交附件
Cancelvisible=()=>{
this.setState({
accessoryVisible:false
})
}
addAccessory=()=>{
this.setState({
accessoryVisible:true
})
}
setupdate = () => {
}
render(){
const dateFormat = 'YYYY-MM-DD HH:mm';
const { accessoryVisible } = this.state
let { work_statuses, publish_immediately, work_id
, end_immediately
} =this.props;
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let workId=this.props.match.params.workId;
const isGroup = this.props.isGroup()
const moduleName = !isGroup? "普通作业":"分组作业";
const moduleEngName = this.props.getModuleName()
const childModuleName = this.props.moduleName
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
return(
<React.Fragment>
{isAdmin ?
<React.Fragment>
<div style={{display: 'inline', float: 'right'}}>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={true} doWhenSuccess={this.props.doWhenSuccess} checkBeforePost={this.props.saveWorkSetting}
onToPublishClick={this.onToPublishClick}
></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.props.doWhenSuccess}></PublishRightnow>
</div>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
color: #333;
}
.drop_down_menu {
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
`}</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} calssName="color-dark">导出成绩</a></li>
<li><a href={exportUrl} calssName="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{/* <a className={"fr color-blue font-16"} href={exportUrl}></a>
<a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a> */}
{/*<a className={"fr color-blue font-16"}>导出</a>*/}
{end_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.endModal.current.open() } }>立即截止</a>}
{publish_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.publishModal.current.open() } } >立即发布</a>}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
</React.Fragment> :
<React.Fragment>
{work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params)}}
>提交作品</a>}
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}}
>修改作品</a>}
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
<React.Fragment>
<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={accessoryVisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
setupdate={this.setupdate}
reviseAttachmentUrl={`/student_works/${work_id}/revise_attachment.json`}
/>
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={this.addAccessory}
>补交附件</a>
</React.Fragment>
}
</React.Fragment> }
</React.Fragment>
)
}
}
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn, MarkdownToHtml } from 'educoder';
import axios from 'axios';
import PublishRightnow from '../PublishRightnow'
import AccessoryModal from "../../coursesPublic/AccessoryModal";
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
let GraduationTasksnewtype=true;
const $ = window.$;
const Search = Input.Search;
const RadioGroup = Radio.Group;
class TabRightComponents extends Component{
constructor(props){
super(props)
this.publishModal = React.createRef();
this.endModal = React.createRef();
this.state={
accessoryVisible: false
}
}
componentDidMount() {
}
onToPublishClick = () => {
}
// 补交附件
Cancelvisible=()=>{
this.setState({
accessoryVisible:false
})
}
addAccessory=()=>{
this.setState({
accessoryVisible:true
})
}
setupdate = () => {
}
render(){
const dateFormat = 'YYYY-MM-DD HH:mm';
const { accessoryVisible } = this.state
let { work_statuses, publish_immediately, work_id
, end_immediately
} =this.props;
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let workId=this.props.match.params.workId;
const isGroup = this.props.isGroup()
const moduleName = !isGroup? "普通作业":"分组作业";
const moduleEngName = this.props.getModuleName()
const childModuleName = this.props.moduleName
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
return(
<React.Fragment>
{isAdmin ?
<React.Fragment>
<div style={{display: 'inline', float: 'right'}}>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={true} doWhenSuccess={this.props.doWhenSuccess} checkBeforePost={this.props.saveWorkSetting}
onToPublishClick={this.onToPublishClick}
></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.props.doWhenSuccess}></PublishRightnow>
</div>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
color: #333;
}
.drop_down_menu {
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
`}</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} className="color-dark">导出成绩</a></li>
<li><a href={exportUrl} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{/* <a className={"fr color-blue font-16"} href={exportUrl}></a>
<a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a> */}
{/*<a className={"fr color-blue font-16"}>导出</a>*/}
{end_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.endModal.current.open() } }>立即截止</a>}
{publish_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.publishModal.current.open() } } >立即发布</a>}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
</React.Fragment> :
<React.Fragment>
{work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params)}}
>提交作品</a>}
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}}
>修改作品</a>}
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
<React.Fragment>
<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={accessoryVisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
setupdate={this.setupdate}
reviseAttachmentUrl={`/student_works/${work_id}/revise_attachment.json`}
/>
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={this.addAccessory}
>补交附件</a>
</React.Fragment>
}
</React.Fragment> }
</React.Fragment>
)
}
}
export default TabRightComponents;

@ -64,13 +64,13 @@ export function handleContentBeforeCreateNew(argContent) {
return content
}
export function addNewComment(comments, _id, content, user, isSuperAdmin) {
export function addNewComment(comments, _id, content, user, isSuperAdmin, parentComponent) {
if (!comments) {
comments = [];
}
comments.unshift( {
"can_delete": true,
"admin": user.admin,
"admin": parentComponent ? parentComponent.props.isAdmin() : user.admin ,
isSuperAdmin: isSuperAdmin,
"content": content,

@ -175,7 +175,7 @@ class CCommentItem extends Component{
// src={getImageUrl(`images/${item.image_url}`)}
return (
<div className="comment_item_cont df clearfix" key={item.id}>
<div className="comment_item_cont appraise df clearfix" key={item.id}>
<div className="J_Comment_Face fl">
{item.is_appeal_info == true ?
<a href={`javascript:void(0)`} target="_blank">

@ -76,7 +76,7 @@ class CommonReply extends Component{
const isSuperAdmin = this.props.isSuperAdmin()
this.setState({
comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin),
comments: addNewComment(this.state.comments, _id, content, user, isSuperAdmin, this),
total_count: this.state.total_count + 1
})
this.refs.editor.showEditor();

@ -38,8 +38,10 @@
margin-top: 8px;
}
.course-message .comment_item_cont:last-child {
/* 作品评阅需要 */
border-bottom: none;
}
.course-message .appraise.comment_item_cont:last-child {
/* 作品评阅需要 */
padding-bottom: 0px;
}

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Input, Spin, Icon } from "antd";
import { Modal,Checkbox,Input, Spin, Icon,notification } from "antd";
import axios from 'axios';
import Modals from '../../modals/Modals';
const CheckboxGroup = Checkbox.Group;
@ -187,15 +187,26 @@ class Addcourses extends Component{
if(response.data.course_id!=undefined){
this.submitasyn(response.data.course_id)
}
notification.open({
message:"提示",
description:response.data.message
});
this.props.hideAddcoursestype();
this.props.showNotification(response.data.message);
// this.props.showNotification(response.data.message);
}else{
this.setState({
Addcoursestype:false
})
notification.open({
message:"提示",
description:response.data.message
});
this.setState({
Addcoursestype:false
})
this.props.hideAddcoursestype();
this.props.showNotification(response.data.message);
// this.setState({
// loadtype:true,
// modalsType:true,

@ -1,235 +1,235 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ConditionToolTip } from 'educoder'
const Option = Select.Option;
const pageCount = 15;
// 代码查重弹框
class CheckCodeModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
candidates: [],
hasMore: true,
loading: false,
page: 1
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_teacher_candidate.json`
this.setState({ loading: true })
axios.post(url, {
page: page,
limit: pageCount,
school_name: school_name || '',
name: name || ''
})
.then((response) => {
if (!response.data.candidates || response.data.candidates.length == 0) {
this.setState({
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
page,
loading: false,
hasMore: response.data.candidates.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/add_teacher_popup.json`
axios.get(url, {
})
.then((response) => {
if (response.data.graduation_groups) {
this.setState({
graduation_groups: response.data.graduation_groups
})
}
if (response.data.course_groups) {
this.setState({
course_groups: response.data.course_groups
})
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.fetchMemberList()
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_teacher.json`
const params = {
"user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
"graduation_group_id": "2",
"course_group_id": "820",
// "role": ROLE_TEACHER_NUM
}
const { graduationGroup, courseGroup } = this.state
if (graduationGroup) {
params.graduation_group_id = graduationGroup
}
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleGradationGroupChange = (value) => {
this.setState({
graduationGroup: value
})
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`代码查重`}
{...this.props }
onOk={this.onOk}
className="checkCodeModal"
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: right;
margin-left: 12px;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.checkCodeModal label.task-hide {
width: 100%;
}
`}
</style>
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'分班名称'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'有效作品数'}</label></span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'上次查重时间'}</label></span>
</p>
<div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ candidates && candidates.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} ></Checkbox>
<span className="fl with25">
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.name}</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname}</label>
</ConditionToolTip>
</span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
</p>
)
}) }
</Checkbox.Group>
</div>
</div>
</ModalWrapper>
)
}
}
export default CheckCodeModal;
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ConditionToolTip } from 'educoder'
const Option = Select.Option;
const pageCount = 15;
// 代码查重弹框
class CheckCodeModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
candidates: [],
hasMore: true,
loading: false,
page: 1
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_teacher_candidate.json`
this.setState({ loading: true })
axios.post(url, {
page: page,
limit: pageCount,
school_name: school_name || '',
name: name || ''
})
.then((response) => {
if (!response.data.candidates || response.data.candidates.length == 0) {
this.setState({
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
page,
loading: false,
hasMore: response.data.candidates.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/add_teacher_popup.json`
axios.get(url, {
})
.then((response) => {
if (response.data.graduation_groups) {
this.setState({
graduation_groups: response.data.graduation_groups
})
}
if (response.data.course_groups) {
this.setState({
course_groups: response.data.course_groups
})
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.fetchMemberList()
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_teacher.json`
const params = {
"user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
"graduation_group_id": "2",
"course_group_id": "820",
// "role": ROLE_TEACHER_NUM
}
const { graduationGroup, courseGroup } = this.state
if (graduationGroup) {
params.graduation_group_id = graduationGroup
}
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleGradationGroupChange = (value) => {
this.setState({
graduationGroup: value
})
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`代码查重`}
{...this.props }
onOk={this.onOk}
className="checkCodeModal"
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: right;
margin-left: 12px;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.checkCodeModal label.task-hide {
width: 100%;
}
`}
</style>
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'分班名称'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'有效作品数'}</label></span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'上次查重时间'}</label></span>
</p>
<div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ candidates && candidates.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} ></Checkbox>
<span className="fl with25">
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.name}</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname}</label>
</ConditionToolTip>
</span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
</p>
)
}) }
</Checkbox.Group>
</div>
</div>
</ModalWrapper>
)
}
}
export default CheckCodeModal;

@ -561,7 +561,7 @@ class ExerciseReviewAndAnswer extends Component{
</p>
{
exercise && exercise.exercise_description &&
<p className="color-grey-3 edu-back-white padding15 edu-txt-center mt30">{exercise.exercise_description}</p>
<p className="color-grey-3 edu-back-white padding15 mt30">{exercise.exercise_description}</p>
}
<p className="padding20-30 clearfix">
{

@ -1,5 +1,5 @@
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import {WordsBtn,markdownToHTML} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Pagination} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
@ -102,9 +102,9 @@ class Exercisestatisticalresult extends Component {
}
`}
</style>
<div className={"educontent mb20" }>
<div className={"educontent mb20" } style={{width: "1250px"}}>
{data&&data.course_groups.length===0?"":<div className="stud-class-set bor-bottom-greyE">
{data&&data.course_groups.length===0?"":<div className="stud-class-set">
<div className="clearfix edu-back-white">
<ul className="clearfix" style={{padding:'20px'}}>
<li className="clearfix mt10">
@ -180,13 +180,16 @@ class Exercisestatisticalresult extends Component {
{data&&data.commit_results.map((item,key)=>{
return(
<div className="stud-class-set bor-greyE mb20" key={key}>
<div className="stud-class-set mb20" key={key}>
<div className="clearfix edu-back-white poll_list" style={{padding: '20px'}}>
<div className="font-16 shixunreporttitle fl" >
<span className="CACFF">{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}</span>
<span>Q{item.ques_position}
<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>
</span>
<span className="CACFF">{item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}</span>
<div>
{/*Q{item.ques_position}*/}
<div dangerouslySetInnerHTML={{__html: markdownToHTML(item.ques_title).replace(/▁/g,"▁▁▁")}}></div>
{/*<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>*/}
</div>
</div>
<div className="fr shixunreporttitles">正确率<span style={{color:'#FF6800'}}> {item.right_percent}%</span></div>
</div>

@ -1,181 +1,186 @@
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import {Table} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
class OfficialAcademicTranscript extends Component {
constructor(props) {
super(props);
this.state = {
loadingstate:true,
datas:undefined
}
}
componentDidMount() {
}
render() {
let {data}=this.props;
let datas=[];
// data&&data.exercise_counts.forEach((item,key)=>{ })
datas.push({
commit_percent:data&&data.exercise_counts.commit_percent,
min_score:data&&data.exercise_counts.min_score,
max_score:data&&data.exercise_counts.max_score,
average_score:data&&data.exercise_counts.average_score,
fail_counts:data&&data.exercise_counts.fail_counts,
pass_counts:data&&data.exercise_counts.pass_counts,
good_counts:data&&data.exercise_counts.good_counts,
best_counts:data&&data.exercise_counts.best_counts,
})
let columns=[{
title: '提交率',
dataIndex: 'commit_percent',
key: 'commit_percent',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}<span className={"font-size12"}>%</span>
</span>
),
}, {
title: '最低分',
dataIndex: 'min_score',
key: 'min_score',
render: (text, record) => (
<span>
<span style={{color:'#333333'}}>{record.min_score}<span className={"font-size12"}></span></span>
</span>
),
}, {
title: '最高分',
dataIndex: 'max_score',
key: 'max_score',
render: (text, record) => (
<span style={{color:'#FF6800'}}>
{record.max_score}<span className={"font-size12"}></span>
</span>
),
}, {
title: '平均分',
key: 'average_score',
dataIndex: 'average_score',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.average_score}<span className={"font-size12"}></span>
</span>
),
}, {
title: '不及格(0-60)',
key: 'fail_counts',
dataIndex: 'fail_counts',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.fail_counts}<span className={"font-size12"}></span>
</span>
),
}, {
title: '及格(60-70)',
key: 'pass_counts',
dataIndex: 'pass_counts',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.pass_counts}<span className={"font-size12"}></span>
</span>
),
}, {
title: '良好(70-90)',
key: 'good_counts',
dataIndex: 'good_counts',
render: (text, record) => (
<span>
<span style={{color:'#333333'}}>{record.good_counts}<span className={"font-size12"}></span></span>
</span>
),
}, {
title: '优秀(90-100)',
key: 'best_counts',
dataIndex: 'best_counts',
render: (text, record) => (
<span>
<span style={{color:'#FF6800'}}>{record.best_counts}<span className={"font-size12"}></span></span>
</span>
),
}];
// {
// title: '调分',
// key: 'adjustmentminute',
// dataIndex: 'adjustmentminute',
//
// render: (text, record) => (
// <span>
// <a>6小时 50分钟 6秒</a>
// </span>
// ),
// },
return (
<div>
{/*{data===undefined?"":""}*/}
<style>{`
.ant-table-thead > tr > th{
text-align: center;
}
.tasknamebox{
width: 50px;
height: 24px;
border: 1px solid rgba(221,23,23,1);
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
line-height: 24px;
}
.tasknameboxs{
color: #666666 !important;
background:rgba(237,237,237,1) !important;
}
.ant-table-tbody > tr > td{
font-size:14px;
}
.task-hide{
max-width: 345px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ant-table-tbody > tr{
height:64px;
text-align: center;
}
`}
</style>
{datas===undefined?"":<Table
dataSource={datas}
columns={columns}
pagination={false}
// loading={loadingstate}
// onChange={this.TablePagination}
/>}
</div>
)
}
}
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import {Table} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
class OfficialAcademicTranscript extends Component {
constructor(props) {
super(props);
this.state = {
loadingstate:true,
datas:undefined
}
}
componentDidMount() {
}
render() {
let {data}=this.props;
let datas=[];
// data&&data.exercise_counts.forEach((item,key)=>{ })
datas.push({
commit_percent:data&&data.exercise_counts.commit_percent,
min_score:data&&data.exercise_counts.min_score,
max_score:data&&data.exercise_counts.max_score,
average_score:data&&data.exercise_counts.average_score,
fail_counts:data&&data.exercise_counts.fail_counts,
pass_counts:data&&data.exercise_counts.pass_counts,
good_counts:data&&data.exercise_counts.good_counts,
best_counts:data&&data.exercise_counts.best_counts,
})
let columns=[{
title: '提交率',
dataIndex: 'commit_percent',
key: 'commit_percent',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.commit_percent===0?0:(record.commit_percent*100).toFixed(2)}<span className={"font-size12"}>%</span>
</span>
),
}, {
title: '最低分',
dataIndex: 'min_score',
key: 'min_score',
render: (text, record) => (
<span>
<span style={{color:'#333333'}}>{record.min_score}<span className={"font-size12"}></span></span>
</span>
),
}, {
title: '最高分',
dataIndex: 'max_score',
key: 'max_score',
render: (text, record) => (
<span style={{color:'#FF6800'}}>
{record.max_score}<span className={"font-size12"}></span>
</span>
),
}, {
title: '平均分',
key: 'average_score',
dataIndex: 'average_score',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.average_score}<span className={"font-size12"}></span>
</span>
),
}, {
title: '不及格(0-60)',
key: 'fail_counts',
dataIndex: 'fail_counts',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.fail_counts}<span className={"font-size12"}></span>
</span>
),
}, {
title: '及格(60-70)',
key: 'pass_counts',
dataIndex: 'pass_counts',
render: (text, record) => (
<span style={{color:'#333333'}}>
{record.pass_counts}<span className={"font-size12"}></span>
</span>
),
}, {
title: '良好(70-90)',
key: 'good_counts',
dataIndex: 'good_counts',
render: (text, record) => (
<span>
<span style={{color:'#333333'}}>{record.good_counts}<span className={"font-size12"}></span></span>
</span>
),
}, {
title: '优秀(90-100)',
key: 'best_counts',
dataIndex: 'best_counts',
render: (text, record) => (
<span>
<span style={{color:'#FF6800'}}>{record.best_counts}<span className={"font-size12"}></span></span>
</span>
),
}];
// {
// title: '调分',
// key: 'adjustmentminute',
// dataIndex: 'adjustmentminute',
//
// render: (text, record) => (
// <span>
// <a>6小时 50分钟 6秒</a>
// </span>
// ),
// },
return (
<div>
{/*{data===undefined?"":""}*/}
<style>{`
.ant-table-thead > tr > th{
text-align: center;
}
.tasknamebox{
width: 50px;
height: 24px;
border: 1px solid rgba(221,23,23,1);
border-radius: 12px;
color: rgba(221,23,23,1);
display: inline-block;
line-height: 24px;
}
.tasknameboxs{
color: #666666 !important;
background:rgba(237,237,237,1) !important;
}
.ant-table-tbody > tr > td{
font-size:14px;
}
.task-hide{
max-width: 345px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ant-table-tbody > tr{
height:64px;
text-align: center;
}
.exerctabel .ant-table-tbody > tr >td{
border:1px solid transparent;
}
`}
</style>
{datas===undefined?"":<Table
className={"exerctabel"}
dataSource={datas}
columns={columns}
pagination={false}
// loading={loadingstate}
// onChange={this.TablePagination}
/>}
</div>
)
}
}
export default OfficialAcademicTranscript;

@ -66,12 +66,16 @@ class Exercisetablesmubus extends Component {
width:'300px',
render: (text, record) => (
<span style={{color:'#FF6800'}}>
{record.max_score===undefined?"":<Progress
strokeColor={{
'0%': '#29BD8B',
'100%': '#29BD8B',
}}
percent={record.max_score*100} showInfo={false} />}
{record.max_score===undefined?"":<span>
<div style={{
float: 'left',
width: '220px'
}}><Progress
strokeColor={{
'0%': '#29BD8B',
'100%': '#29BD8B',
}}
percent={record.max_score*100} showInfo={false}/></div><div className={"fr"}>{record.max_score*100}%</div></span>}
</span>
),
}];
@ -125,10 +129,14 @@ class Exercisetablesmubus extends Component {
}
.ant-table-tbody > tr > td:nth-child(1){
text-align: left;
}
.Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{
border:1px solid transparent;
}
`}
</style>
{datas===undefined?"":<Table
className={"Exermubu"}
dataSource={datas}
columns={columns}
pagination={false}

@ -159,7 +159,7 @@ class Testpapersettinghomepage extends Component{
return(
<div className="newMain clearfix ">
<div className={"educontent mb20"}>
<div className={"educontent mb20"} style={{width:"1250px"}}>
{/* 公用的提示弹框 */}
{this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
@ -177,7 +177,7 @@ class Testpapersettinghomepage extends Component{
callback={this.callback}
/>:""}
<div className="educontent mb20">
<div className="educontent mb20" style={{width:"1250px"}}>
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/students}`}>{this.props.coursedata.name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -195,7 +195,7 @@ class Testpapersettinghomepage extends Component{
`}
</style>
<div className="educontent">
<div className="educontent" style={{width:"1250px"}}>
<p className=" fl color-black summaryname ">
{Commonheadofthetestpaper === undefined?"":Commonheadofthetestpaper.exercise_name}
</p>
@ -222,6 +222,8 @@ class Testpapersettinghomepage extends Component{
:
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item>
{Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true?
<Menu.Item key="1">统计结果</Menu.Item>:""}
<Menu.Item key="3">设置</Menu.Item>
</Menu>
}
@ -258,9 +260,9 @@ class Testpapersettinghomepage extends Component{
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a
onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}
calssName="color-dark">学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} calssName="color-dark">空白试卷</a></li>
<li><a calssName="color-dark"
className="color-dark">学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} className="color-dark">空白试卷</a></li>
<li><a className="color-dark"
onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}
>学生答题试卷</a></li>
</ul>

@ -55,21 +55,25 @@ class SingleEditor extends Component{
// TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击本题的正确选项'); return;
this.props.showNotification('必须设置标准答案'); return;
}
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
/**
@ -185,12 +189,14 @@ class SingleEditor extends Component{
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
></TPMMDEditor>
<div>
<RadioGroup onChange={this.onOptionClick} value={standard_answers[0]}>
<Radio value={true} disabled={exerciseIsPublish}></Radio>
<Radio value={false} disabled={exerciseIsPublish}></Radio>
{/* disabled={exerciseIsPublish} */}
<Radio value={true} ></Radio>
<Radio value={false} ></Radio>
</RadioGroup>
{/* not work */}
{/* <Radio value={standard_answers[0]} onClick={() => this.onOptionClick(0)} disabled={exerciseIsPublish}></Radio>

@ -45,14 +45,17 @@ class MainEditor extends Component{
// TODO check
const answerArray = standard_answers
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
// if(!answerArray || answerArray.length == 0 || !answerArray[0]) {
@ -151,7 +154,7 @@ class MainEditor extends Component{
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
noStorage={true}
noStorage={true} ref="titleEditor"
></TPMMDEditor>
<div>

@ -35,6 +35,10 @@ class NullChildEditor extends Component{
// this.mdReactObject = that;
// }
showError = (itemIndex) => {
this.refs[`nullChildDMDEditor${itemIndex}`].showError()
}
render() {
let { question_title, question_score, question_type, question_choices, standard_answers } = this.state;
let { question_id, index, onAnswerChange, addChildAnswer, toMDMode, exerciseIsPublish,
@ -49,6 +53,7 @@ class NullChildEditor extends Component{
return <div className="df flex1" >
<div className="flex1" style={{ flex: '0 0 1000px'}}>
<DMDEditor
ref={`nullChildDMDEditor${itemIndex}`}
className={'nullChildEditor'}
placeholder={`请输入参考答案${itemIndex == 0 ?'':'(可选)'}`}
toMDMode={toMDMode} noStorage={true}

@ -86,7 +86,7 @@ class NullDisplay extends Component{
padding:12px 10px;
margin-bottom:10px;
border-radius:2px;
max-width: 1024px;
width: 1024px;
word-break: break-all;
}
.answerRow {

@ -69,14 +69,16 @@ class NullEditor extends Component{
// const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
let answerArray = []
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
let isEmpty = false;
@ -88,7 +90,9 @@ class NullEditor extends Component{
answers.forEach((item, itemIndex) => {
answerArray[index].answer_text.push(item)
if(!item) {
this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`);
this.refs[`nullChildEditor${index}`].showError(itemIndex)
// this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`);
this.props.showNotification(`答案:不能为空`);
isEmpty = true;
}
})
@ -97,7 +101,9 @@ class NullEditor extends Component{
return;
}
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
/**
@ -294,13 +300,16 @@ class NullEditor extends Component{
<NullMDEditor {...this.props} mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
onPlaceholderChange={this.onPlaceholderChange} showNullButton={exerciseIsPublish ? false : true}
ref="titleEditor"
></NullMDEditor>
<div className="clearfix">
{
standard_answers.map((answers, index) => {
return <NullChildEditor {...this.props}
return <NullChildEditor
ref={`nullChildEditor${index}`}
{...this.props}
toMDMode={this.toMDMode}
answers={answers}
index={index}

@ -84,7 +84,9 @@ export default class NullMDEditor extends Component {
}
showError = () => {
this.refs['nullMDEditor'].showError()
}
render() {
let {
@ -94,6 +96,7 @@ export default class NullMDEditor extends Component {
return (
<TPMMDEditor {...this.props}
onCMBeforeChange={this.onCMBeforeChange}
ref='nullMDEditor'
>
</TPMMDEditor>
)

@ -98,7 +98,7 @@ class ShixunEditor extends Component{
// }
for(let _i = 0; _i < question_scores.length; _i++) {
if (!question_scores[_i] || question_scores[_i] == '0') {
this.props.showNotification(`${_i+1}题的分值必须大于0`); return;
this.props.showNotification(`${_i+1}题的分值必须大于0`); return;
}
}

@ -87,7 +87,10 @@ class SingleEditor extends Component{
// TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
@ -101,11 +104,15 @@ class SingleEditor extends Component{
this.props.showNotification('请先点击选择本选择题的正确选项'); return;
}
if(!question_title) {
this.props.showNotification('请先输入题目题干'); return;
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) {
this.refs[`optionEditor${i}`].showError()
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`); return;
}
}
@ -165,9 +172,9 @@ class SingleEditor extends Component{
}
onOptionClick = (index) => {
if (this.props.exerciseIsPublish) {
return;
}
// if (this.props.exerciseIsPublish) {
// return;
// }
let standard_answers = this.state.standard_answers.slice(0)
standard_answers[index] = !standard_answers[index]
this.setState({ standard_answers })
@ -237,6 +244,8 @@ class SingleEditor extends Component{
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} watch={false} className="mb20"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
></TPMMDEditor>
{question_choices.map( (item, index) => {
@ -247,13 +256,14 @@ class SingleEditor extends Component{
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
<span class={`option-item fr mr10 color-grey select-choice ${bg} `}
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={!exerciseIsPublish}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
</ConditionToolTip>
</span>
{/* </Tooltip> */}
<div style={{ flex: '0 0 1038px'}}>
<DMDEditor
ref={`optionEditor${index}`}
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
height={166} className={'optionMdEditor'} watch={false} noStorage={true}
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)}

@ -35,6 +35,7 @@ class GraduationTasksSubmitedit extends Component{
attachments:undefined,
spinnings:false,
shixunsreplace:false,
limit:20
}
}
@ -59,7 +60,7 @@ class GraduationTasksSubmitedit extends Component{
if(result.data.task_type===1){
}else{
this.searchList("",1,10,result.data.task_id)
this.searchList("",1,20,result.data.task_id)
}
this.props.form.setFieldsValue({
@ -222,15 +223,15 @@ class GraduationTasksSubmitedit extends Component{
let {search,workslist} = this.state;
this.searchList(search,1,10,workslist.task_id)
this.searchList(search,1,20,workslist.task_id)
}
searchList=(search,page,limit,id)=>{
searchList=(search,page,limit,id,types)=>{
let {memberslist}=this.state;
let newmemberslist=memberslist
this.setState({
search:search,
page:page,
limit:10
})
let newid=id
if(newid===undefined){
@ -245,9 +246,28 @@ class GraduationTasksSubmitedit extends Component{
}).then((result)=>{
if(result.status===200){
this.setState({
memberslist:result.data
})
if(types===1){
if(result.data.members.length>0) {
result.data.members.map((item, key) => {
newmemberslist.push(item)
})
}
this.setState({
memberslist:newmemberslist,
search:search,
page:page,
limit:limit
})
}else{
this.setState({
memberslist:result.data.members,
search:search,
page:page,
limit:limit
})
}
}
}).catch((error)=>{
@ -265,7 +285,7 @@ class GraduationTasksSubmitedit extends Component{
let newpage=page+2
this.searchList(search,newpage,limit,workslist.task_id)
this.searchList(search,newpage,limit,workslist.task_id,1)
}
@ -274,7 +294,7 @@ class GraduationTasksSubmitedit extends Component{
funtaskstatus=(checkedValues)=>{
let{memberslist,selectobjct}=this.state;
let newlist =memberslist.members;
let newlist =memberslist;
let newcheckedValues=checkedValues;
let selects=[];
@ -666,8 +686,8 @@ class GraduationTasksSubmitedit extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.width87{
width: 87px;
.width100{
width: 100px;
height: 24px;
}
img.edu-nodata-img {
@ -675,22 +695,25 @@ class GraduationTasksSubmitedit extends Component{
margin: 50px 90px 20px;
display: block;
}
.autos{
overflow: auto;
}
`}</style>
</Form.Item>
<div className={"ml20 mt10"} style={{width:"100%"}}>
<div className={"members fl"}
<div className={"members fl autos"}
style={{paddingLeft: '9px'}}
onScroll={this.contentViewScroll}>
<CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}>
{memberslist===undefined?"":memberslist.members.length===0? <div className="square-list clearfix">
{memberslist===undefined?"":memberslist.length===0? <div className="square-list clearfix">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">未找到包含{search}的学生</p>
</div>
</div>:memberslist&&memberslist.members.map((item,key)=>{
</div>:memberslist&&memberslist.map((item,key)=>{
return(
<div key={key} style={{
width: '375px',
@ -703,9 +726,9 @@ class GraduationTasksSubmitedit extends Component{
})
}
disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<div className={"fl ml5 fonthidden width87"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width87 color-grey-9"} style={{width: '70px'}}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"} style={{width: '70px'}}>{item.student_id}</div>
<div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"} style={{width: '70px'}}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"} style={{width: '70px'}}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div>
</div>
)
@ -719,22 +742,30 @@ class GraduationTasksSubmitedit extends Component{
<i className={"iconfont icon-youjiang fl ml20 mr20"}></i>
</div>
<div className={"members fl"}>
<div className={"members fl autos"}>
{selectmemberslist&&selectmemberslist.map((item,key)=>{
return(
<div key={key} style={{
width: '375px',
height: '30px',
display:item.user_name===undefined?"none":""
}}>
<div className={"fl ml5 fonthidden width87"} style={{width: '50px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width87 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"}>{item.student_id}</div>
{key>0?<div className={"fr ml20"}><i className={"iconfont icon-shanchudiao fl color-grey-9"} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""}
</div>
)
if(item.group_name!=undefined) {
return (
<div key={key} style={{
width: '375px',
height: '30px',
display: item.user_name === undefined ? "none" : ""
}}>
<div className={"fl ml5 fonthidden width100"} style={{width: '50px'}}
title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
{key > 0 ?
<div className={"fr ml20"}><i className={"iconfont icon-shanchudiao fl color-grey-9"}
style={{marginTop: '-4px'}}
onClick={() => this.delecttask_status(item.user_id)}></i>
</div> : ""}
</div>
)
}
})}
</div>

@ -32,7 +32,8 @@ class GraduationTasksSubmitnew extends Component{
selectobjct:undefined,
Loadtype:false,
spinnings:false,
shixunsreplace:false
shixunsreplace:false,
limit:20
}
}
@ -58,7 +59,7 @@ class GraduationTasksSubmitnew extends Component{
if(result.data.task_type===1){
}else{
this.searchList("",1,10)
this.searchList("",1,20)
}
this.setState({
workslist:result.data,
@ -215,29 +216,46 @@ class GraduationTasksSubmitnew extends Component{
let {search} = this.state;
this.searchList(search,1,10)
this.searchList(search,1,20)
}
searchList=(search,page,limit)=>{
this.setState({
search:search,
page:page,
limit:10
})
searchList=(search,page,limit,types)=>{
let id=this.props.match.params.task_Id;
let {memberslist}=this.state;
let newmemberslist=memberslist
let url="/graduation_tasks/"+id+"/graduation_works/search_member_list.json";
axios.post(url,{
search:search,
page:page,
limit:limit
limit:15
}).then((result)=>{
if(result.status===200){
if(result.data.status!=403){
this.setState({
memberslist:result.data
})
if(types===1){
if(result.data.members.length>0){
result.data.members.map((item,key)=>{
newmemberslist.push(item)
})
}
this.setState({
memberslist:newmemberslist,
search:search,
page:page,
limit:limit
})
}else{
this.setState({
memberslist:result.data.members,
search:search,
page:page,
limit:limit
})
}
}
}
@ -256,7 +274,7 @@ class GraduationTasksSubmitnew extends Component{
let newpage=page+2
this.searchList(search,newpage,limit)
this.searchList(search,newpage,limit,1)
}
@ -265,7 +283,7 @@ class GraduationTasksSubmitnew extends Component{
funtaskstatus=(checkedValues)=>{
let{memberslist,selectobjct}=this.state;
let newlist =memberslist.members;
let newlist =memberslist;
let newcheckedValues=checkedValues;
let selects=[];
selects.push(selectobjct)
@ -318,7 +336,7 @@ class GraduationTasksSubmitnew extends Component{
let {search} = this.state;
this.searchList(search,1,10)
this.searchList(search,1,20)
}
}
onSearchKeywordKeyUps= (e)=>{
@ -648,8 +666,8 @@ render(){
text-overflow:ellipsis;
white-space:nowrap
}
.width87{
width: 87px;
.width100{
width: 100px;
height: 24px;
}
img.edu-nodata-img {
@ -657,21 +675,25 @@ render(){
margin: 50px 90px 20px;
display: block;
}
.autos{
overflow: auto;
}
`}</style>
<div className={"ml20"} style={{width:"100%"}}>
<div className={"members fl"}
<div className={"members fl autos"}
style={{paddingLeft: '9px'}}
onScroll={this.contentViewScroll}>
<CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}>
{memberslist===undefined?"":memberslist.members.length===0?
{memberslist===undefined?"":memberslist.length===0?
<div className="square-list clearfix">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">未找到包含{search}的学生</p>
{/*<p className="edu-nodata-p mb20">未找到包含{search}的学生</p>*/}
<p className="edu-nodata-p mb20">未找到该学生</p>
</div>
</div>:memberslist&&memberslist.members.map((item,key)=>{
</div>:memberslist&&memberslist.map((item,key)=>{
return(
<div key={key} style={{
@ -684,9 +706,9 @@ render(){
})
}
disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<div className={"fl ml5 fonthidden width87"} title={item.user_name} >{item.user_name}</div>
<div className={"fl ml5 fonthidden width87 color-grey-9"} title={item.group_name}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"} title={item.student_id}>{item.student_id}</div>
<div className={"fl ml5 fonthidden width100"} title={item.user_name} >{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"} title={item.group_name}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"} title={item.student_id}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div>
</div>
)
@ -704,22 +726,25 @@ render(){
white-space:nowrap
}
`}</style>
<div className={"members fl"}>
<div className={"members fl autos"}>
{selectmemberslist&&selectmemberslist.map((item,key)=>{
return(
<div key={key} style={{
width: '375px',
height: '30px',
display:item.user_name===undefined?"none":""
}}>
<div className={"fl ml5 fonthidden width87"} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width87 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"}>{item.student_id}</div>
{key>0?<div className={"fr ml20"}><i className={"iconfont icon-shanchudiao fl color-grey-9 "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""}
</div>
)
if(item.group_name!=undefined){
return(
<div key={key} style={{
width: '375px',
height: '30px',
display:item.user_name===undefined?"none":""
}}>
<div className={"fl ml5 fonthidden width100"} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
{key>0?<div className={"fr ml20"}><i className={"iconfont icon-shanchudiao fl color-grey-9 "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""}
</div>
)
}
})}
</div>

@ -33,7 +33,7 @@ class GraduationTasksedit extends Component{
componentDidMount(){
let {title_num}=this.state;
let tasksid=this.props.match.params.category_id;
let url ="/graduation_tasks/"+tasksid+"/edit.json"
@ -52,15 +52,18 @@ class GraduationTasksedit extends Component{
}
}
let namelength=result.data.task_name.length;
let sixlength=title_num-namelength
this.setState({
fileList:newfilelist,
description:result.data.description,
tasktype:result.data.task_type,
name:result.data.task_name,
data:result.data,
title_num:sixlength
})
this.props.form.setFieldsValue({
tasktype:result.data.task_type,
name:result.data.task_name,
@ -240,12 +243,12 @@ class GraduationTasksedit extends Component{
handleSubmit=(e)=>{
let {fileList}=this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
// if(fileList.length===0){
// this.setState({
// shixunsreplace:true,
// })
// return
// }
this.Commoninterface(fileList);
}

@ -214,13 +214,13 @@ class GraduationTasksnew extends Component {
// 提交按钮
handleSubmit = (e) => {
let {fileList} = this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
// if(fileList.length===0){
// this.setState({
// shixunsreplace:true,
// })
//
// return
// }
this.Commoninterface(fileList);
@ -342,8 +342,17 @@ class GraduationTasksnew extends Component {
</style>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 pb25 edu-back-white">
<Form.Item label="类型" >
<style>
{
`
.tasktype .ant-form-explain{
margin-top: -20px;
margin-bottom: 15px;
}
`
}
</style>
<Form.Item label="类型" className={"tasktype"}>
{getFieldDecorator('tasktype', {
rules: [{required: true, message: "请选择任务类型"}],
})(<Select className={"greyInput mb20"}
@ -355,8 +364,17 @@ class GraduationTasksnew extends Component {
<input type="hidden" id='tasktypes'/>
<span className={"newcoursestitle"}>选择确认后无法修改</span>
</Form.Item>
<Form.Item label="任务标题" >
<style>
{
`
.taskname .ant-form-explain{
margin-top: 0px;
margin-bottom: 0px;
}
`
}
</style>
<Form.Item label="任务标题" className={"taskname"} >
{getFieldDecorator('name', {
rules: [{required: true, message: "不能为空"}],
})(<Input placeholder="请输入任务名称最大限制60个字符" value={title_value} onInput={this.changeTitle}

@ -1056,13 +1056,16 @@ class GraduationTaskssettingapp extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} calssName="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} calssName="color-dark">导出作品附件</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
@ -1165,7 +1168,8 @@ class GraduationTaskssettingapp extends Component{
value={end_time===null||end_time===""?"":moment(end_time, dateFormat)}
onChange={this.onChangeTimeend}
disabledTime={disabledDateTime}
disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
// disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
disabled={this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""}
/>
</span>
@ -1248,7 +1252,8 @@ class GraduationTaskssettingapp extends Component{
<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
<div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
</Checkbox>
{crosscomment===true?<div>
<div className={"h20 mb30 ml30 mt20 ml87"}>

@ -73,7 +73,7 @@ class GraduationTaskssettingReply extends Component{
const user = this._getUser();
this.setState({
comments: addNewComment(this.state.comments, _id, content, user),
comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this),
total_count: this.state.total_count + 1
})
this.refs.editor.showEditor();

@ -701,7 +701,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => (
<span>
<a style={{color:'#989898'}}>
{record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm:ss')}
{record.turnovertime===""?"--":moment(record.turnovertime).format('YYYY-MM-DD HH:mm')}
</a>
</span>
),
@ -741,11 +741,11 @@ class GraduationTaskssettinglist extends Component{
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.finalscore.work_score==="--"?"未评阅": <pre>
<Tooltip placement="right" title={record.finalscore.work_score==="--"?"未评阅": <pre>
{record.finalscore.final_score.username}({record.finalscore.final_score.login})<br/>
{record.finalscore.ultimate_score===true?"":"教师评分:"+record.finalscore.teacher_comment_score+"分"}<br/>
{record.finalscore.cross_comment_score===undefined?"":"交叉评分:"+record.finalscore.cross_comment_score+"分"+<br/>}
{record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"+<br/>}
{record.finalscore.cross_comment_score===undefined||record.finalscore.cross_comment_score==="未批阅"?"交叉评分:--":"交叉评分:"+record.finalscore.cross_comment_score+"分"}<br/>
{record.finalscore.late_penalty===undefined?"":"迟交扣分:"+record.finalscore.late_penalty+"分"}<br/>
最终成绩{record.finalscore.work_score}<br/>
</pre>}>
<a style={{color:parseInt(record.finalscore.work_score)>90?'#DD1717':parseInt(record.finalscore.work_score)>60&&parseInt(record.finalscore.work_score)<90?"#FF6800":'#747A7F'}}>{record.finalscore.work_score==="--"?"--":record.finalscore.work_score}</a>
@ -800,55 +800,62 @@ class GraduationTaskssettinglist extends Component{
let category_id=this.props.match.params.category_id;
let task_Id = this.props.match.params.task_Id;
if(this.props.isStudent()===true){
columns.some((item,key)=> {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
}
)
}
if(taskslistdata&&taskslistdata.course_group_count<=0){
//分班有显示
columns.map((item,key)=>{
if(item.title==="分班"){
columns.splice(key,1)
columns.some((item,key)=> {
if (item.title === "分班") {
columns.splice(key, 1)
return true
}
}
})
)
}
if(taskslistdata&&taskslistdata.cross_comment===false){
columns.map((item,key)=>{
if(item.title==="交叉评分"){
columns.splice(key,1)
columns.some((item,key)=> {
if (item.title === "交叉评分") {
columns.splice(key, 1)
return true
}
}
)
}
if(taskslistdata&&taskslistdata.have_grouping===false){
columns.some((item,key)=> {
if (item.title === "关联项目") {
columns.splice(key, 1)
return true
}
})
}
)
if(taskslistdata&&taskslistdata.have_grouping===false){
columns.map((item,key)=>{
if(item.title==="关联项目"){
columns.splice(key,1)
}
})
columns.map((item,key)=>{
if(item.title==="分组"){
columns.splice(key,1)
}
})
}
}else{
if(taskslistdata&&taskslistdata.have_grouping===false){
columns.map((item,key)=>{
if(item.title==="关联项目"){
columns.splice(key,1)
}
})
columns.some((item,key)=> {
if (item.title === "分组") {
columns.splice(key, 1)
return true
}
}
)
columns.map((item,key)=>{
if(item.title==="分组"){
columns.splice(key,1)
}
})
}
}
}
return(
<React.Fragment>
@ -1010,13 +1017,16 @@ class GraduationTaskssettinglist extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} calssName="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} calssName="color-dark">导出作品附件</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">学生成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">作品附件</a></li>
</ul>
</li>:""}
@ -1141,17 +1151,28 @@ class GraduationTaskssettinglist extends Component{
</ul>
<div id="graduation_work_list" style={{padding:'0px 40px 10px 40px'}}>
<style>
{
`
.edu-menu-lists li:hover {
background: #f0f0f0 !important;
}
.edu-menu-lists li:hover a{
color: #666 !important;
}
`
}
</style>
<div className="clearfix">
{this.props.isAdmin()===true?<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
个检索结果{taskslistdata&&taskslistdata.work_count} 学生 </span>:""}
{this.props.isAdmin()===true?<div className="fr color-grey-6 edu-menu-panel">
<p>
<a data-remote="true">
<a data-remote="true" class="color-grey-6 font-12">
{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<ul className="edu-menu-list edu-menu-lists" style={{width: '87px'}}>
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a>

@ -303,13 +303,16 @@ class GraduationTasksquestions extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} calssName="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} calssName="color-dark">导出作品附件</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -17,7 +17,7 @@ class Graduationtaskitem extends Component{
let { item }=this.props;
const _content = item.content && this.parseCommentContent(item.content)
return(
<div className="comment_item_cont df clearfix" key={item.id}>
<div className="comment_item_cont appraise df clearfix" key={item.id}>
<div className="J_Comment_Face fl">
<a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50"/>

@ -67,7 +67,7 @@ class GraduateTopicReply extends Component{
const user = this._getUser();
this.setState({
comments: addNewComment(this.state.comments, _id, content, user),
comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this),
total_count: this.state.total_count + 1
})
this.refs.editor.showEditor();

@ -221,7 +221,8 @@ class AddStudentModal extends Component{
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'学号'}</label></span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{''}</label></span>
</p>
<Spin size="large" spinning={isSpin}>
@ -252,7 +253,8 @@ class AddStudentModal extends Component{
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.student_id || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)

@ -292,7 +292,8 @@ class AddTeacherModal extends Component{
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'昵称'}</label></span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{''}</label></span>
</p>
{ candidates && candidates.length ? <div>
@ -322,7 +323,8 @@ class AddTeacherModal extends Component{
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)

@ -0,0 +1,158 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Upload, Divider, Icon } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import { ConditionToolTip, getUploadActionUrl } from 'educoder'
const { Dragger } = Upload;
class CreateGroupByImportModal extends Component{
constructor(props){
super(props);
this.state={
}
}
fetchMemberList = (arg_page) => {
}
componentDidMount() {
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/create_group_by_importing_file.json`
let { fileList } =this.state;
if (!fileList || fileList.length == 0) {
// this.props.showNotification('请先上传附件')
this.setState({
errorTip :'请先上传附件',
})
return;
}
let newfileList=[];
for(var list of fileList){
newfileList.push(list.response.id)
}
axios.post(url, {
attachment_ids: newfileList
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(response.data.message)
this.setVisible(false)
} else {
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.setState({ fileList: [] });
}
this.refs.modalWrapper.setVisible(visible)
}
handleChange = (info) => {
let fileList = info.fileList;
console.log(fileList)
this.setState({ fileList });
}
onOk = () => {
this.onSendOk()
}
onAttachmentRemove = (file) => {
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
// const { status } = response.data;
if (response.data.status === 0) {
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
const props = {
name: 'file',
multiple: true,
action: getUploadActionUrl(),
onRemove: this.onAttachmentRemove,
onChange: this.handleChange
};
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`导入创建分班`}
{...this.props }
onOk={this.onOk}
className="createGroupByImport"
>
<style>
{`
`}
</style>
<div className="df">
</div>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<Icon type="inbox" />
</p>
<p className="ant-upload-text">点击或拖拽文件到这里上传</p>
<p className="ant-upload-hint">
单个文件最大150MB
</p>
</Dragger>
</ModalWrapper>
)
}
}
export default CreateGroupByImportModal;

@ -14,6 +14,8 @@ import axios from 'axios'
import _ from 'lodash'
import NoneData from "../coursesPublic/NoneData"
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search;
const dataSource = [{
check:<Checkbox></Checkbox>,
@ -78,6 +80,15 @@ const buildColumns = (that) => {
width:"50%",
className:"color-grey-6"
}];
const isAdminOrStudent = that.props.isAdminOrStudent()
if (!isAdminOrStudent) {
columns.some((item,key)=> {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
})
}
const isAdmin = that.props.isAdmin()
if (isAdmin) {
columns.unshift({
@ -488,7 +499,10 @@ class studentsList extends Component{
searchPlaceholder={ '请输入姓名、学号进行搜索' }
firstRowRight={
<React.Fragment>
{/* { isSuperAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addTeacher()}>导入创建分班</WordsBtn> } */}
{ isSuperAdmin && <React.Fragment>
{/* <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal> */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn> */}
</React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
@ -582,11 +596,13 @@ class studentsList extends Component{
)
}) }
{ isAdmin &&
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={()=>this.addDir()}
>添加分班...</a>
</p>
}
</ul>
</li>}

@ -89,10 +89,20 @@ function buildColumns(that) {
</p>):
''
}
{course_groups && course_groups.length > 1 && <li key={'_all' + index} >
{/* 防止被外面group包裹 */}
<Checkbox.Group>
<Checkbox
checked={that.state.checkAllArray[index]}
style={{ marginRight: '6px' }} onClick={(e) => that.onCheckAllChange(e, item, index)} onChange={() => {}}
>全选</Checkbox>
</Checkbox.Group>
</li>}
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator}
>
{
course_groups && course_groups.filter((item) => {
return (!that.state.groupSearchValue || item.name.indexOf(that.state.groupSearchValue) != -1)
@ -107,6 +117,11 @@ function buildColumns(that) {
)
})
}
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={() => trigger('groupAdd', that.props.coursesids)}
>添加分班...</a>
</p>
</Checkbox.Group>
</ul>}
</React.Fragment> }
@ -165,7 +180,7 @@ function buildColumns(that) {
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return <Checkbox value={content}></Checkbox>
return content ? <Checkbox value={content}></Checkbox> : ''
}
})
}
@ -190,7 +205,20 @@ class studentsList extends Component{
teachers: [],
checkBoxValues: [],
isSpin:false,
application_list: []
application_list: [],
checkAllArray: []
}
}
onCheckAllChange = (e, item, index) => {
const that = this;
debugger;
const checkAllArray = that.state.checkAllArray.slice(0)
checkAllArray[index] = !checkAllArray[index]
that.setState({checkAllArray})
if (checkAllArray[index]) {
that.joinCourseGroup(that.state.course_groups.map((item) => item.id), item, index)
} else {
that.joinCourseGroup([], item, index)
}
}
inputSearch=(e)=>{

@ -523,9 +523,7 @@ class Poll extends Component{
<p className="fl font-16" style={{"marginTop":"27px"}}>
<span className="mr20">{polls_counts && polls_counts.polls_total_counts}个问卷</span>
<span className="mr20">已发布{polls_counts && polls_counts.polls_published_counts}</span>
{
isAdmin && <span>未发布{polls_counts && polls_counts.polls_unpublish_counts}</span>
}
<span>未发布{polls_counts && polls_counts.polls_unpublish_counts}</span>
</p>
<div className="fr mt16 mb16 searchView">
<Search

@ -3,6 +3,7 @@ import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn,ActionBtn} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import NoneData from '../coursesPublic/NoneData'
import {
Form,
Select,
@ -93,23 +94,27 @@ class ShixunStudentWork extends Component {
let url = "/homework_commons/" + homeworkid + "/code_review_results.json";
axios.get(url).then((response) => {
debugger
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
let datas=[];
let list=response.data.users_reviews;
for(var i=0; i<list.length; i++){
datas.push({
number:i+1,
name:list[i].username,
stduynumber:list[i].student_id,
classroom:parseInt(list[i].code_rate),
operating:list[i].user_id
if(response.data.status!=-2){
let datas=[];
let list=response.data.users_reviews;
for(var i=0; i<list.length; i++){
datas.push({
number:i+1,
name:list[i].username,
stduynumber:list[i].student_id,
classroom:parseInt(list[i].code_rate),
operating:list[i].user_id
})
}
this.setState({
data: response.data,
datalist:datas
})
}
this.setState({
data: response.data,
datalist:datas
})
}
}
@ -154,21 +159,24 @@ class ShixunStudentWork extends Component {
}}).then((response) => {
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
let datas=[];
let list=response.data.users_reviews;
for(var i=0; i<list.length; i++){
datas.push({
number:i+1,
name:list[i].username,
stduynumber:list[i].student_id,
classroom:parseInt(list[i].code_rate),
operating:list[i].user_id
if(response.data.status!=-2) {
let datas = [];
let list = response.data.users_reviews;
for (var i = 0; i < list.length; i++) {
datas.push({
number: i + 1,
name: list[i].username,
stduynumber: list[i].student_id,
classroom: parseInt(list[i].code_rate),
operating: list[i].user_id
})
}
this.setState({
data: response.data,
datalist: datas
})
}
this.setState({
data: response.data,
datalist:datas
})
}
}
@ -505,6 +513,18 @@ class ShixunStudentWork extends Component {
},
];
if(this.props.isNotMember()===true){
columns.some((item,key)=> {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
}
)
}
return (
<div className="newMain clearfix ">
{this.state.showmodel===true?<ShixunWorkModal
@ -535,7 +555,6 @@ class ShixunStudentWork extends Component {
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
{data&&data?
<div className={"educontent mb20"}>
<div className="educontent mb25">
<p className="clearfix mb25 mt5">
@ -554,10 +573,10 @@ class ShixunStudentWork extends Component {
</div>
<div className="educontent mb30">
<p className=" fl color-black summaryname">
{data.homework_name}
{data&&data.homework_name}
</p>
<CoursesListType
typelist={data.homework_status}
typelist={data&&data.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}`}>返回</a>
@ -593,10 +612,10 @@ class ShixunStudentWork extends Component {
href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}
>导出</a> : ""}
{this.props.isAdmin()?
data.end_immediately===true?
data&&data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "" : ""}
{this.props.isAdmin()?
data.publish_immediately===true?
data&&data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "" : ""}
{/*{this.props.isAdmin()?*/}
@ -623,10 +642,11 @@ class ShixunStudentWork extends Component {
`}
</style>
<li className="clearfix startbox" style={{display:duplicatechecking===true?"":"none"}}>
<li className="clearfix startbox mb20" style={{display:duplicatechecking===true?"":"none"}}>
<span className={"startfont"}>
正在执行查重请稍后刷新页面查看结果 温馨提示执行时间因查重作品数以及作品的代码量而异
</span>
<NoneData></NoneData>
</li>
<style>
{`
@ -638,6 +658,8 @@ class ShixunStudentWork extends Component {
`}
</style>
{data&&data?
<div>
<ul className="clearfix" style={{padding: '20px 40px 10px 40px'}}>
<li className="clearfix ">
@ -742,9 +764,9 @@ class ShixunStudentWork extends Component {
/>}
</div>
</div>
</div>:""}
</div>:""}
</div></div>

@ -14,9 +14,8 @@ class ShixunWorkModal extends Component{
}
}
componentDidMount() {
let {group_list}=this.state;
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
axios.get(url,{params:{
limit:10,
page:1,
@ -28,9 +27,16 @@ class ShixunWorkModal extends Component{
group_list:undefined
})
}else{
const newgroup_list=[];
response.data.group_list.map((item,key)=>{
newgroup_list.push(item)
})
if( response.data.ungroup_list!== undefined || response.data.ungroup_list !== null){
newgroup_list.push(response.data.ungroup_list)
}
this.setState({
course_groups:response.data,
group_list:response.data.group_list
group_list:newgroup_list,
})
}
@ -43,18 +49,36 @@ class ShixunWorkModal extends Component{
//勾选实训
shixunhomeworkedit=(checkedValues)=>{
let types=false
let{group_list}=this.state;
if(checkedValues.length===group_list.length){
this.setState({
onChangetype:true,
group_ids:checkedValues
})
}else{
this.setState({
group_ids:checkedValues,
onChangetype:false
})
}
group_list.map((item,key)=>{
if(item!=undefined){
checkedValues.map((list,li)=>{
if(item.id===list){
if(item.works_count<2){
this.props.showNotification(`有效作品数少于2个无法查重`)
types=true
return
}
}
})
}
})
if(types===false){
if(checkedValues.length===group_list.length){
this.setState({
onChangetype:true,
group_ids:checkedValues
})
}else{
this.setState({
group_ids:checkedValues,
onChangetype:false
})
}
}
}
contentViewScroll=(e)=>{
@ -71,17 +95,33 @@ class ShixunWorkModal extends Component{
page:newpage,
}
}).then((response) => {
response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{
newgroup_list.push(item)
})
response.data. course_groups.ungroup_list&&response.data.ungroup_list.map((items,keys)=>{
newgroup_list.push(items)
})
this.setState({
course_groups:response.data,
group_list:newgroup_list,
page:newpage
})
if(response!==null || response!==undefined){
if(response.data.group_list.length>0){
console.log("84");
response.data.group_list.map((item,key)=>{
newgroup_list.push(item);
this.setState({
course_groups:response.data,
group_list:newgroup_list,
page:newpage
})
})
}
if(response.data.ungroup_list===undefined || response.data.ungroup_list === null) {
}else {
console.log("95");
console.log(response.data.ungroup_list);
newgroup_list.push(response.data.ungroup_list);
this.setState({
course_groups:response.data,
group_list:newgroup_list,
page:newpage
})
}
}
}).catch((error) => {
console.log(error)
});
@ -130,10 +170,10 @@ class ShixunWorkModal extends Component{
this.props.showNotification(`请先选择分班`);
return
}
if(group_ids&&group_ids.length < 2){
this.props.showNotification(`有效作品数少于2个无法查重`);
return
}
// if(group_ids&&group_ids.length < 2){
// this.props.showNotification(`有效作品数少于2个无法查重`);
// return
// }
let url="/homework_commons/"+this.props.match.params.homeworkid+"/homework_code_repeat.json";
axios.post(url, {
@ -247,17 +287,17 @@ class ShixunWorkModal extends Component{
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
value={item.id}
value={item=== undefined?"":item.id}
>
<label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{item.name}</label>
className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '150px'}}>
{item.works_count}
{item===undefined?"":item.works_count}
</li>
<li className="fl" style={{width: '160px'}}>
{item.last_review_time}
{item===undefined?"":item.last_review_time}
</li>
</div>
)

@ -1676,7 +1676,7 @@ class Trainingjobsetting extends Component {
}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?this.state.code_review===false?"": <Link
{this.props.isAdmin()?this.state.code_review===true?"": <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""}
<style>{
@ -1708,7 +1708,7 @@ class Trainingjobsetting extends Component {
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""}
{this.props.isAdmin()?
this.state.code_review===false?<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
this.state.code_review===true?<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "":""}
</div>
</div>

@ -401,7 +401,7 @@ class Workquestionandanswer extends Component {
className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?
this.state.code_review===false?"":<Link
this.state.code_review===true?"":<Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link>:""}
@ -421,7 +421,7 @@ class Workquestionandanswer extends Component {
{this.props.isAdmin()?
this.state.code_review===false?
this.state.code_review===true?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
:"":""}

@ -117,7 +117,7 @@ class MemoDetailMDEditor extends Component {
this.initMDEditor()
}
render() {
const { match, history, memo, placeholder } = this.props
const { match, history, memo, placeholder, className } = this.props
const { isInited, errorMsg } = this.state
if (!memo) {
return <div></div>
@ -154,7 +154,7 @@ class MemoDetailMDEditor extends Component {
}
`}</style>
<div style={{ display: isInited ? 'none' : '', borderBottom: `${this.props.commentsLength == 0 ? 'none' : '1px solid #EEEEEE'}`}}
className="mockInputWrapper commentInput" >
className={`mockInputWrapper commentInput ${className}`} >
<input onClick={this.onMockInputClick} placeholder={placeholder || '我要回复'}></input>
<a href="javascript:void(0)"
onClick={this.onMockInputClick} className="commentsbtn task-btn task-btn-blue">
@ -172,7 +172,7 @@ class MemoDetailMDEditor extends Component {
`
} */}
</style>
<div nhname={`new_message_${memo.id}`} className="commentInput commentInputs"
<div nhname={`new_message_${memo.id}`} className={`commentInput commentInputs ${className}`}
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} >
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>

@ -28,7 +28,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component {
}
render() {
const { shixun, challenge, lockedAnswers } = this.props;
const { shixun, challenge, lockedAnswers, unlockedAnswers } = this.props;
const { currentLevel } = this.state;
return (
<div className="answerMultiLevelUnlock">
@ -85,7 +85,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component {
<Radio onClick={() => this.onLevelClick(item, index)}
checked={currentLevel>=index}></Radio>
</div>
<div className="twoSpanCol">{index + 1}</div>
<div className="twoSpanCol">{index + 1 + (unlockedAnswers && unlockedAnswers.length || 0) }</div>
<div className="autoCol">{item.name}</div>
<div className="fourSpanCol">{item.score}%</div>
<div className="fourSpanCol goldColor">{challenge.score * item.score / 100}</div>

@ -95,7 +95,7 @@ class SiderBar extends Component {
</div>
<div className="feedback" tooltips="意见反馈">
<a target="_blank" className="color_white" href="https://www.educoder.net/help?index=6">
<a target="_blank" className="color_white" href="/help?index=6">
<i className="iconfont icon-yijianfankui color-white font-22"></i>
</a>
</div>

@ -216,7 +216,7 @@ export function TPMIndexHOC(WrappedComponent) {
// 非课堂成员
isNotMember = () => {
// return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity === 6
return this.state.coursedata&&this.state.coursedata.course_identity >= 6
}
// setTrialapplication = ()=>{

@ -1195,7 +1195,7 @@ export default class TPMsettings extends Component {
}
</Select>
<p
className="edu-txt-right font-12"
className="edu-txt-left font-12"
style={{display:operateauthority?"block":'none'}}
>
列表中没有
@ -1214,6 +1214,7 @@ export default class TPMsettings extends Component {
<label className="panel-form-label fl"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150"
style={{width:'100%'}}
onInput={this.sendsure_applyvalues}
value={sendsure_applyvalue}
placeholder="请输入新增镜像需要安装的软件及版本等信息" id="demand_info"></textarea>
@ -1354,10 +1355,11 @@ export default class TPMsettings extends Component {
<textarea className="task-form-80 task-height-150 panel-box-sizing fl mt10"
onInput={this.Executiveorder}
value={Executiveordervalue}
style={{width:'100%'}}
id="executive_command"
>
</textarea>
<p className="-text-danger fl mt10 ml95"
<p className="-text-danger fl mt5"
id="executive_command_notice"
style={{display: Executivetyoe === false ? "none" : "block"}}
>执行命令不能为空</p>
@ -1369,6 +1371,7 @@ export default class TPMsettings extends Component {
value={Compilecommandvalue}
onInput={this.Compilecommand}
id="compile_command"
style={{width:'100%'}}
>
</textarea>
</li>

@ -239,7 +239,9 @@ export default class TPMMDEditor extends Component {
}
__editorName.cm.on("change", (_cm, changeObj) => {
that.contentChanged = true;
if (that.state.showError) {
that.setState({showError: false})
}
that.onEditorChange()
})
that.props.onCMBlur && __editorName.cm.on('blur', () => {
@ -256,6 +258,9 @@ export default class TPMMDEditor extends Component {
}, this);
}
showError = () => {
this.setState({showError: true})
}
onEditorChange = () => {
if (!this.answers_editormd) return;
const val = this.answers_editormd.getValue();
@ -297,14 +302,18 @@ export default class TPMMDEditor extends Component {
render() {
let {
choice_url,
showError
} = this.state;
let { mdID, className, noStorage } = this.props;
let _style = {}
if (showError) {
_style.border = '1px solid red'
}
return (
<React.Fragment>
<div className={`df ${className}`}>
<div className={`df ${className}`} >
{/* padding10-20 */}
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`}>
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}>
<textarea style={{display: 'none'}} id="evaluate_script_show" name="content"></textarea>
<div className="CodeMirror cm-s-defualt">
</div>

@ -381,7 +381,7 @@ export default class TPMevaluation extends Component {
// })
// }
savegetfilepath=(value)=>{
let {selectpath} = this.state
let {selectpath,saveshixunfilepath} = this.state
// let newarr =selectpatharr;
// let arrtype=false;
// let arrsum=0;
@ -403,9 +403,28 @@ export default class TPMevaluation extends Component {
// newselectpath=newselectpath+newarr[z]+ ""
// }
// let newselectpath=selectpath+value+ ""
let newselectpath=value
let newselectpath;
if(saveshixunfilepath==="shixunfilepathplay"){
newselectpath=value
}else{
const type = selectpath.split('');
let types=false;
for(var i=0; i<type.length; i++){
if(type[i]===value){
types=true
return
}
}
if(types===false){
newselectpath=selectpath+value+ ""
}else{
newselectpath=selectpath
}
}
this.setState({
// selectpatharr:newarr,
selectpath: newselectpath,

@ -4,7 +4,7 @@ import {TPMIndexHOC} from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form} from 'antd';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd';
// import "antd/dist/antd.css";
@ -523,9 +523,17 @@ class Newshixuns extends Component {
return item.response ? item.response.id : item.id
})
}
debugger
if( attachment_ids === undefined || attachment_ids.length===0){
this.props.showNotification(`请上传附件`);
notification.open(
{
message: '提示',
description:
'请上传附件!',
}
)
return;
}
// console.log("attachment_ids"+attachment_ids);
@ -563,7 +571,16 @@ class Newshixuns extends Component {
testcoderunmode:"",
})
}
this.props.showNotification('提交成功!');
// this.props.showNotification('提交成功!');
notification.open(
{
message: '提示',
description:
'提交成功!',
}
)
this.sendhideModaly()
// this.props.history.push(`/courses/${cid}/graduation_topics`);
// }
}
@ -763,8 +780,15 @@ class Newshixuns extends Component {
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {
this.props.showNotification(`文件大小必须小于50MB`);
// this.props.showNotification(`文件大小必须小于50MB`);
notification.open(
{
message: '提示',
description:
'文件大小必须小于50MB',
}
)
}
if(thiss.state.file !== undefined){
console.log("763")
@ -881,7 +905,7 @@ class Newshixuns extends Component {
})
}
</Select>
<p className="edu-txt-right font-12">
<p className="edu-txt-left font-12">
列表中没有
<a className="color-blue" onClick={this.post_apply}> 申请新建</a>
</p>

@ -33,6 +33,7 @@ class Collaborators extends Component {
Collaboratorsvisible: false,
Collaboratorsvisibleadmin: false,
value: 1,
page: 1,
Searchadmin: [],
allChangechecked: false,
Collaboratorslist: [],
@ -155,6 +156,9 @@ class Collaborators extends Component {
}
onSearchadmin = (value) => {
let {collaboratorList,user_name,school_name} = this.state;
this.setState({
Searchadmin: [],
})
// if (value === "") {
// this.setState({
// Searchadmin: [],
@ -172,7 +176,7 @@ class Collaborators extends Component {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
let newlist = response.data;
let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) {
newlist[i].checked = false
}
@ -336,7 +340,48 @@ class Collaborators extends Component {
collaboratorListsumtype:false
})
}
render() {
contentViewScrolledit=(e)=>{
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state;
let newpage=page+1;
let newSearchadmin=Searchadmin
let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/add_collaborators.json";
axios.get(url,{params:{
user_name:user_name ,
school_name:school_name,
page:newpage
}}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) {
newlist[i].checked = false
newSearchadmin.push(newlist[i])
}
console.log(newSearchadmin)
this.setState({
Searchadmin: newSearchadmin,
collaboratorList: collaboratorList,
page:newpage
})
}
}).catch((error) => {
console.log(error)
});
}
}
render() {
let {
collaboratorList,
Collaboratorsvisible,
@ -445,13 +490,13 @@ class Collaborators extends Component {
>搜索</a>
<p className="clearfix pl35 mt20">
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w80 task-hide font-bd">呢称</span>
<span className="fl edu-txt-w80 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span>
</p>
<div className="mt5" style={{background: '#f7f9fd'}}>
<div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => {
@ -460,10 +505,12 @@ class Collaborators extends Component {
<Checkbox className="fl mr20" checked={item.checked}
onChange={(e) => this.selectChangenickname(e, key)}
id={item.user_id}></Checkbox>
<a className="task-hide color-grey3 ml20 fl span1 edu-txt-w80">{item.nickname}</a>
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
<span
className="span3 color-grey fl edu-txt-w260 task-hide">{item.school_name}</span>
title={item.school_name}
style={{width: '150px'}}
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
</li>
)
})

@ -97,3 +97,51 @@ return;
// var uglified = uglify.minify(['file1.js', 'file2.js', 'file3.js']);
/**
优化
underscore被单独加载了去掉'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\underscore.min.js',
marked
raphaeljs sequence diagrams 1.0.4
统计 js_min_all加载的js
https://github.com/paulmillr/es6-shim
jQuery v1.8.3 jquery.com
Underscore.js 1.8.2
marked v0.3.3
Raphaël 2.1.3 - JavaScript Vector Library
flowchart, v1.3.4
editormd.js
CodeMirror
cm active-line.js
cm mode javascript
cm merge.js
CodeMirror addon hint
cm showHint
cm anyword-hint
CodeMirror python
CodeMirror c-like(java)
CodeMirror matchbrackets
>
// Copyright (C) 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
Loading…
Cancel
Save