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

courseware
杨树明 5 years ago
parent ce1552f344
commit c4efa0df80

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

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