路径调整

dev_forum
杨树明 6 years ago
parent b1069b9afd
commit 86eae252e8

@ -11,7 +11,7 @@ import GraduationTasksappraiseMainEditor from '../../graduation/tasks/Graduation
import CCommentItem from '../../common/comments/CCommentItem'; import CCommentItem from '../../common/comments/CCommentItem';
import '../../../forums/Post.css'; import '../../../forums/Post.css';
import '../../../comment/Comment.css'; import '../../../comment/Comment.css';
import '../../../courses/common/courseMessage.css'; import '../../common/courseMessage.css';
import '../../graduation/tasks/GraduationTasksappraiseReply.css'; import '../../graduation/tasks/GraduationTasksappraiseReply.css';
import './CommonWorkAppraiseReply.css'; import './CommonWorkAppraiseReply.css';

@ -7,7 +7,7 @@ import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHO
import GraduationTasksappraiseReplyChild from './GraduationTasksappraiseReplyChild'; import GraduationTasksappraiseReplyChild from './GraduationTasksappraiseReplyChild';
import '../../../forums/Post.css' import '../../../forums/Post.css'
import '../../../comment/Comment.css' import '../../../comment/Comment.css'
import '../../../courses/common/courseMessage.css' import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css' import './GraduationTasksappraiseReply.css'
const REPLY_PAGE_COUNT = 10 const REPLY_PAGE_COUNT = 10

@ -5,7 +5,7 @@ import GraduationTasksappraiseMainEditor from './GraduationTasksappraiseMainEdit
import Graduationtaskitem from './Graduationtaskitem' import Graduationtaskitem from './Graduationtaskitem'
import '../../../forums/Post.css' import '../../../forums/Post.css'
import '../../../comment/Comment.css' import '../../../comment/Comment.css'
import '../../../courses/common/courseMessage.css' import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css' import './GraduationTasksappraiseReply.css'
import ModulationModal from "../../coursesPublic/ModulationModal"; import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';

