caishi 6 years ago
commit 06de981d65

@ -114,21 +114,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// 上线然后要注释回来
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
//
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall

@ -30,9 +30,10 @@ export function initAxiosInterceptors(props) {
var proxy = "http://localhost:3000"
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
//proxy = "https://testeduplus2.educoder.net"
// proxy = "https://testeduplus2.educoder.net"
proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};
@ -145,6 +146,11 @@ export function initAxiosInterceptors(props) {
if (response.data.status === 402) {
locationurl(response.data.url);
}
if (response.data.status === 401) {
return config;
}
// if (response.data.status === 407) {
// 在app js 中解决 Trialapplication
// // </Trialapplication>

@ -478,10 +478,10 @@ pop_box_new(htmlvalue, 480, 182);
resData.myshixun_manager = true
} else if (resData.user.identity === EDU_CERTIFICATION_TEACHER) {
resData.power = 1
resData.is_teacher = true
// resData.is_teacher = true
} else if (resData.user.identity === EDU_TEACHER) {
resData.is_teacher = true
// resData.is_teacher = true
} else if (resData.user.identity === EDU_NORMAL) {
}

@ -234,7 +234,7 @@ function buildColumns(that, student_works) {
<span>
<Tooltip title={
getScoreTip(student_score,
isNiPing ? `你的评阅分数:${record.student_score}` : <div>
that.state.is_evaluation ? `你的评阅分数:${record.student_score}` : <div>
{record.student_comment_count && <div>{`${record.student_comment_count}名学生进行了匿评`}</div>}
<div>有效平均分{record.student_score}</div>
</div>
@ -334,7 +334,7 @@ const orderMap = {
work_score: 'asc',
student_id: 'asc',
}
const PAGE_SIZE = 50
const PAGE_SIZE = 20
// 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting
class CommonWorkList extends Component{
@ -564,6 +564,19 @@ class CommonWorkList extends Component{
}
})
// time_status int 时间对应的状态: 0未发布1:提交中2:补交中3:匿评中4:申诉中5:评阅中6:已结束
let timeMsg = '提交剩余时间'
if (time_status === 1) {
} else if (time_status === 2) {
timeMsg = '补交剩余时间'
} else if (time_status === 3) {
timeMsg = '匿评剩余时间'
} else if (time_status === 4) {
timeMsg = '申诉剩余时间'
}
// console.log(StudentData)
// console.log(student_works)
return(
@ -638,7 +651,7 @@ class CommonWorkList extends Component{
(!!commit_count || !!uncommit_count) &&
<React.Fragment>
<span className="color-orange-tip">{commit_count}</span> {uncommit_count} 
{time_status===5?"":"剩余提交时间"}
{timeMsg || ''}
<span className="color-orange-tip">{left_time.time}</span>
</React.Fragment>
}

@ -1213,7 +1213,9 @@ class CommonWorkSetting extends Component{
</div>
<div className={"h20 mb30 ml60"}>
<span>结束时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?"发布时间已过,则不能修改":""}>
{/* <Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?"":""}>
</Tooltip> */}
<ConditionToolTip condition={moment(init_evaluation_end) < moment()} title={"时间已过,不能再修改"}>
<span>
<DatePicker
@ -1242,7 +1244,6 @@ class CommonWorkSetting extends Component{
<span className={"font-14 color-grey-9 ml10"}>学生匿评TA人作品的时间截点</span>
</Tooltip>
<span className={"font-14 color-grey-9 ml10"}></span>
</div>

@ -121,9 +121,7 @@ class UseBank extends Component{
})
}
onSave = () => {
this.setState({
hometypepvisible:true
})
const { checkBoxValues } = this.state;
const { object_type } = this.props
if(checkBoxValues.length==0){
@ -132,6 +130,9 @@ class UseBank extends Component{
})
return;
}
this.setState({
hometypepvisible:true
})
const courseId = this.props.match.params.coursesId
let url = `/question_banks/save_banks.json`
this.setState({ loading: true })
@ -290,7 +291,7 @@ class UseBank extends Component{
</div>
}
<p style={{height:"20px",lineHeight:"20px;"}}>
<p style={{height:"20px",lineHeight:"20px;", marginTop: '4px'}}>
{
isChecked !="" ? <span className="color-red">{isChecked}</span>:""
}

@ -153,22 +153,13 @@ class GraduationTasksappraiseReply extends Component{
const { current_user, memo } = this.props
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
const isNotMember=this.props.isNotMember();
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>:
{comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "": <div className="edu-back-white padding20-30" style={{marginTop: '16px'}}>
{isStudent===true?
<GraduationTasksappraiseReplyChild
{...this.props}
{...this.state}
@ -178,18 +169,28 @@ class GraduationTasksappraiseReply extends Component{
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
:
<GraduationTasksappraiseReplyChild {...this.state} {...this.props}
: <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);
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply);
{/*<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>*/}

@ -278,20 +278,20 @@ class GraduationTasksnew extends Component {
<style>
{
`.ant-form-item-label{
text-align: right;
vertical-align: middle;
padding: 0px 0px 20px 0px;
display: inline-block;
overflow: hidden;
white-space: nowrap;
line-height: 20px; */
}
.ant-form-item-control{
line-height: 39.9999px;
position: relative;
zoom: 1;
}
`
text-align: right;
vertical-align: middle;
padding: 0px 0px 20px 0px;
display: inline-block;
overflow: hidden;
white-space: nowrap;
line-height: 20px; */
}
.ant-form-item-control{
line-height: 39.9999px;
position: relative;
zoom: 1;
}
`
}
</style>
{/*内容*/}

@ -989,6 +989,9 @@ class GraduationTaskssettingapp extends Component{
.ant-input{
height:40px;
}
.linbox{
height: 26px;
}
`
}</style>
<div className="newMain clearfix">
@ -1010,14 +1013,14 @@ class GraduationTaskssettingapp extends Component{
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25">
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black lineh-25 summaryname">
<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{taskname}</Link>
<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"} className="color-grey-3">{taskname}</Link>
</p>
<CoursesListType
typelist={task_status}
/>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>

@ -101,7 +101,7 @@ class GraduationTaskssettinglist extends Component{
grouping: result.data.have_grouping === true ? worklists[i].grouping_name : null,
submitstate: worklists[i].status === 0 ? "未提交" : worklists[i].status === 1 ? "按时提交" : worklists[i].status === 2 ? "延时提交" : "",
turnovertime:worklists[i].update_time,
associationitems:result.data.have_grouping==false?"": {name:worklists[i].project_info === undefined ?"--": worklists[i].project_info.name,id:worklists[i].project_info.id},
associationitems:result.data.have_grouping==false?"": {name:worklists[i].project_info === undefined ?"--": worklists[i].project_info.name,id:worklists[i].project_info===undefined?"":worklists[i].project_info.id},
teacherrating: worklists[i].teacher_comment_score,
crossrating: {cross_comment_score:worklists[i].cross_comment_score,cross_comment_num:worklists[i].cross_comment_num},
finalscore: {work_score:worklists[i].final_score.work_score === null ? "--" : worklists[i].final_score.work_score,
@ -754,6 +754,7 @@ class GraduationTaskssettinglist extends Component{
}, {
title: '操作',
key: 'operation',
width:'100px',
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
@ -861,6 +862,9 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.linbox{
height: 26px;
}
`
}
</style>
@ -959,12 +963,12 @@ class GraduationTaskssettinglist extends Component{
<span className="color-grey-6 fl">任务详情</span>
</p>
<div className="clearfix lineh-25 mt20 mb20">
<p className=" fl color-black summaryname lineh-25"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p>
<div className="clearfix lineh-25 mt20 mb20 linbox">
<p className=" fl color-black summaryname lineh-25 "> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-3">{taskslistdata.task_name}</Link></p>
<CoursesListType
typelist={taskslistdata.task_status}
/>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>

@ -238,7 +238,15 @@ class GraduationTasksquestions extends Component{
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/>
<style>
{
`
.linbox{
height: 26px;
}
`
}
</style>
{questionslist&&questionslist?<div className="newMain clearfix">
<div className={"educontent mb20"}>
@ -250,14 +258,14 @@ class GraduationTasksquestions extends Component{
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25">
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{questionslist.task_name}</Link>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>

@ -209,12 +209,14 @@ class GraduationTasks extends Component{
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.fetchAll(search,page,order)
this.props.showNotification(response.data.message);
this.cancelmodel()
this.setState({
Modalstype:true,
Modalstype:false,
Modalstopval:response.data.message,
ModalsBottomval:"",
ModalSave:this.cancelmodel,
Loadtype:true,
Loadtype:false,
checkBoxValues:[],
checkAllValue:false
})

@ -79,9 +79,9 @@ class TraineetraininginformationModal extends Component {
return str;
}
render() {
var columns;
if(this.props.boolgalist&&this.props.boolgalist === true) {
columns = [
console.log(83);
console.log(this.props.boolgalist);
const columns = [
{
title: '关卡',
dataIndex: 'number',
@ -148,9 +148,8 @@ class TraineetraininginformationModal extends Component {
),
}
]
}
else {
columns = [
const columnss = [
{
title: '关卡',
dataIndex: 'number',
@ -200,7 +199,7 @@ class TraineetraininginformationModal extends Component {
),
}
]
}
return (
<div>
<Modal
@ -244,46 +243,108 @@ class TraineetraininginformationModal extends Component {
</div>
</div>
{
this.props.game_list === undefined?"" : this.props.game_list.length<4?
<div className="edu-table edu-back-white ">
<style>
{
` .ant-table-body{
{this.props.boolgalist === false?
<div>
{
this.props.game_list === undefined?"" : this.props.game_list.length<4?
<div className="edu-table edu-back-white ">
<style>
{
` .ant-table-body{
overflow: hidden !important;
}`
}
</style>
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
loading={false}
pagination={false}
onChange={this.TablePagination}
/>}
</div>
:
<div className="edu-table edu-back-white ">
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
pagination={{ //分页
total: this.props.game_list.length, //数据总数量
pageSize: this.props.game_list.length, //一页显示几条
current: 1,
}}
loading={false}
pagination={false}
onChange={this.TablePagination}
scroll={{ y: 300 }}
/>}
</div>
}
</div>
:
<div>
{
this.props.game_list === undefined?"" : this.props.game_list.length<4?
<div className="edu-table edu-back-white ">
<style>
{
` .ant-table-body{
overflow: hidden !important;
}`
}
}
</style>
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
</style>
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
columns={columnss}
loading={false}
pagination={false}
onChange={this.TablePagination}
/>}
</div>
:
<div className="edu-table edu-back-white ">
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
/>}
</div>
:
<div className="edu-table edu-back-white ">
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
columns={columnss}
pagination={{ //分页
total: this.props.game_list.length, //数据总数量
pageSize: this.props.game_list.length, //一页显示几条
current: 1,
}}
total: this.props.game_list.length, //数据总数量
pageSize: this.props.game_list.length, //一页显示几条
current: 1,
}}
loading={false}
pagination={false}
onChange={this.TablePagination}
scroll={{ y: 300 }}
/>}
</div>
}
/>}
</div>
}
</div>
}
</Modal>

