Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 6 years ago
commit 016cb55535

@ -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

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

@ -190,7 +190,7 @@ function buildColumns(that, student_works) {
render: (update_time, record) => (
<span>
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}</a>
</span>
),
}])

@ -690,7 +690,7 @@ class ExerciseReviewAndAnswer extends Component{
}
{
//(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 ?
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
<span className="font-16 ml20">
<i className={parseInt(item.answer_status) ==0 ? "iconfont icon-htmal5icon19 color-red font-20 fl":parseInt(item.answer_status) ==1 ? "fl iconfont icon-wancheng font-20 color-green" :"iconfont icon-htmal5icon19 color-orange-tip font-20 fl"}></i>
<span><span className={parseInt(item.answer_status) == 0 ?"color-red":parseInt(item.answer_status) == 1 ?"color-green":"color-orange-tip"}>{item.user_score}</span> </span>

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

@ -46,9 +46,9 @@ class Multiple extends Component{
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
return(
<p className="clearfix mb15">
<p className="clearfix mb15 df">
<Checkbox className="fl lineh-20 " value={item.choice_id}></Checkbox>
<span class="fl lineh-20">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<span class="fl lineh-20 mt1">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p>
)
})

@ -54,7 +54,7 @@ class simpleAnswer extends Component{
<li className="with100">
{
user_exercise_status == 1 ?
<div className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.user_answer.length>0 ? questionType.user_answer[0]:"")}}></div>
<div className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.user_answer.length>0 ? questionType.user_answer[0]:"")}}></div>
:
<div>
<TPMMDEditor ref={this.mdRef} initValue={questionType.user_answer.length > 0 ? questionType.user_answer[0]:''} mdID={'simpleEditor'+questionType.question_id} placeholder="请输入你的答案"
@ -69,9 +69,9 @@ class simpleAnswer extends Component{
{
exercise.answer_status == 1 || questionType.a_flag ?
<div className="standardAnswer">
<p className="mb10">参考答案</p>
<li className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<p className="mt15"><a className="color-blue" onClick={()=>this.showAndHide(false)}>隐藏参考答案</a></p>
<p className="mb10 font-16">参考答案</p>
<li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<p className="mt15"><a className="color-blue font-16" onClick={()=>this.showAndHide(false)}>隐藏参考答案</a></p>
</div>
:
<a className="color-blue font-16" onClick={()=>this.showAndHide(true)}>显示参考答案</a>
@ -82,7 +82,7 @@ class simpleAnswer extends Component{
isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ?
<div className="bor-top-greyE pt20 mt20 standardAnswer">
<p>参考答案</p>
<li className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
</div>:""
}
</div>

@ -41,9 +41,9 @@ class single extends Component{
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15" : "fl mr40"}>
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}></Radio>
<span className="fl lineh-20 mr3">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body fl" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<span className="fl lineh-20 mr3 mt1">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body fl mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p>
)
})

@ -15,7 +15,7 @@ class Graduationtaskitem extends Component{
}
render(){
let { item }=this.props;
const _content = this.parseCommentContent(item.content)
const _content = item.content && this.parseCommentContent(item.content)
return(
<div className="comment_item_cont df clearfix" key={item.id}>
<div className="J_Comment_Face fl">
@ -48,12 +48,14 @@ class Graduationtaskitem extends Component{
</div>
</div>
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
{!!_content && <div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3" id={`reply_content_${item.id}`}>
<div className={"break_word_comments"} dangerouslySetInnerHTML={{__html: _content}}></div>
<div className="cl"></div>
</div>
</div>
</div>}
{!_content && <span className="color656565 mt2 color-grey-9 font-12 mr8" style={{ display: 'inline-block'}}>{"暂未写评语"}</span>}
<div className="childrenCommentsView">
{(item && item.children && item.children.length) ? <div className="trangle"></div>: ''}
{this.renderChildenComments(item)}

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

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

@ -323,7 +323,6 @@ textarea:read-only{
}
.standardAnswer p{
line-height: 20px!important;
font-size: 16px;
}
/* 倒计时 */
.remainingTime li{

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

Loading…
Cancel
Save