@ -1,7 +1,7 @@
import React, {Component} from "react"; import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn,ActionBtn,markdownToHTML} from 'educoder'; import {WordsBtn,ActionBtn,markdownToHTML} from 'educoder';
import GraduateTopicReply from '../../courses/graduation/topics/GraduateTopicReply' import GraduateTopicReply from '../graduation/topics/GraduateTopicReply'
import MemoDetailMDEditortwo from '../../forums/MemoDetailMDEditortwo' import MemoDetailMDEditortwo from '../../forums/MemoDetailMDEditortwo'
import { import {
Form, Form,

@ -0,0 +1,315 @@
import React,{ Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper';
import axios from 'axios';
import moment from 'moment';
import _ from 'lodash';
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseMainEditor from '../../graduation/tasks/GraduationTasksappraiseMainEditor';
import CCommentItem from '../../common/comments/CCommentItem';
import '../../../forums/Post.css';
import '../../../comment/Comment.css';
import '../../../courses/common/courseMessage.css';
import '../../graduation/tasks/GraduationTasksappraiseReply.css';
import './CommonWorkAppraiseReply.css';
import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals';
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
*/
class CommonWorkAppraiseReply extends Component{
constructor(props){
super(props);
this.editorRef = React.createRef();
this.state={
total_count: 0,
comment_scores: [],
}
}
fetchAllComments = () => {
let category_id= this.props.match.params.category_id;
// const url = `/graduation_works/${category_id}/comment_list.json`
const task_id = this.props.task_id
const url = `/student_works/${task_id}/comment_list.json`
axios.get(url).then((result)=>{
if(result.data.comment_scores){
const comment_scores = result.data.comment_scores.map(item => {
return this.transformReply(item)
})
this.setState({
...result.data,
comment_scores
})
}
}).catch((error)=>{
console.log(error)
})
}
replySuccess = () => {
this.fetchAllComments()
}
componentDidMount(){
this.fetchAllComments()
}
addSuccess = () => {
this.fetchAllComments()
}
transformReply = (reply, children = []) => {
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
if (reply.appeal_info && reply.appeal_info.time) {
reply.appeal_info.user_info = {
"user_name": reply.appeal_info.user_name,
"user_login": reply.appeal_info.user_login,
"user_image_url": reply.appeal_info.user_image_url
}
reply.appeal_info.is_appeal_info = true
reply.appeal_info.appeal_status = reply.appeal_status
reply.appeal_info.score_id = reply.score_id
reply.journals.push(reply.appeal_info)
reply.journals = _.orderBy(reply.journals, 'time', 'asc')
}
return {
isSuperAdmin: isSuperAdmin,
admin: isAdmin, //
journals: reply.journals,
appeal_status: reply.appeal_status,
attachments: reply.attachments,
can_appeal: reply.can_appeal,
can_reply: reply.can_reply,
child_message_count: reply.child_message_count,
id: reply.comment_id,
// time: moment(reply.comment_time).fromNow(),
time: moment(reply.comment_time).format('YYYY-MM-DD HH:mm'),
image_url: reply.user_image_url,
user_id: reply.user_id,
user_login: reply.user_login,
username: reply.user_name,
content: reply.content,
score: reply.score,
delete: reply.delete,
is_invalid: reply.is_invalid,
comment_role: reply.comment_role
}
}
onDelete = (item) => {
this.props.confirm({
content: '确定要删除这个评阅吗?',
okText: '确定',
cancelText: '取消',
onOk: () => {
let category_id= this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}`
axios.delete(url).then((result)=>{
if(result.data.status == 0){
this.props.showNotification('删除成功')
this.fetchAllComments()
}
}).catch((error)=>{
console.log(error)
})
},
onCancel() {
console.log('Cancel');
},
});
}
showModulationtype=(id)=>{
// console.log(id)
this.setState({
Modulationtype:true,
operationId:id
})
}
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
})
}
saveModulationModal=(value,num)=>{
console.log(value,num)
let {operationId}=this.state;
let studentWorkId =this.props.match.params.studentWorkId;
// console.log(value,num)
let url ="/student_works/"+studentWorkId+"/adjust_score.json";
axios.post(url,{
score:num,
comment:value
}).then((result)=>{
// console.log(result)
if(result.data.status===0){
// this.setState({
// Modalstype:true,
// Allocationtype:false,
// Modalstopval:result.data.message,
// ModalSave:this.cancelmodel,
// })
this.cancelmodel()
this.props.showNotification('调分成功')
this.props.onReplySuccess && this.props.onReplySuccess()
this.fetchAllComments();
}
}).catch((error)=>{
console.log(error)
})
}
onReply = (params) => {
const { task_id } = this.props;
const replyUrl = `/student_works/${task_id}/add_score.json`
axios.post(replyUrl, params).then((response)=>{
if(response.data.status == 0) {
this.editorRef.current.clearInputs()
this.fetchAllComments();
this.props.onReplySuccess && this.props.onReplySuccess()
}
}).catch((error)=>{
console.log(error)
})
}
render(){
let { total_count, comments, pageCount, comment_scores, allow_score } = this.state
const { current_user, memo, homework_status } = this.props
const isAdmin = this.props.isAdmin()
const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1
/**
isAdmin || 评阅入口超级管理员老师和助教显示 - 改成admin也不显示
匿评人匿评期间显示
*/
const needNiPingEditor = (allow_score && isNiPing);
if (!needNiPingEditor && comment_scores.length == 0) {
return ''
}
return(
<React.Fragment>
<div className="edu-back-white padding10-10" style={{marginTop: '16px'}}>
<div className={"stud-class-set edu-back-white mb10"} style={{height:"100%"}}>
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{this.state.Modulationtype===true?<ModulationModal
modalname={"调分"}
visible={this.state.Modulationtype}
Cancelname={"取消"}
Savesname={"保存"}
Cancel={this.cancelmodel}
Saves={(value,num)=>this.saveModulationModal(value,num)}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>:""}
{/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/}
{/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/}
{/* {
(!!comment_scores.length &&
<div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span>
<span className="count">{comment_scores.length}</span>
</div>)} */}
<div className="padding10-20 bor-bottom-greyE">
{!!comment_scores.length && <div className={"color-grey-6 font-16"}>
全部评阅<span className="count">{comment_scores.length===0?"":`(${comment_scores.length})`}</span>
{/* <div style={{ width:'100%',height:'75px'}} ></div> */}
{/* true: 老师身份显示“调分”入口false: 不显示调分入口 */}
{isAdmin && !allow_score &&
<a className={"fr color-blue font-16"} onClick={()=>this.showModulationtype(this.props.task_id)}>调分</a>
}
</div> }
{needNiPingEditor && <GraduationTasksappraiseMainEditor {...this.props}
title={'评语'}
showModulationtype={this.showModulationtype}
addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length}
onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"}
></GraduationTasksappraiseMainEditor> }
</div>
<div className={`padding20 ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} memoReplies commentsDelegateParent course-message`}
style={{ paddingTop: '0px', paddingBottom: '0px' }}
>
{/*
.course-message .panel-comment_item {
margin-top: ${needNiPingEditor ? 56 : 28}px;
}
*/}
<style>{`
.course-message .panel-comment_item .comment_orig_content {
width: 1074px;
}
.course-message .childrenCommentsView .comment_orig_content {
width: 1000px;
}
.comment_item_cont:last-child {
border-bottom: none;
}
`}</style>
{!!comment_scores.length && <div className="panel-comment_item">
{ comment_scores.map((item, index) => {
return <CCommentItem item={item} onDelete={this.onDelete} {...this.props} commentIndex={index} replySuccess={this.replySuccess}></CCommentItem>
}) }
</div>}
</div>
</div>
</div>
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (CommonWorkAppraiseReply);

@ -0,0 +1,193 @@
import React,{ Component } from "react";
import { Pagination } from "antd";
import axios from 'axios'
import moment from 'moment'
import { getImageUrl,WordsBtn } from 'educoder';
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseReplyChild from './GraduationTasksappraiseReplyChild';
import '../../../forums/Post.css'
import '../../../comment/Comment.css'
import '../../../courses/common/courseMessage.css'
import './GraduationTasksappraiseReply.css'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
*/
class GraduationTasksappraiseReply extends Component{
constructor(props){
super(props);
this.state={
total_count: 0,
comment_scores: []
}
}
fetchAllComments = () => {
let category_id= this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/comment_list.json`
axios.get(url).then((result)=>{
if(result.data.comment_scores){
const comment_scores = result.data.comment_scores.map(item => {
return this.transformReply(item)
})
this.setState({
...result.data,
comment_scores
})
}
}).catch((error)=>{
console.log(error)
})
}
componentDidMount(){
this.fetchAllComments()
}
addSuccess = () => {
this.fetchAllComments()
}
transformReply = (reply, children = []) => {
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
return {
isSuperAdmin: isSuperAdmin,
admin: isAdmin, //
children: children,
child_message_count: reply.child_message_count,
id: reply.comment_id,
image_url: reply.user_image_url,
// time: moment(reply.comment_time).fromNow(),
time: moment(reply.comment_time).format('YYYY-MM-DD HH:mm'),
user_login: reply.user_login,
username: reply.user_name,
content: reply.content,
score: reply.score,
delete: reply.delete,
is_invalid: reply.is_invalid,
comment_role: reply.comment_role
}
}
onDelete = (item) => {
this.props.confirm({
content: '确定要删除这个评阅吗?',
okText: '确定',
cancelText: '取消',
onOk: () => {
let category_id= this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}`
axios.delete(url).then((result)=>{
if(result.data.status == 0){
this.props.showNotification('删除成功')
this.fetchAllComments()
}
}).catch((error)=>{
console.log(error)
})
},
onCancel() {
console.log('Cancel');
},
});
}
showModulationtype=(id)=>{
// console.log(id)
this.setState({
Modulationtype:true,
operationId:id
})
}
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
})
}
saveModulationModal=(value,num)=>{
console.log(value,num)
let {operationId}=this.state;
// console.log(value,num)
let url ="/graduation_works/"+operationId+"/adjust_score.json";
axios.post(url,{
score:num,
comment:value
}).then((result)=>{
// console.log(result)
if(result.data.status===0){
this.setState({
Modalstype:true,
Allocationtype:false,
Modalstopval:result.data.message,
ModalSave:this.cancelmodel,
})
}
}).catch((error)=>{
console.log(error)
})
}
render(){
let { total_count, comments, pageCount, comment_scores } = this.state
const { current_user, memo } = this.props
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
return(
<React.Fragment>
<div className="edu-back-white padding20-30" style={{marginTop: '16px'}}>
{isStudent===true?comment_scores.length===0?
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<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 mb30">没有数据可以显示</p>
</div>
</div>
</div>:
<GraduationTasksappraiseReplyChild
{...this.props}
{...this.state}
cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)}
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
:
<GraduationTasksappraiseReplyChild {...this.state} {...this.props}
cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)}
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
}
</div>
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply);

@ -0,0 +1,103 @@
import React,{ Component } from "react";
import { Pagination } from "antd";
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import GraduationTasksappraiseMainEditor from './GraduationTasksappraiseMainEditor'
import Graduationtaskitem from './Graduationtaskitem'
import '../../../forums/Post.css'
import '../../../comment/Comment.css'
import '../../../courses/common/courseMessage.css'
import './GraduationTasksappraiseReply.css'
import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals';
const REPLY_PAGE_COUNT = 10
const $ = window.$;
class GraduationTasksappraiseReplyChild extends Component{
constructor(props){
super(props);
this.state={
}
}
render(){
let { total_count, comments, pageCount, comment_scores} = this.props;
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
return(
<React.Fragment>
<div className={"stud-class-set pd20 edu-back-white mb10"} style={{height:"100%"}}>
<Modals
modalsType={this.props.Modalstype}
modalsTopval={this.props.Modalstopval}
modalCancel={this.props.ModalCancel}
modalSave={this.props.ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{this.props.Modulationtype===true?<ModulationModal
modalname={"调分"}
visible={this.props.Modulationtype}
Cancelname={"取消"}
Savesname={"保存"}
Cancel={this.props.cancelmodel}
Saves={(value,num)=>this.props.saveModulationModal(value,num)}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>:""}
{/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/}
{/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/}
{this.props.ultimate===true? isAdmin &&
<div style={{ width:'100%',height:'75px'}} >
<a className={"fr color-blue font-16 mt10 mr20"} onClick={()=>this.props.showModulationtype(this.props.task_id)}>调分</a>
</div>
:""}
{this.props.ultimate===true?"":<div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span>
{ !!comment_scores.length && <span className="count">
{comment_scores.length===0?"":(comment_scores.length)}
</span> }
</div>}
<div className="padding20 bor-bottom-greyE memoReplies commentsDelegateParent course-message"
style={{ paddingTop: '0px', paddingBottom: '0px' }}
>
{/* style={{ display: (comments && !!comments.length) ? 'block' : 'none' }} */}
{/* <div className="replies_count">
</div> */}
{this.props.ultimate===true?"": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={this.props.addSuccess()}
></GraduationTasksappraiseMainEditor> }
<style>{`
`}</style>
<div className="panel-comment_item">
{ comment_scores.map(item => {
return <Graduationtaskitem item={item} onDelete={this.props.onDelete} {...this.props}></Graduationtaskitem>
}) }
</div>
</div>
</div>
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReplyChild);

@ -0,0 +1,511 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn,ActionBtn,markdownToHTML} from 'educoder';
import GraduateTopicReply from '../../courses/graduation/topics/GraduateTopicReply'
import MemoDetailMDEditortwo from '../../forums/MemoDetailMDEditortwo'
import {
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification
} from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import axios from 'axios';
import '../css/members.css'
import "../common/formCommon.css"
import '../css/Courses.css'
import './style.css'
import 'antd/lib/pagination/style/index.css';
import './Challenges.css'
import CommonReply from "../common/comments/CommonReply";
import Homeworddescription from "../shixunHomework/Homeworddescription";
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
// import Homeworddescription from "../shixunHomework/Homeworddescription";
const TextArea = Input.TextArea
//GraduationTaskssetting.js
//作业问答页面
class Workquestionandanswer extends Component {
//unifiedsetting 统一设置
//allowreplenishment 允许补交
//completionefficiencyscore 完成效率评分占比
//level级别
//proportion 比例
constructor(props) {
super(props);
// this.props.form.setFieldsValue({
// radiogroup:1,
//
// });
this.state ={
// namestring:"JFinal是基于Java语言的极速web开发框架其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展、`Restful`。在拥有Java语言所有优势的同时再拥有`ruby`、`python`等动态语言的开发效率。\r\n\r\n在本实训中我们将基于JFinal框架搭建一个在线商城。我们会学习到如何合理设计`Model`来进行数据表映射和数据操作、如何设计`Controller`对请求进行合理的处理…… 通过本实训,您不仅能收获到具体框架和技术的使用经验,也能对项目架构设计等知识有所了解或巩固。\r\n\r\n<div align=\"center\">\r\n\t<img src=\"/attachments/download/170838\" />\r\n</div>\r\n\r\n本实训聚焦一个在线商城项目的核心业务逻辑实现。你将在这一过程中收获Java Web项目设计的基本思想也能得到编程能力的一次跃升。",
props: props,
starttimetype: false,
endtimetype: false,
latetimetype: false,
allowlate: 1,
latepenaltytype: false,
unifiedsetting: false,
allowreplenishment: undefined,
completionefficiencyscore: false,
proportion: undefined,
level: undefined,
ealuation: false,
latededuction: undefined,
latedeductiontwo: undefined,
Showupdateinstructions:false,
database: false,
datasheet: false,
databasetwo: undefined,
datasheettwo: undefined,
publicwork: undefined,
memo: {id: "94", user_id: 1},
polls_descriptiontest: "作业说明...",
jobdescriptiondisplay:"none",
score_open:false,
code_review:false
}
}
componentDidMount() {
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
this.Gettitleinformation(homeworkid)
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
shixuntypes:type[3]
})
}
isupdatas=()=>{
var homeworkid = this.props.match.params.homeworkid;
this.Gettitleinformation(homeworkid)
}
//获取题目信息
Gettitleinformation = (homeworkid) => {
// console.log("获取题目信息");
let url = `/homework_commons/${homeworkid}.json`;
axios.get(url).then((result) => {
if (result.status === 200) {
// console.log(url)
// console.log("设置页")
// console.log(JSON.stringify(result))
this.setState({
jobsettingsdata:result,
...result.data
})
}
}).catch((error) => {
console.log(error)
})
}
jobdescriptiondisplaybj =()=>{
this.setState({
Showupdateinstructions:true,
})
}
//统一设置
onChange = (e) => {
this.setState({
unifiedsetting: e.target.checked,
})
// console.log(e.target.checked);
}
//立即发布
homeworkstart = () => {
let homeworkid=this.props.match.params.homeworkid;
let url="/homework_commons/"+homeworkid+"/publish_groups.json";
axios.get(url).then((response) => {
if (response.status === 200) {
let starttime = this.props.getNowFormatDates(1);
let endtime = this.props.getNowFormatDates(2);
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
visible: true,
Topval: "本操作只对“未发布”的对象生效",
Botvalleft: "暂不发布",
Botval: "则通过后续手动设置,定时发布",
starttime: "发布时间:" + starttime,
endtime: "截止时间:" + endtime,
Cancelname: "暂不发布",
Savesname: "立即发布",
Cancel: this.homeworkhide,
Saves: this.homeworkstartend,
course_groups: response.data.course_groups,
starttimes:starttime,
typs:"start",
})
}
}).catch((error) => {
console.log(error)
});
}
//立即截止
homeworkends = () => {
let homeworkid=this.props.match.params.homeworkid;
let url="/homework_commons/"+homeworkid+"/end_groups.json";
axios.get(url).then((response) => {
if (response.status === 200) {
this.setState({})
this.setState({
modalname: "立即截止",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
visible: true,
Topval: "本操作只对“提交中”的对象生效",
Botvalleft: "暂不截止",
Botval: "则将根据已设置的截止时间,定时截止",
Cancelname: "暂不截止",
Savesname: "立即截止",
Cancel: this.homeworkhide,
Saves: this.coursetaskend,
starttime: undefined,
endtime: undefined,
course_groups: response.data.course_groups,
typs:"end",
})
}
}).catch((error) => {
console.log(error)
});
}
// 立即发布
homeworkstartend = (ds,endtime) => {
var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time:endtime,
}).then((result) => {
if (result.status === 200) {
if (result.data.status === 0) {
notification.open({
message:"提示",
description:result.data.message
});
this.homeworkhide();
}
}
}).catch((error) => {
console.log(error);
})
}
//立即截止确定按钮
coursetaskend = () => {
var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
const cid = this.props.match.params.coursesId;
let url = "/courses/" + cid + "/homework_commons/end_homework.json";
axios.post(url, {
group_ids: course_groupslist,
homework_ids: [homeworkid],
})
.then((response) => {
if (response.data.status == 0) {
notification.open({
message:"提示",
description:response.data.message
});
this.homeworkhide()
}
})
.catch(function (error) {
console.log(error);
});
}
ReleaseNotes=(explanations)=>{
var homeworkid = this.props.match.params.homeworkid;
let url=`/homework_commons/${homeworkid}/update_explanation.json`;
axios.post((url), {
explanation: explanations
})
.then((result)=>{
if(result){
this.props.showNotification(`${result.data.message}`);
this.setState({
Showupdateinstructions:false
})
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
this.Gettitleinformation(homeworkid)
}
}).catch((error)=>{
console.log(error);
})
}
NOReleaseNotes=()=>{
this.setState({
Showupdateinstructions:false,
})
}
workshowmodel=()=>{
this.setState({
showmodel:true
})
}
hideshowmodel=()=>{
this.setState({
showmodel:false
})
}
homeworkhide=()=>{
this.isupdatas()
this.setState({
modalname:undefined,
modaltype:undefined,
visible:false,
Topval:undefined,
Topvalright:undefined,
Botvalleft:undefined,
Botval:undefined,
starttime:undefined,
endtime:undefined,
Cancelname:undefined,
Savesname:undefined,
Cancel:undefined,
Saves:undefined,
StudentList_value:undefined,
addname:undefined,
addnametype:false,
addnametab:undefined,
typs:undefined,
starttimes:undefined,
})
}
getcourse_groupslist=(id)=>{
this.setState({
course_groupslist:id
})
}
render() {
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let {starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata,score_open,Showupdateinstructions
, homework_id} = this.state;
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
};
const formItemLayout = {
labelCol: {span: 6},
wrapperCol: {span: 14},
};
let coursesId = this.props.match.params.coursesId;
return (
<div className="newMain clearfix ">
{this.state.showmodel===true?<ShixunWorkModal
{...this.props}
visible={this.state.showmodel}
modalname={"代码查重"}
data={[]}
issCancel={()=>this.hideshowmodel()}
updatas={()=>this.isupdatas()}
/>:""}
{/*立即发布*/}
<HomeworkModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
visible={this.state.visible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
<div className={"educontent mb20"}>
<div className="educontent mb30">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={"/courses/"+this.props.match.params.coursesId+"/students"}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb30">
<p className=" fl color-black summaryname">
{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}
</p>
<CoursesListType
typelist={jobsettingsdata === undefined ? [""] : jobsettingsdata.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>
<a className="color-grey-9 fr font-16 mr20" href={`/shixuns/${jobsettingsdata===undefined?"":jobsettingsdata.data.shixun_identifier}/challenges`} target={"_blank"}>实训详情</a>
</div>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
{this.props.isAdmin() === true? <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/list`}>作品列表</Link>:
<Link to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link>
// :<Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/noopenlist`}>作品列表(学生完成)</Link>
}
<Link
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
// 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>:""}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
{/*<a className="fr color-blue font-16" href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xls`}>导出成绩</a>*/}
{this.props.isAdmin() ? <a
className="fr color-blue font-16"
href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xls`}
>导出</a> : ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>:"" : ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> :"": ""}
{this.props.isAdmin()?
this.state.code_review===true?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
:"":""}
</div>
</div>
{jobsettingsdata === undefined|| jobsettingsdata.data.description===null? "" : <div className=" clearfix edu-back-white poll_list mt20 mr20 ">
<span>
<div className={"font-16 color-dark fl pl20 "}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g,"▁▁▁")}}></div>
{/* /!*{}}></div>
{/* /!*{jobsettingsdata.data.description}*!/*/}
{/* <textarea>*/}
{/* {*/}
{/* this.state.namestring*/}
{/* }*/}
{/* </textarea>*/}
</div>
{/* <div className="justify break_full_word new_li markdown-body"*/}
{/* id="challenge_editorMd_description">*/}
{/* <p id="ReactMarkdown" style={{overflow:'hidden'}}>*/}
{/* /!*{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?""*!/*/}
{/* <textarea className="w200">*/}
{/* {jobsettingsdata.data.description}*/}
{/* </textarea>*/}
{/* /!*}*!/*/}
{/* </p>*/}
{/*</div>*/}
</span>
</div>}
<div className=" clearfix edu-back-white poll_list pd10">
<div className="font-16 color-green fl pl20 mt10">作业说明:</div>
{
this.props.isAdmin()&&this.props.isAdmin()===true ?
<Tooltip placement="top" title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 " onClick={()=>this.jobdescriptiondisplaybj()} ></i></Tooltip>
:""
}
</div>
<span>
<div className="font-16 color-dark break_word flex1 pl20 " style={{"padding":"10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" :
<div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div>
}
</div>
</span>
</div>
{/* <style>*/}
{/* {*/}
{/* `.mockInputWrapper {*/}
{/* display: flex;*/}
{/* padding: 30px 20px 30px 20px;*/}
{/*}`*/}
{/* }*/}
{/* </style>*/}
{/* <div className="edu-back-white mb20 graduateTopic course-message"> */}
{/*<GraduateTopicReply memo={{id: graduation_topic_id, user_id: topicInfo && topicInfo.user_id}} course_id={course_id} {...this.props}></GraduateTopicReply>*/}
{/* </div> */}
{ Showupdateinstructions&& Showupdateinstructions === true?
<div >
<Homeworddescription {...this.props} ReleaseNotes={this.ReleaseNotes} NOReleaseNotes ={this.NOReleaseNotes} ></Homeworddescription>
</div>
:""
}
{ homework_id && <CommonReply
memo={{
id: homework_id,
}}
course_id={coursesId} {...this.props}
apiRouteName={'homework_commons'}
jour_type={'HomeworkCommon'}
></CommonReply>
}
</div>
</div>
)
}
}
export default Workquestionandanswer;

@ -1,172 +1,172 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { import {
Form, Form,
Select, Select,
Input, Input,
Button, Button,
Checkbox, Checkbox,
Upload, Upload,
Icon, Icon,
message, message,
Modal, Modal,
Table, Table,
Divider, Divider,
InputNumber, InputNumber,
Tag, Tag,
DatePicker, DatePicker,
Radio, Radio,
Tooltip, Tooltip,
notification notification
} from "antd"; } from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom'; import {Link, Switch, Route, Redirect} from 'react-router-dom';
import '../../modules/courses/css/members.css'; import '../courses/css/members.css';
import "../../modules/courses/common/formCommon.css" import "../courses/common/formCommon.css"
import '../../modules/courses/css/Courses.css'; import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png'; import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png'; import educodernet from '../../../src/images/login/educodernet.png';
import LoginRegisterComponent from '../user/LoginRegisterComponent'; import LoginRegisterComponent from '../user/LoginRegisterComponent';
import FindPasswordComponent from '../user/FindPasswordComponent'; import FindPasswordComponent from '../user/FindPasswordComponent';
import passopen from "../../images/login/passopen.png"; import passopen from "../../images/login/passopen.png";
//educoder登入页面 //educoder登入页面
var sectionStyle = { var sectionStyle = {
"height": "100%", "height": "100%",
"width": "100%", "width": "100%",
"min-width": "1000px", "min-width": "1000px",
// makesure here is String确保这里是一个字符串以下是es6写法 // makesure here is String确保这里是一个字符串以下是es6写法
}; };
var imgback = { var imgback = {
" background-size":"cover", " background-size":"cover",
"background-repeat":"no-repeat", "background-repeat":"no-repeat",
backgroundImage: `url(${beijintulogontwo})`, backgroundImage: `url(${beijintulogontwo})`,
} }
var imgmian ={ var imgmian ={
"width": "100%", "width": "100%",
"background": `url(${beijintulogontwo})`, "background": `url(${beijintulogontwo})`,
"height": "100%", "height": "100%",
"position": "relative", "position": "relative",
} }
var newContainer={ var newContainer={
"min-height": "100%", "min-height": "100%",
"background": `url(${beijintulogontwo})`, "background": `url(${beijintulogontwo})`,
"height": "auto !important", "height": "auto !important",
"position": "relative", "position": "relative",
} }
class EducoderLogin extends Component { class EducoderLogin extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
if( props.match.url === "/changepassword" ){ if( props.match.url === "/changepassword" ){
this.state = { this.state = {
showbool: false, showbool: false,
} }
}else { }else {
if(props.match.url === "/login"){ if(props.match.url === "/login"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:true loginstatus:true
} }
}else if(props.match.url === "/register"){ }else if(props.match.url === "/register"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:false, loginstatus:false,
} }
}else{ }else{
this.state = { this.state = {
showbool: true, showbool: true,
} }
} }
} }
} }
componentDidMount() { componentDidMount() {
} }
Setshowbool = () => { Setshowbool = () => {
if (this.state.showbool === true) { if (this.state.showbool === true) {
this.setState({ this.setState({
showbool: false showbool: false
}) })
} else { } else {
this.setState({ this.setState({
showbool: true showbool: true
}) })
} }
} }
render() { render() {
let {showbool} = this.state; let {showbool} = this.state;
return ( return (
<div style={newContainer} > <div style={newContainer} >
<style> <style>
{ {
` `
html, body, { html, body, {
height: 100%; height: 100%;
} }
` `
} }
</style> </style>
<div style={imgmian}> <div style={imgmian}>
<div style={{ <div style={{
"display": "flex", "display": "flex",
"justify-content": "center", "justify-content": "center",
"align-items": "center", "align-items": "center",
"width": "100%" "width": "100%"
}}> }}>
<div style={{"margin-top": "50px"}}> <div style={{"margin-top": "50px"}}>
<img src={educodernet}/> <img src={educodernet}/>
</div> </div>
</div> </div>
{ {
showbool === true ? showbool === true ?
<div style={{ <div style={{
"display": "flex", "display": "flex",
"justify-content": "center", "justify-content": "center",
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px"}}>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></LoginRegisterComponent> Setshowbool={this.Setshowbool}></LoginRegisterComponent>
<div style={{"width":"100%","height":"350px"}}> <div style={{"width":"100%","height":"350px"}}>
</div> </div>
</div> </div>
</div> </div>
: :
<div style={{ <div style={{
"display": "flex", "display": "flex",
"justify-content": "center", "justify-content": "center",
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px"}}>
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent> Setshowbool={this.Setshowbool}></FindPasswordComponent>
<div style={{"width":"100%","height":"250px"}}> <div style={{"width":"100%","height":"250px"}}>
</div> </div>
</div> </div>
</div> </div>
} }
</div> </div>
</div> </div>
) )
} }
} }
export default EducoderLogin; export default EducoderLogin;
Loading…
Cancel
Save