@ -1747,7 +1747,7 @@ class Trainingjobsetting extends Component {
<div>
<div className="clearfix mb5 ml15">
<span className="font-16 mr15 fl mt6" style={{"color":"#999999"}}>发布时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : starttimetype === true ? "发布时间已过,则不能修改" : ""}></Tooltip>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditstwo === true ? "发布时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
showToday={false}
@ -1775,11 +1775,12 @@ class Trainingjobsetting extends Component {
}
</p>
</div>
</Tooltip>
<span className="ml20 fl mt10" style={{"color":"#999999","text-align":"left","font-size":"14px"}}>(学生收到作业的时间)</span>
</div>
<div className="clearfix ml15">
<span className="mr15 fl mt10 font-16" style={{"color":"#999999"}}>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : starttimetype === true ? "截止时间已过,则不能修改" : ""}> </Tooltip>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditsthrees === true ? "截止时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
showToday={false}
@ -1807,6 +1808,7 @@ class Trainingjobsetting extends Component {
}
</p>
</div>
</Tooltip>
<span className=" ml20 fl mt10 color-grey-9" style={{"text-align":"left","font-size":"14px"}}>(学生按时提交作品的时间截点)</span>
</div>
</div>
@ -1924,7 +1926,7 @@ class Trainingjobsetting extends Component {
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-9 font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span></Checkbox>
</div>
<div className="ml80 mt30">
<div className="ml85 mt30">
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}}

