调整实训公式保存在实训的简介

courseware
杨树明 5 years ago
parent ce1552f344
commit c4efa0df80

@ -14,7 +14,8 @@ import '../shixunchildCss/Challenges.css';
import AccountProfile from"../../../user/AccountProfile"; import AccountProfile from"../../../user/AccountProfile";
const $ = window.$; import Showmarkdown from "./Showmarkdown";
class Challenges extends Component { class Challenges extends Component {
constructor(props) { constructor(props) {
@ -118,16 +119,16 @@ class Challenges extends Component {
} }
updatamakedown = (id) => { updatamakedown = (id) => {
setTimeout(() => { // setTimeout(() => {
var shixunDescr = window.editormd.markdownToHTML(id, { // var shixunDescr = window.editormd.markdownToHTML(id, {
htmlDecode: "style,script,iframe", // htmlDecode: "style,script,iframe",
taskList: true, // taskList: true,
tex: true, // tex: true,
flowChart: true, // flowChart: true,
sequenceDiagram: true // sequenceDiagram: true
}); // });
$("#" + id + " p:first").addClass("ReactMarkdown"); // $("#" + id + " p:first").addClass("ReactMarkdown");
}, 200) // }, 200)
} }
// 关卡的上移下移操作 // 关卡的上移下移操作
@ -404,9 +405,9 @@ class Challenges extends Component {
render() { render() {
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
let { loadingContent } = this.props; let { loadingContent } = this.props;
if (ChallengesDataList != undefined) { // if (ChallengesDataList != undefined) {
this.updatamakedown("ReactMarkdown") // this.updatamakedown("ReactMarkdown")
} // }
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
@ -535,11 +536,11 @@ class Challenges extends Component {
src={getImageUrl("images/educoder/nodata.png")} />} src={getImageUrl("images/educoder/nodata.png")} />}
<p className="edu-nodata-p mb80">暂时还没有相关数据哦</p> <p className="edu-nodata-p mb80">暂时还没有相关数据哦</p>
</div> </div>
:<p className={"markdown-body"} style={{overflow:'hidden'}}> : ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": <Showmarkdown
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div> descriptions={ChallengesDataList.description}
} />
</p>} }
</div> </div>
</div> </div>
<style> <style>

@ -7,7 +7,8 @@ import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css'; import '../shixunchildCss/Challenges.css';
import axios from 'axios'; import axios from 'axios';
import {addjypertime} from "../../../../redux/actions/jupyter"; import {addjypertime} from "../../../../redux/actions/jupyter";
const $ = window.$; import Showmarkdown from "./Showmarkdown";
const { Countdown } = Statistic; const { Countdown } = Statistic;
class Challengesjupyter extends Component { class Challengesjupyter extends Component {
constructor(props) { constructor(props) {
@ -627,7 +628,9 @@ class Challengesjupyter extends Component {
</div> </div>
:<p className={"markdown-body"} style={{overflow:'hidden'}}> :<p className={"markdown-body"} style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div> <Showmarkdown
descriptions={ChallengesDataList.description}
/>
} }
</p>} </p>}
</p> </p>

@ -0,0 +1,38 @@
import React, { Component } from 'react';
import {markdownToHTML} from 'educoder';
class Showmarkdown extends Component {
constructor(props) {
super(props);
this.state = {
}
}
componentDidMount() {
if (this.props.descriptions) {
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}, 200)
}
}
render() {
return(
<div id="memo_content_editorMd" className="new_li">
<textarea style={{'display': 'none'}}>
{this.props.descriptions}
</textarea>
</div>
)
}
}
export default Showmarkdown;
Loading…
Cancel
Save