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_myshixun, :except => [:training_task_status, :code_runinng_message]
before_action :find_repo_name, :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 :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关卡列表 ## TPI关卡列表
def challenges 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 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 , 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 {setmiyah as setmiyah} from './Component';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';

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

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

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

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

@ -235,7 +235,7 @@ class GraduationTaskssettingReply extends Component{
<style>{` <style>{`
`}</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> height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent" <div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"

@ -226,7 +226,7 @@ class GraduateTopicReply extends Component{
return( return(
<React.Fragment> <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> height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent" <div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"

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

@ -816,9 +816,9 @@ class MemoDetail extends Component {
} }
</div> </div>
{ window.__useKindEditor === true ? { 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 } */} {/* onClick={ this.createNewComment } */}

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

@ -64,7 +64,7 @@ class TPMRightSection extends Component {
Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100; Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100;
} }
// console.log(this.props&&this.props.is_jupyter===true)
return ( return (
<div> <div>
<style> <style>
@ -111,7 +111,7 @@ class TPMRightSection extends Component {
</div> </div>
</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"> <div className="font-16 mb5">
<span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span> <span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span>
<span className={"sortinxdirection space-between fr"}> <span className={"sortinxdirection space-between fr"}>

@ -77,11 +77,20 @@ class Challengesjupyter extends Component {
}else{ }else{
if(boxoffsetHeigh>=300){ if(boxoffsetHeigh>=300){
this.setState({ if(this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"){
opentitletype:true, this.setState({
isopentitletype:"greater", opentitletype:false,
boxoffsetHeigh:boxoffsetHeigh isopentitletype:"greater",
}) boxoffsetHeigh:boxoffsetHeigh
})
}else{
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}
}else{ }else{
this.setState({ this.setState({
isopentitletype:"Less", isopentitletype:"Less",
@ -147,10 +156,7 @@ class Challengesjupyter extends Component {
let datas={ let datas={
identifier:id, identifier:id,
} }
let ChallengesURL = `/jupyters/get_info_with_tpm.json`; let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
axios.get(ChallengesURL, {params: datas}).then((response) => { axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
setTimeout(() => { setTimeout(() => {
@ -303,19 +309,23 @@ class Challengesjupyter extends Component {
opentitle=()=>{ opentitle=()=>{
this.setState({ this.setState({
opentitletype:!this.state.opentitletype opentitletype:!this.state.opentitletype
}) })
} }
onclki=(bool)=>{ onclki=(bool)=>{
this.setState({ this.setState({
enlarge:bool enlarge:bool
}) })
} }
Importingfiles=()=>{ Importingfiles=()=>{
// 导入文件 // 导入文件
} }
handleChange = (info) => { handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList; let fileList = info.fileList;
@ -635,7 +645,8 @@ class Challengesjupyter extends Component {
` `
} }
</style> </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> <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 "}> </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> <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>
<p className="clearfix mt8 font-12 color-grey-B4"> <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"> <span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count} <i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span> </span>
</Tooltip> </Tooltip>:""}
{/*<Tooltip placement="bottom" title={"经验值"}>*/} {/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan">*/} {/*<span className="mr10 fl squareIconSpan">*/}

@ -75,17 +75,18 @@ class ShixunCardList extends Component {
type="new"; type="new";
} }
if(typekeyid===key){ if(typekeyid===key){
if(upcircle===true){ if(upcircle===true){
this.setState({ this.setState({
upcircle:false, upcircle:false,
}) })
this.props.Shixunsupcircles("desc") // this.props.Shixunsupcircles("desc")
}else if(upcircle===false){ }else if(upcircle===false){
this.setState({ this.setState({
upcircle:true, upcircle:true,
}) })
this.props.Shixunsupcircles("asc") // this.props.Shixunsupcircles("desc")
} }
}else{ }else{
this.setState({ 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) console.log(error)
}); });
} }
ShixunsState=(val,type)=>{ ShixunsState=(val,type,sorts)=>{
// sort, // sort,
let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state; let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state;
let newsort=sort; let newsort=sorts?sorts:sort;
this.setState({ this.setState({
order_by:type, order_by:type,
typepvisible:true, typepvisible:true,
pages:1, pages:1,
// sort:sort sort:sorts?sorts:sort
}) })
let params let params
// let vals=false // let vals=false
if(newsort===undefined){ if(newsort===undefined){
newsort="desc" newsort="desc"
}else{
newsort=sorts?sorts:sort
} }
params= { params= {
order_by:type, order_by:type,

Loading…
Cancel
Save