@ -198,7 +198,7 @@ class UpdateDrawer extends Component {
}
</div>
</DialogContent>
<DialogActions id="dialog-actions">
<DialogActions id="dialog-actions" style={{ 'margin-bottom': '16px'}}>
{ needUpdateScript ?
<React.Fragment>
<Button

@ -91,7 +91,7 @@
}
/* icon */
.fa-check-circle, .fa-exclamation-circle {
margin-top: 6px!important;
margin-top: 2px!important;
}
.fa-unlock-alt, .fa-lock {
margin-right: 3px;
@ -107,10 +107,10 @@
#evaluating_contents {
padding-top: 6px;
padding-top: 8px;
}
#evaluating_contents .-text-danger{
padding-bottom: 6px;
/* padding-bottom: 6px; */
}
#evaluating_contents p.evaluateResult {
margin-bottom: 10px;

@ -180,8 +180,8 @@ class CodeEvaluateView extends Component {
<i className={`fa ${ 'fa-caret-right'} mr8 font-16`}
style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i>
<span className="font-14">测试集 {index + 1}</span>
{ headIconClass && <i className={`fa ${ headIconClass } fr mt8 ml5 font-16`}></i> }
{ _headLockIconClass && <i className={`fa ${ _headLockIconClass } fr mt8 ml5 font-16`}></i> }
{ headIconClass && <i className={`fa ${ headIconClass } fr mt2 ml5 font-16`}></i> }
{ _headLockIconClass && <i className={`fa ${ _headLockIconClass } fr mt2 ml5 font-16`}></i> }
</p>
</div>

@ -73,7 +73,7 @@ class LeftView extends Component {
// /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88
render() {
let { challenge, shixun, tabIndex, tabIndexChange, loading, discusses_count
, dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, is_teacher,
, dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, user,
classes, onDrawerButtonClick, lockedAnswers, unlockedAnswers, isMultiLevelAnswer } = this.props
let propaedeutics = shixun ? shixun.propaedeutics : null;
@ -95,7 +95,7 @@ class LeftView extends Component {
// TODO TEST
// isMultiLevelAnswer = true
// is_teacher = true;
const is_teacher = user.is_teacher
let contentText = is_teacher ?
<React.Fragment>
@ -113,24 +113,25 @@ class LeftView extends Component {
if (isMultiLevelAnswer) {
// power === 0 &&
contentText = ( is_teacher ) ?
           <React.Fragment>
            <p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p><p><a
style={{textDecoration: 'underline'}} onClick={()=>this.goToCertification()}>立即认证</a></p>
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
           </React.Fragment>
            <React.Fragment>
             <p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p><a style={{textDecoration: 'underline'}} onClick={()=>this.goToCertification()}
style={{ color: '#1890ff', 'margin-top': '6px', display: 'inline-block'}}>立即认证</a></p>
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>
              :
            <React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}</p>
{/* { MultiLevelUnlockTable } */}
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
<p>{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}</p>
{/* { MultiLevelUnlockTable } */}
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>;
}
@ -300,7 +301,7 @@ class LeftView extends Component {
{ lockedAnswers && lockedAnswers.map((item, index) => {
return <div class="anwserSection">
<div className="df">
<div className="level">级别{index + 1}</div>
<div className="level">级别{index + 1 + (unlockedAnswers ? unlockedAnswers.length : 0)}</div>
<div className="name">{item.name}</div>
<div
className="status" onClick={ () => { this.props.showUnlockAnswerDialog(item) } }

@ -46,7 +46,6 @@ class LeftViewContainer extends Component {
dialogOpen: false,
gameAnswer: '',
is_teacher: false,
// 评论
// comments: [],
@ -316,10 +315,8 @@ class LeftViewContainer extends Component {
lockedAnswers.push(item)
}
})
const is_teacher = this.props.user.identity === EDU_TEACHER
this.setState({
is_teacher,
tabIndex: 2,
lockedAnswers,
unlockedAnswers,
@ -360,9 +357,6 @@ class LeftViewContainer extends Component {
继续查看 立即认证新开页
*/
const is_teacher = response.data.is_teacher
// this.props.user.identity === EDU_TEACHER
// response.data.is_teacher;
// 答案测试 TODO
// if (false && response.data.view_answer === true) {
@ -370,15 +364,6 @@ class LeftViewContainer extends Component {
this.showAnswer(response.data.answer)
} else {
// 三个角色 普通用户、未认证教师、已认证教师,这里要区分普通用户和未认证教师用户
if (is_teacher) {
this.setState({
is_teacher: true
})
} else {
this.setState({
is_teacher: false
})
}
this.setState({
dialogOpen: true,
})

@ -130,7 +130,7 @@ button.buttonHoverColor:hover a {
right: inherit;
margin-left: 24px;
display: inline-block;
top: 10px;
top: 12px;
height: 32px;
padding: 3px 15px
}
@ -229,6 +229,9 @@ body>div[role=dialog]>div {
/* padding-bottom: 10px; */
}
/* tpi 窗口宽度*/
body>div[role=dialog]>div[role=document] {
border-radius: 10px;
}
#tpi-dialog>div[role=document] {
border-radius: 10px;
}

@ -625,7 +625,7 @@ submittojoinclass=(value)=>{
{/* />*/}
{/* :""*/}
{/*}*/}
<Trialapplication {...this.state} ></Trialapplication>
<Trialapplication {...this.state} Cancel={() => this.cancelModulationModels()} ></Trialapplication>
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">

@ -731,7 +731,7 @@ class TPMBanner extends Component {
{/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}</a>:""*/}
{/*}*/}
{shixunsDetails.shixun_status === 0 && this.props.identity < 4 ?
{shixunsDetails.shixun_status === 0 && this.props.identity < 5 ?
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">申请发布</a> : ""
}
@ -796,7 +796,7 @@ class TPMBanner extends Component {
</Modal>
{shixunsDetails.shixun_status === 1 && this.props.identity < 4 ?
{shixunsDetails.shixun_status === 1 && this.props.identity < 5 ?
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">撤销发布</a> : ""
}
@ -875,9 +875,9 @@ class TPMBanner extends Component {
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
}
<div className="fr user_default_btn user_blue_btn mr20"
{this.props.identity < 8?<div className="fr user_default_btn user_blue_btn mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18"
onClick={this.copyForkvisible}
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "inline-block"}}
@ -886,7 +886,7 @@ class TPMBanner extends Component {
</span>
</Tooltip>
<Modal
<Modal
keyboard={false}
title="提示"
visible={Forkvisible}
@ -934,7 +934,7 @@ class TPMBanner extends Component {
</Link>
}
</div>
</div>:""}
</div>

@ -598,7 +598,7 @@ export default class TPMsettings extends Component {
evaluate_script, exec_time, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
opening_time, pod_exist_time,shixunmemoMDvalue
} = this.state;
let operateauthority=this.props.identity<4&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
const description_editormd = this.description_editormd.getValue();
@ -1084,7 +1084,7 @@ export default class TPMsettings extends Component {
}
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let operateauthority=this.props.identity===1?true:this.props.identity<4&&this.state.status==0?true:false;
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false;
return (
<div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} onMouseEnter={this.bigopens}>
@ -1099,7 +1099,7 @@ export default class TPMsettings extends Component {
</a>:""
}
{
this.props.identity < 4 && this.state.status==0?
this.props.identity < 5 && this.state.status==0?
<a className="edu-default-btn edu-blueline-btn ml20 fr"
onClick={()=>this.operateshixuns(1)}>
删除实训
@ -1332,7 +1332,7 @@ export default class TPMsettings extends Component {
</Modal>
{
this.props.identity<4||this.props.power==true?
this.props.identity<5||this.props.power==true?
<a onClick={this.showModal} id="define_template"
className="color-orange-tip ml20 mt5 fl">使用自定义脚本</a> : ""
}

@ -44,7 +44,8 @@
position:relative;
}
.newedboxheight{
max-height:181px;
max-height:204px;
overflow-y: auto;
}
.newminheight{
/*max-height: 670px;*/

@ -181,6 +181,7 @@ class Newshixuns extends Component {
systemenvironment:undefined,
testcoderunmode:undefined,
file:undefined,
deleteisnot:true,
}
}
@ -547,7 +548,7 @@ class Newshixuns extends Component {
// if (id) {
if(this.state.file !== undefined){
console.log("549");
this.deleteAttachment(this.state.file);
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
languagewrite:"",
@ -579,7 +580,7 @@ class Newshixuns extends Component {
})
if(this.state.file !== undefined){
console.log("580");
this.deleteAttachment(this.state.file);
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
languagewrite:"",
@ -655,7 +656,8 @@ class Newshixuns extends Component {
handleChange = (info) => {
console.log("handleChange1");
let fileList = info.fileList;
this.setState({ fileList });
this.setState({ fileList:fileList,
deleteisnot:false});
}
onAttachmentRemove = (file) => {
confirm({
@ -686,11 +688,13 @@ class Newshixuns extends Component {
// console.log('--- success')
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
deleteisnot:true
};
});
}
@ -736,7 +740,7 @@ class Newshixuns extends Component {
render() {
const { getFieldDecorator } = this.props.form;
const thiss=this;
let {testcoderunmode ,systemenvironment,languagewrite, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, operss, onSearchvalue} = this.state;
let {testcoderunmode ,systemenvironment,languagewrite,deleteisnot, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, operss, onSearchvalue} = this.state;
let options
if (departmentslist != undefined) {
options = this.state.departmentslist.map((d, k) => {
@ -764,7 +768,7 @@ class Newshixuns extends Component {
}
if(thiss.state.file !== undefined){
console.log("763")
thiss.deleteAttachment(thiss.state.file);
// thiss.deleteAttachment(thiss.state.file);
thiss.setState({
file:file
})
@ -797,6 +801,7 @@ class Newshixuns extends Component {
// return isLt50M;
// },
// };
return (
<div className="newMain clearfix" onClick={this.bigopens}>
@ -934,12 +939,23 @@ class Newshixuns extends Component {
{/* rules:[{*/}
{/* }]*/}
{/* })(*/}
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt5" > </Icon>
<span className="color-blue fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
{
deleteisnot=== true?
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt5" > </Icon>
<span className="color-blue fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
:
<Upload {...uploadProps} disabled={true} >
<Icon type="upload" className="fl mt5" > </Icon>
<span className="color-grey-c fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
}
</Upload>
{/* )*/}
{/* }*/}
{/*</Form.Item>*/}

@ -239,7 +239,7 @@ class Challenges extends Component {
<p className="clearfix mb30">
<span className="font-16 fl">简介</span>
<a style={{ display: this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
<a style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr"
data-tip-down="编辑">
<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />
@ -262,7 +262,7 @@ class Challenges extends Component {
<p className="clearfix mb10">
<span className="font-16 fl">全部任务</span>
{this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"}
className="white-btn edu-greenline-btn fr"
// data-tip-down="新增代码编辑类型任务"
@ -275,7 +275,7 @@ class Challenges extends Component {
</Link> : ""
}
{this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="white-btn edu-greenline-btn fr mr20"
// data-tip-down="新增选择题类型任务"
@ -333,7 +333,7 @@ class Challenges extends Component {
</span>
<span className="mr15 font-16 fl">{key+1}</span>
{this.props.identity<4?
{this.props.identity<5?
item.st === 1 ?
<a onClick={() => this.startshixunCombat(this.props.identity, item.challenge_id, "/editquestion")}
className="font-16 color05101a">{item.name}</a>
@ -359,7 +359,7 @@ class Challenges extends Component {
{item.delete_url != undefined &&
<Tooltip placement="bottom" title={"删除"}>
<a onClick={() => this.delOperations(item.challenge_id)}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/close.svg")}
className="fl mt5 ml5" />
@ -371,7 +371,7 @@ class Challenges extends Component {
{item.up_url != undefined &&
<Tooltip placement="bottom" title={"向上移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "up")}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/moveup.svg")}
className="fl mt2 ml4" />
@ -381,7 +381,7 @@ class Challenges extends Component {
{item.down_url != undefined &&
<Tooltip placement="bottom" title={"向下移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "down")}
style={{ display: this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }}
style={{ display: this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }}
className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" />
</a>
@ -393,7 +393,7 @@ class Challenges extends Component {
item.st === 1 ?
<Tooltip placement="bottom" title={"编辑"}>
<a
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status< 3 ? "block" : 'none' }}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status< 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editquestion"}
className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -403,7 +403,7 @@ class Challenges extends Component {
:
<Tooltip placement="bottom" title={"编辑"}>
<a
style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editcheckpoint"}
className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -451,9 +451,9 @@ class Challenges extends Component {
</Tooltip>
: item.status === 1 && newstatus === 1 ?
<Tooltip placement="bottom" title={this.props.identity<4?"直接挑战":"请先完成前序关卡"}>
<a className={this.props.identity<4&&item.open_game!=""?"edu-default-btn edu-blueback-btn fr Finish_button":"edu-default-btn edu-greyback-btn fr Finish_button"}
onClick={this.props.identity<4&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.open_game):""}
<Tooltip placement="bottom" title={this.props.identity<5?"直接挑战":"请先完成前序关卡"}>
<a className={this.props.identity<5&&item.open_game!=""?"edu-default-btn edu-blueback-btn fr Finish_button":"edu-default-btn edu-greyback-btn fr Finish_button"}
onClick={this.props.identity<5&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.open_game):""}
style={{marginTop: '-2px'}}>直接挑战</a>
</Tooltip> : "" : ""
@ -462,9 +462,9 @@ class Challenges extends Component {
{
item.status === 0 ?
<Tooltip placement="bottom" title={this.props.identity<4&&item.open_game!=""?"直接挑战":"请先完成前序关卡"}>
<a className={this.props.identity<4&&item.open_game!=""?"edu-default-btn edu-blueback-btn fr Finish_button":"edu-default-btn edu-greyback-btn fr Finish_button"}
onClick={this.props.identity<4&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.open_game):""}
<Tooltip placement="bottom" title={this.props.identity<5&&item.open_game!=""?"直接挑战":"请先完成前序关卡"}>
<a className={this.props.identity<5&&item.open_game!=""?"edu-default-btn edu-blueback-btn fr Finish_button":"edu-default-btn edu-greyback-btn fr Finish_button"}
onClick={this.props.identity<5&&item.open_game!=""?()=>this.startshixunCombat(false,undefined, item.open_game):""}
style={{marginTop: '-2px'}}>直接挑战</a>
</Tooltip>: ""
}

@ -1,110 +1,110 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { getImageUrl, toPath } from 'educoder';
import axios from 'axios';
import { CircularProgress } from 'material-ui/Progress';
const $ = window.$;
class Propaedeutics extends Component {
constructor(props) {
super(props)
this.state={
PropaedeuticsListcontent:undefined,
shixunId:undefined
}
}
componentDidMount() {
let id = this.props.match.params.shixunId;
this.setState({
shixunId:id
})
let url="/shixuns/"+id+"/propaedeutics.json";
axios.get(url).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
if(response.data.content[0]!=null){
this.setState({
PropaedeuticsListcontent:response.data.content[0]
})
}else{
this.setState({
PropaedeuticsListcontent:""
})
}
}
}).catch((error) => {
console.log(error)
});
}
updatamakedown=(id)=>{
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML(id, {
htmlDecode: "style,script,iframe",
taskList: true,
tex: true,
flowChart: true,
sequenceDiagram: true
});
$("#"+id+" p:first").addClass("ReactMarkdown");
$('#collaborators_list_info').show()
}, 200)
}
render() {
let {loadingContent} = this.props;
let {PropaedeuticsListcontent,shixunId}=this.state
if(PropaedeuticsListcontent!=undefined){
this.updatamakedown("ReactMarkdown")
}
return (
<React.Fragment>
<p className="clearfix mb10 pl20 pr20" style={{display:this.props.identity<4&&this.props.status<3?"block":'none'}} >
<a href={"/shixuns/"+shixunId +"/update_propaedeutics"}className="ring-green fr mt8" id="edit_propaedeutics"
data-tip-down="编辑"><img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" /></a>
</p>
{
loadingContent ?
<CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
<div className="pl20" id="collaborators_list_info" style={{display: 'none',minHeight: '640px',padding:'10px'}}>
{PropaedeuticsListcontent===undefined?"":
<p id="ReactMarkdown">
{PropaedeuticsListcontent === undefined ||PropaedeuticsListcontent === ""?
<div className="alltask">
<div className="alltask">
<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">暂无数据哦~</p>
</div>
</div>
</div>
:<textarea>{PropaedeuticsListcontent}</textarea>}
</p>
}
</div>
}
</React.Fragment>
);
}
}
export default Propaedeutics;
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { getImageUrl, toPath } from 'educoder';
import axios from 'axios';
import { CircularProgress } from 'material-ui/Progress';
const $ = window.$;
class Propaedeutics extends Component {
constructor(props) {
super(props)
this.state={
PropaedeuticsListcontent:undefined,
shixunId:undefined
}
}
componentDidMount() {
let id = this.props.match.params.shixunId;
this.setState({
shixunId:id
})
let url="/shixuns/"+id+"/propaedeutics.json";
axios.get(url).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
if(response.data.content[0]!=null){
this.setState({
PropaedeuticsListcontent:response.data.content[0]
})
}else{
this.setState({
PropaedeuticsListcontent:""
})
}
}
}).catch((error) => {
console.log(error)
});
}
updatamakedown=(id)=>{
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML(id, {
htmlDecode: "style,script,iframe",
taskList: true,
tex: true,
flowChart: true,
sequenceDiagram: true
});
$("#"+id+" p:first").addClass("ReactMarkdown");
$('#collaborators_list_info').show()
}, 200)
}
render() {
let {loadingContent} = this.props;
let {PropaedeuticsListcontent,shixunId}=this.state
if(PropaedeuticsListcontent!=undefined){
this.updatamakedown("ReactMarkdown")
}
return (
<React.Fragment>
<p className="clearfix mb10 pl20 pr20" style={{display:this.props.identity<5&&this.props.status<3?"block":'none'}} >
<a href={"/shixuns/"+shixunId +"/update_propaedeutics"}className="ring-green fr mt8" id="edit_propaedeutics"
data-tip-down="编辑"><img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" /></a>
</p>
{
loadingContent ?
<CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
<div className="pl20" id="collaborators_list_info" style={{display: 'none',minHeight: '640px',padding:'10px'}}>
{PropaedeuticsListcontent===undefined?"":
<p id="ReactMarkdown">
{PropaedeuticsListcontent === undefined ||PropaedeuticsListcontent === ""?
<div className="alltask">
<div className="alltask">
<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">暂无数据哦~</p>
</div>
</div>
</div>
:<textarea>{PropaedeuticsListcontent}</textarea>}
</p>
}
</div>
}
</React.Fragment>
);
}
}
export default Propaedeutics;

@ -1,247 +1,255 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import axios from 'axios';
import { trace, trace_collapse ,getImageUrl, toPath} from "educoder";
import RepositoryDirectories from './RepositoryDirectories'
const $ = window.$;
// 点击按钮复制功能
function jsCopy(){
var e = document.getElementById("copy_rep_content");
e.select();
document.execCommand("Copy");
}
/**
提交记录
使用指南
*/
class Repository extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
onRepoFileClick = (item) => {
this.props.fetchRepo(item)
}
render() {
let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray } = this.props;
if (!author) {
author = {}
}
let userauthority=false;
if(this.props.author!=undefined){
userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null;
}
// console.log(commits)
return (
<React.Fragment>
{/* jfinalshop/WebRoot */}
{/* <div className="pt30 pl20 pr20 pb30 mb10 clearfix" style={{background: '#fff'}}>
<span className="fl color-grey-6 font-16 cdefault mt1">
<i className="iconfont icon-fenzhi fl mr5"></i>
<span className="fl mt2">分支&nbsp;1</span>
</span>
<a href="https://www.educoder.net/forums/2784" target="_blank"
className="fr edu-default-btn edu-greenback-btn">Git使用指南</a>
</div> */}
{ repositoryLoading ? <div style={{ minHeight: '500px'}}></div> :
<div className="" id="collaborators_list_info">
<div className="clearfix edu-back-white">
<div className="padding30-20 clearfix">
<div className="fl1 clearfix1 mr201">
<div className="repositorytitle">
{/* <form acceptCharset="UTF-8" action="/shixuns/uznmbg54/repository/uznmbg54"
id="revision_selector" method="get">
<div style={{margin:0, padding:0, display:'inline'}}>
<input name="utf8" type="hidden" value="✓"></input>
</div>
<label className="font-16 fl mr5">分支:</label>
<select className="winput-120-35 fl" id="branch" name="branch" defaultValue="master">
<option value="master">master</option>
</select>
<input id="rev" name="rev" size="8" type="hidden" value=""></input>
</form> */}
<a href="https://www.educoder.net/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a>
<div className="fr font-12 color-grey-9 pr">
<label className="fl">网址克隆</label>
<input type="text" id="copy_rep_content" className="fl url-input"
defaultValue={ git_url } style={{width: 313}}/>
<a onClick={() => {
jsCopy()
}} data-tip-down="点击复制版本库地址"
className="fl ml5">
<i className="iconfont icon-wangzhikelong color-orange-tip" style={{lineHeight: '18px'}}></i>
</a>
<style>
{`
.top-black-trangle {
right: 68px;
}
a.guideBtn {
color: #4CACFF !important;
margin-left: 4px;
}
a.guideBtn:hover {
text-decoration: underline;
}`}
</style>
{/* <a href="https://www.educoder.net/forums/2784" target="_blank"
className="fr edu-default-btn edu-greenback-btn">Git使用指南</a> */}
<a
onClick={() => { $('#repository_url_tip').css('display') === 'none'
? $('#repository_url_tip').show()
: $('#repository_url_tip').hide() }}
className="fl ml6 mt1">
<img src={getImageUrl("images/educoder/problem.png")}/>
</a>
<div className="invite-tip clearfix none" id="repository_url_tip"
style={{top: '33px', right: '-10px', width: '300px', display: 'none'}}>
<span className="top-black-trangle" style={{"right":"9px"}}></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">请上传当前实训中各个关卡涉及的所有文件<br/>
包括任务文件执行文件以及其他的必须文件<br/><br/>
提交代码的方法<br/>
1在电脑上安装Git tortoise客户端<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者其它熟悉的Git客户端<br/>
2在Git客户端上向左侧的地址提交代码<br/><br/>
注意<br/>
请在Git客户端要求填写时按照如下说明填写<br/>
* 用户名使用您在本平台绑定的邮箱<br/>
* 口令使用您在本平台的登录口令
</p>
</div>
<p className="inviteTipbtn with100"><a
onClick={() => { $('#repository_url_tip').hide(); }}>知道了</a></p>
</div>
</div>
</div>
</div>
</div>
<style>
{`
.va_sub {
vertical-align: sub;
}
`}
</style>
{/* 用户、最近提交时间 */}
{
trees === undefined || trees === null ? <div className="alltask">
<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">暂无数据哦~</p>
</div>
</div> :
<div>
<div className="edu-back-skyblue padding10-20 clearfix">
<img alt={author.name} className="radius fl mr10"
height="30"
src={getImageUrl(`images/`+commits[0].author.image_url)}
style={{display:userauthority===true?"none":"block"}}
width="30"/>
<a href={author.user_url} className="mr5 va_sub" target="_blank">{commits[0].author.name}</a>
<span className="color-grey-6 va_sub">提交于
<acronym title={commits[0].time}>
{commits===undefined?"":commits[0].time}
</acronym> {commits===undefined?"":commits[0].title}
</span>
<a href={`/shixuns/${match.params.shixunId}/repository/${match.params.shixunId}/commits`}
className="color-grey-6 fr font-16 ">
<i className="iconfont icon-tijiaojilu font-18 fl mr5"></i>
<span className="fl mt2">提交记录</span>
</a>
</div>
<div className="padding20" style={{minHeight: '372px'}}>
<div className="bor-grey-e">
{/* 当前目录位置 */}
<RepositoryDirectories {...this.props}></RepositoryDirectories>
<div className="versionFileList">
{trees.map((item, index) => {
return (
<li id={`file${index}`} key={index} className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">
<i className={`${item.type === 'tree' ? 'icon-wenjianjia' : 'icon-zuoye'}
iconfont color-blue`}></i>
<a
onClick={() => this.onRepoFileClick(item)}>
&nbsp;{item.name}
</a>
</span>
</li>
)
})}
</div>
</div>
</div>
</div>
}
{/* 当前分支的文件 */}
</div>
</div>
}
</React.Fragment>
);
}
}
/*
提交记录
<div className="pl20" id="collaborators_list_info">
{ RepositoryList===undefined?"":RepositoryList.commits.map((item,key)=>{
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
return(
<div>
<div>{item.email}</div>
<div>{item.title}</div>
<div>{item.id}</div>
<div>{item.time}</div>
</div>
)
}) }
</div>
<li id="dd422c22b14b69b3452f4953ff33bb67" className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">
<i className="iconfont icon-zuoye color-blue"></i>
<a href="/shixuns/uznmbg54/repository/uznmbg54/master/shixun_entry/1-1.py">1-1.py</a>
</span>
</li>
*/
export default Repository;
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import axios from 'axios';
import { trace, trace_collapse ,getImageUrl, toPath} from "educoder";
import RepositoryDirectories from './RepositoryDirectories'
const $ = window.$;
// 点击按钮复制功能
function jsCopy(){
var e = document.getElementById("copy_rep_content");
e.select();
document.execCommand("Copy");
}
/**
提交记录
使用指南
*/
class Repository extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
onRepoFileClick = (item) => {
this.props.fetchRepo(item)
}
render() {
let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray } = this.props;
if (!author) {
author = {}
}
let userauthority=false;
if(this.props.author!=undefined){
userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null;
}
// console.log(commits)
return (
<React.Fragment>
{/* jfinalshop/WebRoot */}
{/* <div className="pt30 pl20 pr20 pb30 mb10 clearfix" style={{background: '#fff'}}>
<span className="fl color-grey-6 font-16 cdefault mt1">
<i className="iconfont icon-fenzhi fl mr5"></i>
<span className="fl mt2">分支&nbsp;1</span>
</span>
<a href="https://www.educoder.net/forums/2784" target="_blank"
className="fr edu-default-btn edu-greenback-btn">Git使用指南</a>
</div> */}
{ repositoryLoading ? <div style={{ minHeight: '500px'}}></div> :
<div className="" id="collaborators_list_info">
<div className="clearfix edu-back-white">
<div className="padding30-20 clearfix">
<div className="fl1 clearfix1 mr201">
<div className="repositorytitle">
{/* <form acceptCharset="UTF-8" action="/shixuns/uznmbg54/repository/uznmbg54"
id="revision_selector" method="get">
<div style={{margin:0, padding:0, display:'inline'}}>
<input name="utf8" type="hidden" value="✓"></input>
</div>
<label className="font-16 fl mr5">分支:</label>
<select className="winput-120-35 fl" id="branch" name="branch" defaultValue="master">
<option value="master">master</option>
</select>
<input id="rev" name="rev" size="8" type="hidden" value=""></input>
</form> */}
<a href="https://www.educoder.net/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a>
<div className="fr font-12 color-grey-9 pr">
<label className="fl">网址克隆</label>
<input type="text" id="copy_rep_content" className="fl url-input"
defaultValue={ git_url } style={{width: 313}}/>
<a onClick={() => {
jsCopy()
}} data-tip-down="点击复制版本库地址"
className="fl ml5">
<i className="iconfont icon-wangzhikelong color-orange-tip" style={{lineHeight: '18px'}}></i>
</a>
<style>
{`
.top-black-trangle {
right: 68px;
}
a.guideBtn {
color: #4CACFF !important;
margin-left: 4px;
}
a.guideBtn:hover {
text-decoration: underline;
}
#repository_url_tip {
top: 30px !important;
left:132px !important;
width: 292px !important;
}
`}
</style>
{/* <a href="https://www.educoder.net/forums/2784" target="_blank"
className="fr edu-default-btn edu-greenback-btn">Git使用指南</a> */}
<a
onClick={() => { $('#repository_url_tip').css('display') === 'none'
? $('#repository_url_tip').show()
: $('#repository_url_tip').hide() }}
className="fl ml6 mt1">
<img src={getImageUrl("images/educoder/problem.png")}/>
<div className="invite-tip clearfix none" id="repository_url_tip"
style={{top: '33px', right: '-10px', width: '300px', display: 'none'}}>
<span className="top-black-trangle" style={{"right":"9px"}}></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">请上传当前实训中各个关卡涉及的所有文件<br/>
包括任务文件执行文件以及其他的必须文件<br/><br/>
提交代码的方法<br/>
1在电脑上安装Git tortoise客户端<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或者其它熟悉的Git客户端<br/>
2在Git客户端上向左侧的地址提交代码<br/><br/>
注意<br/>
请在Git客户端要求填写时按照如下说明填写<br/>
* 用户名使用您在本平台绑定的邮箱<br/>
* 口令使用您在本平台的登录口令
</p>
</div>
<p className="inviteTipbtn with100"><a
onClick={() => { $('#repository_url_tip').hide(); }}>知道了</a></p>
</div>
</a>
</div>
</div>
</div>
</div>
<style>
{`
.va_sub {
vertical-align: sub;
}
`}
</style>
{/* 用户、最近提交时间 */}
{
trees === undefined || trees === null ? <div className="alltask">
<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">暂无数据哦~</p>
</div>
</div> :
<div>
<div className="edu-back-skyblue padding10-20 clearfix">
<img alt={author.name} className="radius fl mr10"
height="30"
src={getImageUrl(`images/`+commits[0].author.image_url)}
style={{display:userauthority===true?"none":"block"}}
width="30"/>
<a href={author.user_url} className="mr5 va_sub" target="_blank">{commits[0].author.name}</a>
<span className="color-grey-6 va_sub">提交于
<acronym title={commits[0].time}>
{commits===undefined?"":commits[0].time}
</acronym> {commits===undefined?"":commits[0].title}
</span>
<a href={`/shixuns/${match.params.shixunId}/repository/${match.params.shixunId}/commits`}
className="color-grey-6 fr font-16 ">
<i className="iconfont icon-tijiaojilu font-18 fl mr5"></i>
<span className="fl mt2">提交记录</span>
</a>
</div>
<div className="padding20" style={{minHeight: '372px'}}>
<div className="bor-grey-e">
{/* 当前目录位置 */}
<RepositoryDirectories {...this.props}></RepositoryDirectories>
<div className="versionFileList">
{trees.map((item, index) => {
return (
<li id={`file${index}`} key={index} className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">
<i className={`${item.type === 'tree' ? 'icon-wenjianjia' : 'icon-zuoye'}
iconfont color-blue`}></i>
<a
onClick={() => this.onRepoFileClick(item)}>
&nbsp;{item.name}
</a>
</span>
</li>
)
})}
</div>
</div>
</div>
</div>
}
{/* 当前分支的文件 */}
</div>
</div>
}
</React.Fragment>
);
}
}
/*
提交记录
<div className="pl20" id="collaborators_list_info">
{ RepositoryList===undefined?"":RepositoryList.commits.map((item,key)=>{
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
return(
<div>
<div>{item.email}</div>
<div>{item.title}</div>
<div>{item.id}</div>
<div>{item.time}</div>
</div>
)
}) }
</div>
<li id="dd422c22b14b69b3452f4953ff33bb67" className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">
<i className="iconfont icon-zuoye color-blue"></i>
<a href="/shixuns/uznmbg54/repository/uznmbg54/master/shixun_entry/1-1.py">1-1.py</a>
</span>
</li>
*/
export default Repository;

Loading…
Cancel
Save