|
|
|
@ -10,14 +10,15 @@ import { formatDuring ,handleDateString} from 'educoder';
|
|
|
|
|
import '../css/members.css';
|
|
|
|
|
import '../css/busyWork.css';
|
|
|
|
|
import CourseLayoutcomponent from "./Exercise";
|
|
|
|
|
|
|
|
|
|
import LoginDialog from '../../login/LoginDialog';
|
|
|
|
|
const dataformat="YYYY-MM-DD HH:mm";
|
|
|
|
|
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
|
|
|
|
|
class ExerciseListItem extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
|
|
|
|
this.state={
|
|
|
|
|
Modalstype:false
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
isRender:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -40,7 +41,30 @@ class ExerciseListItem extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
Modifyloginvalue=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isRender:false,
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
showfiles =(url)=>{
|
|
|
|
|
// console.log("ShixunhomeWorkItemshowfiles");
|
|
|
|
|
// console.log( this.props.current_user.username);
|
|
|
|
|
try {
|
|
|
|
|
if(this.props.current_user.username==="游客"){
|
|
|
|
|
this.setState({
|
|
|
|
|
isRender:true,
|
|
|
|
|
match:"",
|
|
|
|
|
});
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
}
|
|
|
|
|
this.props.history.push(url);
|
|
|
|
|
// this.props.current_user
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cancelmodel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
@ -52,6 +76,7 @@ class ExerciseListItem extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let {isRender}=this.state;
|
|
|
|
|
let{item,checkBox,index}=this.props;
|
|
|
|
|
let {coursesId,Id}=this.props.match.params
|
|
|
|
|
const IsAdmin =this.props.isAdmin();
|
|
|
|
@ -76,6 +101,11 @@ class ExerciseListItem extends Component{
|
|
|
|
|
modalSave={this.state.ModalSave}
|
|
|
|
|
antIcon={this.state.Modalstypeloding}
|
|
|
|
|
></Modals>:""}
|
|
|
|
|
{isRender===true?<LoginDialog
|
|
|
|
|
Modifyloginvalue={()=>this.Modifyloginvalue()}
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
/>:""}
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
@ -96,20 +126,25 @@ class ExerciseListItem extends Component{
|
|
|
|
|
|
|
|
|
|
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
|
|
|
|
|
{
|
|
|
|
|
this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
|
|
|
|
|
this.props.isAdmin()? <a onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
|
|
|
|
|
className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
|
|
|
|
|
title={item.exercise_name}
|
|
|
|
|
to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
|
|
|
|
|
>{item.exercise_name}</a>:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.props.isStudent()?
|
|
|
|
|
<Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
|
|
|
|
|
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
|
|
|
|
|
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
|
|
|
|
|
>{item.exercise_name}</a>:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.props.isNotMember()? item.lock_status === 0 ?
|
|
|
|
|
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span>
|
|
|
|
|
: <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
|
|
|
|
|
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
|
|
|
|
|
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
|
|
|
|
|
>{item.exercise_name}</a>:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|