Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_tj
cxt 5 years ago
commit 89ec0ea495

@ -3,7 +3,7 @@ class MyshixunsController < ApplicationController
before_action :find_myshixun, :except => [:training_task_status, :code_runinng_message]
before_action :find_repo_name, :except => [:training_task_status, :code_runinng_message]
skip_before_action :verify_authenticity_token, :only => [:html_content]
skip_before_action :check_sign, only: [:training_task_status, :code_runinng_message]
skip_before_action :check_sign, only: [:training_task_status, :code_runinng_message, :html_content]
## TPI关卡列表
def challenges

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@ -4,7 +4,7 @@
export { getImageUrl as getImageUrl, getRandomNumber as getRandomNumber,getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode ,getupload_git_file as getupload_git_file} from './UrlTool';
export {setmiyah as setmiyah} from './Component';
export { default as queryString } from './UrlTool2';

@ -4,16 +4,17 @@
* @Github:
* @Date: 2020-01-06 09:02:29
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-09 11:58:52
* @LastEditTime : 2020-01-09 15:00:13
*/
import Quill from 'quill';
// let Inline = Quill.import('blots/inline');
const BlockEmbed = Quill.import('blots/block/embed');
const BlockEmbed = Quill.import('blots/embed');
class FillBlot extends BlockEmbed {
static create (value) {
const node = super.cerate();
const node = super.cerate(value);
// node.classList.add('icon icon-bianji2');
// node.setAttribute('data-fill', 'fill');
console.log('编辑器值===》》》》》', value);
node.setAttribute('data_index', value.data_index);
node.nodeValue = value.text;
return node;
@ -28,7 +29,7 @@ class FillBlot extends BlockEmbed {
}
FillBlot.blotName = "fill";
FillBlot.blotName = "fill-blot";
FillBlot.tagName = "span";
export default FillBlot;

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-18 08:49:30
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-09 11:56:10
* @LastEditTime : 2020-01-10 15:05:27
*/
import './index.scss';
import 'quill/dist/quill.core.css'; // 核心样式
@ -31,14 +31,16 @@ Quill.register(ImageBlot);
Quill.register(Size);
Quill.register(Font, true);
// Quill.register({'modules/toolbar': Toolbar});
Quill.register(FillBlot);
Quill.register({
'formats/fill': FillBlot
});
// Quill.register(Color);
function QuillForEditor ({
placeholder,
readOnly,
autoFocus,
autoFocus = false,
options,
value,
imgAttrs = {}, // 指定图片的宽高
@ -194,10 +196,11 @@ function QuillForEditor ({
});
_quill.getModule('toolbar').addHandler('fill', (e) => {
// console.log('点击了填空=====>>>>>>', e);
setFillCount(fillCount + 1);
const range = _quill.getSelection(true);
// _quill.insertText(range.index, '▁', { 'data_index': fillCount });
_quill.insertEmbed(range.index, 'span', {
_quill.insertEmbed(range.index, 'fill', {
text: '▁',
'data_index': fillCount
});
@ -229,16 +232,21 @@ function QuillForEditor ({
}
const current = value
// console.log('+++++', current);
if (!deepEqual(previous, current)) {
setSelection(quill.getSelection())
if (typeof value === 'string') {
quill.clipboard.dangerouslyPasteHTML(value, 'api')
quill.clipboard.dangerouslyPasteHTML(value, 'api');
if (autoFocus) {
quill.focus();
} else {
quill.blur();
}
} else {
quill.setContents(value)
if (autoFocus) quill.focus();
}
}
}, [quill, value, setQuill]);
}, [quill, value, setQuill, autoFocus]);
// 清除选择区域
useEffect(() => {
@ -272,13 +280,6 @@ function QuillForEditor ({
}
}, [quill, handleOnChange]);
useEffect(() => {
if (!quill) return;
if (autoFocus) {
quill.focus();
}
}, [quill, autoFocus]);
// 返回结果
return (
<div className='quill_editor_for_react_area' style={wrapStyle}>

@ -682,6 +682,7 @@ class TopicDetail extends Component {
</div>
{!isCourseEnd && <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
{...this.props}
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>}
{/* onClick={ this.createNewComment }

@ -252,6 +252,7 @@ class CommonReply extends Component{
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} imageExpand={true}
replyComment={this.replyComment}
{...this.props}
commentsLength={comments ? comments.length : 0}
></MemoDetailMDEditor>
{/* bor-bottom-greyE */}

@ -18,7 +18,7 @@ import { generateComments, generateChildComments, _findById, handleContentBefore
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
/*
相比较GraduateTopicReply 改动的地方
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: 'GraduationTask',
@ -34,7 +34,7 @@ class GraduationTaskssettingReply extends Component{
componentDidMount(){
this.fetchReplies()
}
_getUser() {
const { current_user } = this.props;
@ -58,7 +58,7 @@ class GraduationTaskssettingReply extends Component{
// m_parent_id
reply_id: memo.user_id
}
}
}
).then((response) => {
if (response.data.status === -1) {
console.error('服务端异常')
@ -66,18 +66,18 @@ class GraduationTaskssettingReply extends Component{
}
// this.props.showNotification('帖子发表成功')
if (response.data && response.data.id) {
if (response.data && response.data.id) {
const _id = response.data.id;
// md
editor.setValue && editor.setValue('')
const user = this._getUser();
this.setState({
comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this),
total_count: this.state.total_count + 1
})
this.refs.editor.showEditor();
}
}).catch((error) => {
console.log(error)
@ -95,13 +95,13 @@ class GraduationTaskssettingReply extends Component{
return;
}
const url = `/users/reply_message.json`;
const { comments } = this.state;
const user = this._getUser();
const graduation_topic_id = this.props.memo.id
const commentIndex = this._findById(id, comments);
let comment = comments[commentIndex];
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, {
journals_for_message: {
@ -113,9 +113,9 @@ class GraduationTaskssettingReply extends Component{
}
},
{
}
}
).then((response) => {
if (response.data.id) {
if (response.data.id) {
let newId = response.data.id;
this.setState({
@ -128,7 +128,7 @@ class GraduationTaskssettingReply extends Component{
memo: newMemo2
})
}
}).catch((error) => {
console.log(error)
})
@ -142,7 +142,7 @@ class GraduationTaskssettingReply extends Component{
})
.then((response) => {
const { comments } = response.data
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
@ -160,7 +160,7 @@ class GraduationTaskssettingReply extends Component{
this.fetchReplies()
})
}
fetchReplies = () => {
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
@ -170,7 +170,7 @@ class GraduationTaskssettingReply extends Component{
})
.then((response) => {
const { comments, messages_count } = response.data
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
@ -180,7 +180,7 @@ class GraduationTaskssettingReply extends Component{
console.log(error)
})
}
transformReply = (reply, children = []) => {
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
@ -189,7 +189,7 @@ class GraduationTaskssettingReply extends Component{
isSuperAdmin: isSuperAdmin,
permission: true, //
children: children,
hidden: reply.hidden,
hidden: reply.hidden,
id: reply.id,
image_url: reply.author.image_url,
reward: null, //
@ -235,7 +235,7 @@ class GraduationTaskssettingReply extends Component{
<style>{`
`}</style>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="请在此输入对本作品的评语最大限制2000个字符"
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="请在此输入对本作品的评语最大限制2000个字符"
height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"
@ -251,7 +251,7 @@ class GraduationTaskssettingReply extends Component{
commentPraise={this.commentPraise}
rewardCode={this.rewardCode}
hiddenComment={this.hiddenComment}
usingAntdModal={true}
isChildCommentPagination={true}
loadMoreChildComments={this.loadMoreChildComments}
@ -259,15 +259,15 @@ class GraduationTaskssettingReply extends Component{
showRewardButton={false}
onlySuperAdminCouldHide={true}
></Comments>
{/* { true ? :
{/* { true ? :
<div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>

@ -226,7 +226,7 @@ class GraduateTopicReply extends Component{
return(
<React.Fragment>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-09 14:18:37
* @LastEditTime : 2020-01-10 15:06:23
*/
import './index.scss';
// import 'katex/dist/katex.css';
@ -453,6 +453,7 @@ class EditTab extends React.Component {
colon={ false }
>
<QuillForEditor
autoFocus={true}
style={{ height: '200px' }}
placeholder="请输入描述信息"
onContentChange={handleContentChange}

@ -816,9 +816,9 @@ class MemoDetail extends Component {
}
</div>
{ window.__useKindEditor === true ?
<MemoDetailKEEditor ref="editor" memo={memo}></MemoDetailKEEditor>
<MemoDetailKEEditor ref="editor" memo={memo} {...this.props}></MemoDetailKEEditor>
:
<MemoDetailMDEditor ref="editor" memo={memo}></MemoDetailMDEditor>
<MemoDetailMDEditor ref="editor" memo={memo} {...this.props}></MemoDetailMDEditor>
}
{/* onClick={ this.createNewComment } */}

@ -75,7 +75,10 @@ class MemoDetailMDEditor extends Component {
}
onCommit = () => {
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showhideAccountPhoneemailDialog()
return

@ -64,7 +64,7 @@ class TPMRightSection extends Component {
Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100;
}
// console.log(this.props&&this.props.is_jupyter===true)
return (
<div>
<style>
@ -111,7 +111,7 @@ class TPMRightSection extends Component {
</div>
</div>
{this.props&&this.props.status>1?<div className="edu-back-white padd252020px relative borderbottomf4">
{this.props&&this.props.is_jupyter===true?"":this.props&&this.props.status>1?<div className="edu-back-white padd252020px relative borderbottomf4">
<div className="font-16 mb5">
<span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span>
<span className={"sortinxdirection space-between fr"}>

@ -77,11 +77,20 @@ class Challengesjupyter extends Component {
}else{
if(boxoffsetHeigh>=300){
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
if(this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"){
this.setState({
opentitletype:false,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}else{
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}
}else{
this.setState({
isopentitletype:"Less",
@ -147,10 +156,7 @@ class Challengesjupyter extends Component {
let datas={
identifier:id,
}
let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
setTimeout(() => {
@ -303,19 +309,23 @@ class Challengesjupyter extends Component {
opentitle=()=>{
this.setState({
opentitletype:!this.state.opentitletype
})
}
onclki=(bool)=>{
this.setState({
enlarge:bool
})
}
Importingfiles=()=>{
// 导入文件
}
handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList;
@ -635,7 +645,8 @@ class Challengesjupyter extends Component {
`
}
</style>
{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
{this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"?"":this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>

@ -193,11 +193,11 @@ class ShixunCard extends Component {
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"关卡"}>
{item.is_jupyter===false?<Tooltip placement="bottom" title={"关卡"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span>
</Tooltip>
</Tooltip>:""}
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan">*/}

@ -75,17 +75,18 @@ class ShixunCardList extends Component {
type="new";
}
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
// this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true,
})
this.props.Shixunsupcircles("asc")
// this.props.Shixunsupcircles("desc")
}
}else{
this.setState({
@ -93,8 +94,8 @@ class ShixunCardList extends Component {
})
}
//allevent
this.props.ShixunsState(false,type);
this.props.ShixunsState(false,type,"desc");
}

@ -296,21 +296,23 @@ class ShixunsIndex extends Component {
console.log(error)
});
}
ShixunsState=(val,type)=>{
ShixunsState=(val,type,sorts)=>{
// sort,
let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state;
let newsort=sort;
let newsort=sorts?sorts:sort;
this.setState({
order_by:type,
typepvisible:true,
pages:1,
// sort:sort
sort:sorts?sorts:sort
})
let params
// let vals=false
if(newsort===undefined){
newsort="desc"
}else{
newsort=sorts?sorts:sort
}
params= {
order_by:type,

Loading…
Cancel
Save