Commit 93766da8 by yuananting

feat:题库模板结构修改

parent 1d242593
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 18:28:50 * @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 17:18:20 * @LastEditTime: 2021-03-27 13:49:14
* @Description: 助学工具-题库-主页面分类管理 * @Description: 助学工具-题库-课程分类管理
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import Breadcrumbs from "@/components/Breadcrumbs"; import Breadcrumbs from "@/components/Breadcrumbs";
import "./QuestionCategoryManage.less"; import "./CourseCategoryManage.less";
import NewEditQuestionBankCategory from "./modal/NewEditQuestionBankCategory"; import NewEditCourseCategoryModal from "../modal/NewEditCourseCategoryModal";
import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService"; import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import { import {
...@@ -26,11 +26,11 @@ import ShowTips from "@/components/ShowTips"; ...@@ -26,11 +26,11 @@ import ShowTips from "@/components/ShowTips";
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
const { Search } = Input; const { Search } = Input;
const { confirm } = Modal; const { confirm } = Modal;
class QuestionCategoryManage extends Component { class CourseCategoryManage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
NewEditQuestionBankCategory: null, //新增或编辑分类模态框 NewEditCourseCategoryModal: null, //新增或编辑分类模态框
treeData: [], treeData: [],
treeMap: {}, treeMap: {},
selectedKeys: ["0"], selectedKeys: ["0"],
...@@ -134,7 +134,7 @@ class QuestionCategoryManage extends Component { ...@@ -134,7 +134,7 @@ class QuestionCategoryManage extends Component {
}; };
// 新增或编辑分类 // 新增或编辑分类
newEditQuestionCategory = (categoryType, addLevelType, type, node) => { newEditCourseCategory = (categoryType, addLevelType, type, node) => {
let title = ""; let title = "";
let label = ""; let label = "";
switch (categoryType) { switch (categoryType) {
...@@ -156,7 +156,7 @@ class QuestionCategoryManage extends Component { ...@@ -156,7 +156,7 @@ class QuestionCategoryManage extends Component {
break; break;
} }
const m = ( const m = (
<NewEditQuestionBankCategory <NewEditCourseCategoryModal
node={node} node={node}
addLevelType={addLevelType} addLevelType={addLevelType}
type={type} type={type}
...@@ -166,12 +166,12 @@ class QuestionCategoryManage extends Component { ...@@ -166,12 +166,12 @@ class QuestionCategoryManage extends Component {
close={() => { close={() => {
this.queryCategoryTree("change"); this.queryCategoryTree("change");
this.setState({ this.setState({
NewEditQuestionBankCategory: null, NewEditCourseCategoryModal: null,
}); });
}} }}
/> />
); );
this.setState({ NewEditQuestionBankCategory: m }); this.setState({ NewEditCourseCategoryModal: m });
}; };
initDropMenu = (item) => { initDropMenu = (item) => {
...@@ -184,7 +184,7 @@ class QuestionCategoryManage extends Component { ...@@ -184,7 +184,7 @@ class QuestionCategoryManage extends Component {
item.categoryLevel === 0 item.categoryLevel === 0
? "editEqualLevelCategory" ? "editEqualLevelCategory"
: "editChildLevelCategory"; : "editChildLevelCategory";
this.newEditQuestionCategory(categoryType, "equal", "edit", item); this.newEditCourseCategory(categoryType, "equal", "edit", item);
}} }}
> >
重命名 重命名
...@@ -456,7 +456,7 @@ class QuestionCategoryManage extends Component { ...@@ -456,7 +456,7 @@ class QuestionCategoryManage extends Component {
message.info("最多只能添加30个分类"); message.info("最多只能添加30个分类");
return; return;
} }
this.newEditQuestionCategory( this.newEditCourseCategory(
"newEqualLevelCategory", "newEqualLevelCategory",
"equal", "equal",
"new", "new",
...@@ -479,7 +479,7 @@ class QuestionCategoryManage extends Component { ...@@ -479,7 +479,7 @@ class QuestionCategoryManage extends Component {
message.info("最多只能添加30个子分类"); message.info("最多只能添加30个子分类");
return; return;
} }
this.newEditQuestionCategory( this.newEditCourseCategory(
"newChildLevelCategory", "newChildLevelCategory",
"child", "child",
"new", "new",
...@@ -581,7 +581,7 @@ class QuestionCategoryManage extends Component { ...@@ -581,7 +581,7 @@ class QuestionCategoryManage extends Component {
autoExpandParent, autoExpandParent,
} = this.state; } = this.state;
return ( return (
<div className="page question-category-manage"> <div className="page course-category-manage">
{getParameterByName("from") === "aid" ? ( {getParameterByName("from") === "aid" ? (
<Breadcrumbs <Breadcrumbs
navList="课程分类" navList="课程分类"
...@@ -612,7 +612,7 @@ class QuestionCategoryManage extends Component { ...@@ -612,7 +612,7 @@ class QuestionCategoryManage extends Component {
message.info("最多只能添加30个分类"); message.info("最多只能添加30个分类");
return; return;
} }
this.newEditQuestionCategory( this.newEditCourseCategory(
"newEqualLevelCategory", "newEqualLevelCategory",
"equal", "equal",
"new" "new"
...@@ -641,10 +641,10 @@ class QuestionCategoryManage extends Component { ...@@ -641,10 +641,10 @@ class QuestionCategoryManage extends Component {
></DirectoryTree> ></DirectoryTree>
</div> </div>
</div> </div>
{this.state.NewEditQuestionBankCategory} {this.state.NewEditCourseCategoryModal}
</div> </div>
); );
} }
} }
export default QuestionCategoryManage; export default CourseCategoryManage;
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 19:41:42 * @Date: 2021-02-23 19:41:42
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 17:16:43 * @LastEditTime: 2021-03-27 13:49:00
* @Description: 助学工具-题库-题目分类管理样式 * @Description: 助学工具-题库-课程分类管理样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.question-category-manage { .course-category-manage {
position: relative; position: relative;
.search-condition { .search-condition {
width: 30%; width: 30%;
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 10:59:43 * @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 14:50:08 * @LastEditTime: 2021-03-27 13:51:43
* @Description: 助学工具-题库-题库主页面侧边栏 * @Description: 助学工具-题库-课程分类侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { Input, Button, Tree } from "antd"; import { Input, Button, Tree } from "antd";
import "./QuestionBankSider.less"; import "./CourseCategorySiderTree.less";
import User from "@/common/js/user"; import User from "@/common/js/user";
import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService"; import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService";
const { Search } = Input; const { Search } = Input;
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
class QuestionBankSider extends Component { class CourseCategorySiderTree extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
const categoryId = getParameterByName("categoryId"); const categoryId = getParameterByName("categoryId");
...@@ -26,8 +26,6 @@ class QuestionBankSider extends Component { ...@@ -26,8 +26,6 @@ class QuestionBankSider extends Component {
: [categoryId] : [categoryId]
: ["0"], : ["0"],
searchValue: null, searchValue: null,
NewEditQuestionBankCategory: null, //新增或编辑分类模态框
ImportCourseCategory: null, // 引用课程分类模态框
treeData: this.props.treeData || [], treeData: this.props.treeData || [],
autoExpandParent: false, autoExpandParent: false,
}; };
...@@ -195,7 +193,7 @@ class QuestionBankSider extends Component { ...@@ -195,7 +193,7 @@ class QuestionBankSider extends Component {
autoExpandParent, autoExpandParent,
} = this.state; } = this.state;
return ( return (
<div className="question-bank-sider"> <div className="category-tree-sider">
<div className="sider-title">题目分类</div> <div className="sider-title">题目分类</div>
<Search <Search
className="sider-search" className="sider-search"
...@@ -210,7 +208,7 @@ class QuestionBankSider extends Component { ...@@ -210,7 +208,7 @@ class QuestionBankSider extends Component {
<Button <Button
onClick={() => { onClick={() => {
window.RCHistory.push({ window.RCHistory.push({
pathname: "/question-category-manage?from=aid", pathname: "/course-category-manage?from=aid",
}); });
}} }}
> >
...@@ -229,11 +227,9 @@ class QuestionBankSider extends Component { ...@@ -229,11 +227,9 @@ class QuestionBankSider extends Component {
treeData={treeData} treeData={treeData}
/> />
</div> </div>
{this.state.NewEditQuestionBankCategory}
{this.state.ImportCourseCategory}
</div> </div>
); );
} }
} }
export default QuestionBankSider; export default CourseCategorySiderTree;
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 12:02:34 * @Date: 2021-02-22 12:02:34
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 15:57:12 * @LastEditTime: 2021-03-27 13:52:19
* @Description: 助学工具-题库-题库主页面侧边栏样式 * @Description: 助学工具-题库-课程分类侧边栏样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.question-bank-sider { .category-tree-sider {
position: relative; position: relative;
.sider-title { .sider-title {
height: 22px; height: 22px;
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 17:51:28 * @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 15:02:53 * @LastEditTime: 2021-03-27 14:08:47
* @Description: 助学工具-题库-题库新建或编辑题库分类模态框 * @Description: 助学工具-题库-新建编辑课程分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { Modal, Form, Input, message } from "antd"; import { Modal, Form, Input, message } from "antd";
import User from "@/common/js/user"; import User from "@/common/js/user";
import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService"; import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService";
class NewEditQuestionBankCategory extends Component { class NewEditCourseCategoryModal extends Component {
formRef = React.createRef(); formRef = React.createRef();
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -22,7 +22,6 @@ class NewEditQuestionBankCategory extends Component { ...@@ -22,7 +22,6 @@ class NewEditQuestionBankCategory extends Component {
} }
componentDidMount() { componentDidMount() {
// document.getElementById("categoryName").setAttribute("style", "autocomplete","off")
this.queryCategoryTree(); this.queryCategoryTree();
} }
...@@ -196,4 +195,4 @@ class NewEditQuestionBankCategory extends Component { ...@@ -196,4 +195,4 @@ class NewEditQuestionBankCategory extends Component {
); );
} }
} }
export default NewEditQuestionBankCategory; export default NewEditCourseCategoryModal;
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 17:51:01 * @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-24 13:55:56 * @LastEditTime: 2021-03-27 13:42:42
* @Description: 助学工具-题库-题库主页面 * @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import "./QuestionBankIndex.less"; import "./QuestionBankIndex.less";
import QuestionBankSider from "./components/QuestionBankSider"; import QuestionBankSider from "../components/CourseCategorySiderTree";
import QuestionManageContent from "./components/QuestionManageContent"; import QuestionManageContent from "./components/QuestionManageContent";
class QuestionBankIndex extends Component { class QuestionBankIndex extends Component {
...@@ -29,8 +29,7 @@ class QuestionBankIndex extends Component { ...@@ -29,8 +29,7 @@ class QuestionBankIndex extends Component {
}; };
updatedSiderTreeFromList = (currentTotal, updatedCategoryId) => { updatedSiderTreeFromList = (currentTotal, updatedCategoryId) => {
this.setState({ currentTotal }); this.setState({ currentTotal, updatedCategoryId });
this.setState({ updatedCategoryId });
}; };
render() { render() {
...@@ -38,7 +37,9 @@ class QuestionBankIndex extends Component { ...@@ -38,7 +37,9 @@ class QuestionBankIndex extends Component {
<div className="question-bank-index page"> <div className="question-bank-index page">
<div className="content-header">题目</div> <div className="content-header">题目</div>
<div className="box content-body"> <div className="box content-body">
<div style={{borderRight: "0.5px solid #EEEEEE", paddingRight: "4px"}}> <div
style={{ borderRight: "0.5px solid #EEEEEE", paddingRight: "4px" }}
>
<div className="sider"> <div className="sider">
<QuestionBankSider <QuestionBankSider
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)} getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 14:34:29 * @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-25 19:52:09 * @LastEditTime: 2021-03-27 14:02:44
* @Description: 助学工具-题库-题目管理-新建题目Tab * @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -73,8 +73,10 @@ class NewQuestionTab extends Component { ...@@ -73,8 +73,10 @@ class NewQuestionTab extends Component {
// 选择题(单选 多选 不定项)-插入4条默认选项 // 选择题(单选 多选 不定项)-插入4条默认选项
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
this.handleAddOption(); this.handleAddOption();
this.setState({ [`optionsValidate_${i}`]: "success" }); this.setState({
this.setState({ [`optionsText_${i}`]: "" }); [`optionsValidate_${i}`]: "success",
[`optionsText_${i}`]: "",
});
} }
} }
} else if (this.props.questionTypeKey === "JUDGE") { } else if (this.props.questionTypeKey === "JUDGE") {
...@@ -105,16 +107,18 @@ class NewQuestionTab extends Component { ...@@ -105,16 +107,18 @@ class NewQuestionTab extends Component {
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { questionInfo } = nextProps; const { questionInfo } = nextProps;
if (this.props.questionInfo !== questionInfo) { if (this.props.questionInfo !== questionInfo) {
this.setState({
gapFillingAnswer: JSON.parse(
JSON.stringify(questionInfo.gapFillingAnswerList)
),
});
this.setState( this.setState(
{ {
gapFillingAnswer: JSON.parse(
JSON.stringify(questionInfo.gapFillingAnswerList)
),
stemContent: JSON.parse( stemContent: JSON.parse(
JSON.stringify(questionInfo.questionStemList) JSON.stringify(questionInfo.questionStemList)
), ),
chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)),
questionAnswerDesc: JSON.parse(
JSON.stringify(questionInfo.questionAnswerDescList)
),
}, },
() => { () => {
const con = questionInfo.questionStemList[0].content; const con = questionInfo.questionStemList[0].content;
...@@ -126,15 +130,7 @@ class NewQuestionTab extends Component { ...@@ -126,15 +130,7 @@ class NewQuestionTab extends Component {
}); });
this.setState({ blanksList: _blanksList || [] }); this.setState({ blanksList: _blanksList || [] });
} }
); // 题干内容 );
this.setState({
chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)),
}); // 单选多选不定项-选项列表
this.setState({
questionAnswerDesc: JSON.parse(
JSON.stringify(questionInfo.questionAnswerDescList)
),
}); // 答案解析
this._onSetState(); this._onSetState();
} }
return true; return true;
...@@ -175,8 +171,8 @@ class NewQuestionTab extends Component { ...@@ -175,8 +171,8 @@ class NewQuestionTab extends Component {
stem = stem.replace(/\s+/g, ""); stem = stem.replace(/\s+/g, "");
if (this.props.questionTypeKey === "GAP_FILLING") { if (this.props.questionTypeKey === "GAP_FILLING") {
if (this.state.blanksList.length === 0 || stem.length === 0) { if (this.state.blanksList.length === 0 || stem.length === 0) {
this.setState({ stemValidate: "error" });
this.setState({ this.setState({
stemValidate: "error",
stemText: ( stemText: (
<div style={{ marginTop: 8, minWidth: "523px" }}> <div style={{ marginTop: 8, minWidth: "523px" }}>
请输入正确格式,示例:党章规定,凡事有 请输入正确格式,示例:党章规定,凡事有
...@@ -193,17 +189,14 @@ class NewQuestionTab extends Component { ...@@ -193,17 +189,14 @@ class NewQuestionTab extends Component {
}); });
validateError++; validateError++;
} else { } else {
this.setState({ stemValidate: "success" }); this.setState({ stemValidate: "success", stemText: "" });
this.setState({ stemText: "" });
} }
} else { } else {
if (stem.length === 0) { if (stem.length === 0) {
this.setState({ stemValidate: "error" }); this.setState({ stemValidate: "error", stemText: "请输入题干" });
this.setState({ stemText: "请输入题干" });
validateError++; validateError++;
} else { } else {
this.setState({ stemValidate: "success" }); this.setState({ stemValidate: "success", stemText: "" });
this.setState({ stemText: "" });
} }
} }
// 选项校验 // 选项校验
...@@ -212,12 +205,16 @@ class NewQuestionTab extends Component { ...@@ -212,12 +205,16 @@ class NewQuestionTab extends Component {
if (this.props.questionTypeKey === "GAP_FILLING") { if (this.props.questionTypeKey === "GAP_FILLING") {
this.state.gapFillingAnswer.forEach((item, index) => { this.state.gapFillingAnswer.forEach((item, index) => {
if (item.correctAnswerList.length === 0) { if (item.correctAnswerList.length === 0) {
this.setState({ [`optionsValidate_${index}`]: "error" }); this.setState({
this.setState({ [`optionsText_${index}`]: "请输入答案" }); [`optionsValidate_${index}`]: "error",
[`optionsText_${index}`]: "请输入答案",
});
validateError++; validateError++;
} else { } else {
this.setState({ [`optionsValidate_${index}`]: "success" }); this.setState({
this.setState({ [`optionsText_${index}`]: "" }); [`optionsValidate_${index}`]: "success",
[`optionsText_${index}`]: "",
});
} }
}); });
} else { } else {
...@@ -235,12 +232,16 @@ class NewQuestionTab extends Component { ...@@ -235,12 +232,16 @@ class NewQuestionTab extends Component {
optionContent[0].type === "RICH_TEXT" && optionContent[0].type === "RICH_TEXT" &&
optionInput.length === 0 optionInput.length === 0
) { ) {
this.setState({ [`optionsValidate_${index}`]: "error" }); this.setState({
this.setState({ [`optionsText_${index}`]: "请输入选项" }); [`optionsValidate_${index}`]: "error",
[`optionsText_${index}`]: "请输入选项",
});
validateError++; validateError++;
} else { } else {
this.setState({ [`optionsValidate_${index}`]: "success" }); this.setState({
this.setState({ [`optionsText_${index}`]: "" }); [`optionsValidate_${index}`]: "success",
[`optionsText_${index}`]: "",
});
} }
}); });
var chooseIcon = []; var chooseIcon = [];
...@@ -254,11 +255,8 @@ class NewQuestionTab extends Component { ...@@ -254,11 +255,8 @@ class NewQuestionTab extends Component {
chooseIcon = document.getElementsByClassName("ant-checkbox-inner"); chooseIcon = document.getElementsByClassName("ant-checkbox-inner");
} }
if (optionUnChecked === chooseOptions.length) { if (optionUnChecked === chooseOptions.length) {
this.setState({ radioValidate: "error" });
chooseIcon.forEach((item) => {
item.setAttribute("style", "border:1px solid #ff4d4f;");
});
this.setState({ this.setState({
radioValidate: "error",
radioText: ( radioText: (
<span> <span>
正确答案 正确答案
...@@ -267,10 +265,12 @@ class NewQuestionTab extends Component { ...@@ -267,10 +265,12 @@ class NewQuestionTab extends Component {
</span> </span>
), ),
}); });
chooseIcon.forEach((item) => {
item.setAttribute("style", "border:1px solid #ff4d4f;");
});
validateError++; validateError++;
} else { } else {
this.setState({ radioValidate: "success" }); this.setState({ radioValidate: "success", radioText: "" });
this.setState({ radioText: "" });
chooseIcon.forEach((item) => { chooseIcon.forEach((item) => {
item.removeAttribute("style"); item.removeAttribute("style");
}); });
...@@ -279,8 +279,7 @@ class NewQuestionTab extends Component { ...@@ -279,8 +279,7 @@ class NewQuestionTab extends Component {
this.props.questionTypeKey === "MULTI_CHOICE" && this.props.questionTypeKey === "MULTI_CHOICE" &&
this.state.chooseOptions.length - optionUnChecked === 1 this.state.chooseOptions.length - optionUnChecked === 1
) { ) {
this.setState({ radioValidate: "error" }); this.setState({ radioValidate: "error", radioText: "最少选两个" });
this.setState({ radioText: "最少选两个" });
chooseIcon.forEach((item) => { chooseIcon.forEach((item) => {
item.setAttribute("style", "border:1px solid #ff4d4f;"); item.setAttribute("style", "border:1px solid #ff4d4f;");
}); });
...@@ -485,8 +484,6 @@ class NewQuestionTab extends Component { ...@@ -485,8 +484,6 @@ class NewQuestionTab extends Component {
// 录音 // 录音
this.setState({ this.setState({
showRecord: true, showRecord: true,
});
this.setState({
onAudioFinish: function () { onAudioFinish: function () {
change(); change();
}, },
...@@ -582,27 +579,31 @@ class NewQuestionTab extends Component { ...@@ -582,27 +579,31 @@ class NewQuestionTab extends Component {
changeBlankCount = (data, idx) => { changeBlankCount = (data, idx) => {
let _gap = this.state.gapFillingAnswer; let _gap = this.state.gapFillingAnswer;
if (data.length <= idx) { if (data.length === 0) {
_gap.splice(idx, 1); _gap = [];
} else { } else {
data.forEach((item, index) => { if (data.length <= idx) {
if (index === idx) { _gap.splice(idx, 1);
if (_gap.length < data.length) { } else {
_gap.splice(idx, 0, { correctAnswerList: [] }); data.forEach((item, index) => {
} else if (_gap.length > data.length) { if (index === idx) {
_gap.splice(idx, 1); if (_gap.length < data.length) {
} else { _gap.splice(idx, 0, { correctAnswerList: [] });
_gap.splice(idx, 1, { correctAnswerList: [] }); } else if (_gap.length > data.length) {
_gap.splice(idx, 1);
} else {
_gap.splice(idx, 1, { correctAnswerList: [] });
}
} }
} if (!item.correctAnswerList) {
if (!item.correctAnswerList) { item.correctAnswerList = [];
item.correctAnswerList = []; }
} item.inputVisible = false;
item.inputVisible = false; item.errorHold = false;
item.errorHold = false; item.editInput = false;
item.editInput = false; return item;
return item; });
}); }
} }
this.setState( this.setState(
...@@ -644,10 +645,10 @@ class NewQuestionTab extends Component { ...@@ -644,10 +645,10 @@ class NewQuestionTab extends Component {
} }
}); });
this.setState({ gapFillingAnswer: _gapFillingAnswer }, () => this.setState(
this._onSetState() { gapFillingAnswer: _gapFillingAnswer, blanksList: _blanksList },
() => this._onSetState()
); );
this.setState({ blanksList: _blanksList });
}; };
handleTagClose = (optionItem, removedTag, removedIndex) => { handleTagClose = (optionItem, removedTag, removedIndex) => {
...@@ -663,10 +664,10 @@ class NewQuestionTab extends Component { ...@@ -663,10 +664,10 @@ class NewQuestionTab extends Component {
); );
} }
}); });
this.setState({ gapFillingAnswer: _gapFillingAnswer }, () => this.setState(
this._onSetState() { gapFillingAnswer: _gapFillingAnswer, blanksList: _blanksList },
() => this._onSetState()
); );
this.setState({ blanksList: _blanksList });
}; };
// 输入框关闭 // 输入框关闭
......
...@@ -8,16 +8,6 @@ ...@@ -8,16 +8,6 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import "./XMAudio.less"; import "./XMAudio.less";
import VideoUpload from "@/core/upload"; import VideoUpload from "@/core/upload";
import { string } from "prop-types";
// interface XMAudioProps {
// style?: any;
// index?: any;
// size?: number | string;
// url?: any;
// forbidParse?:boolean;
// getDuration?: (value: number) => void;
// }
let timerInterval; let timerInterval;
......
/* /*
* @Author: chenjianyu * @Author: chenjianyu
* @Date: 2020-09-12 17:00:44 * @Date: 2020-09-12 17:00:44
* @LastEditTime: 2021-03-18 17:23:09 * @LastEditTime: 2021-03-27 14:02:17
* @LastEditors: sunbingqing * @LastEditors: yuananting
* @Description: 答题模式模板 * @Description: 答题模式模板
* @Copyright © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { Modal, Button, Upload, message, Spin, Progress } from "antd"; import { Modal, Button, message, Spin } from "antd";
import "./BatchImportQuestionModal.less"; import "./BatchImportQuestionModal.less";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import User from "@/common/js/user"; import User from "@/common/js/user";
...@@ -222,9 +222,11 @@ class BatchImportQuestionModal extends Component { ...@@ -222,9 +222,11 @@ class BatchImportQuestionModal extends Component {
type="primary" type="primary"
className="down-btn" className="down-btn"
onClick={() => { onClick={() => {
this.setState({ status: "init" }); this.setState({
this.setState({ uploadFile: null }); status: "init",
this.setState({ showSelectFileModal: true }); uploadFile: null,
showSelectFileModal: true,
});
}} }}
> >
重新上传文件 重新上传文件
......
@import '../../../core/mixins.less'; @import '@/core/mixins.less';
.import-score-modal { .import-score-modal {
.step-section { .step-section {
margin-bottom: 24px; margin-bottom: 24px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-04-29 10:26:32 * @Date: 2020-04-29 10:26:32
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-18 11:30:15 * @LastEditTime: 2021-03-27 11:38:59
* @Description: 内容线路由配置 * @Description: 内容线路由配置
*/ */
import Home from '@/modules/home/Home'; import Home from '@/modules/home/Home';
...@@ -25,9 +25,9 @@ import PlanPage from '@/modules/plan-manage/PlanPage'; ...@@ -25,9 +25,9 @@ import PlanPage from '@/modules/plan-manage/PlanPage';
import AddPlanPage from '@/modules/plan-manage/AddPlan'; import AddPlanPage from '@/modules/plan-manage/AddPlan';
import LearningDataPage from '@/modules/plan-manage/LearningData'; import LearningDataPage from '@/modules/plan-manage/LearningData';
import StoreInfoPage from '@/modules/store-manage/StoreInfo'; import StoreInfoPage from '@/modules/store-manage/StoreInfo';
import QuestionBankIndex from '@/modules/teach-tool/QuestionBankIndex'; import QuestionBankIndex from '@/modules/teach-tool/question-bank/QuestionBankIndex';
import QuestionCategoryManage from '@/modules/teach-tool/QuestionCategoryManage'; import CourseCategoryManage from '@/modules/teach-tool/components/CourseCategoryManage';
import AddNewQuestion from '@/modules/teach-tool/AddNewQuestion'; import AddNewQuestion from '@/modules/teach-tool/question-bank/AddNewQuestion';
const mainRoutes = [ const mainRoutes = [
{ {
...@@ -101,8 +101,8 @@ const mainRoutes = [ ...@@ -101,8 +101,8 @@ const mainRoutes = [
name: '题库' name: '题库'
}, },
{ {
path: '/question-category-manage', path: '/course-category-manage',
component:QuestionCategoryManage, component:CourseCategoryManage,
name: '分类管理' name: '分类管理'
}, },
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 15:53:31 * @Date: 2021-02-21 15:53:31
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-19 15:31:56 * @LastEditTime: 2021-03-27 11:50:31
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -93,7 +93,7 @@ export const menuList: any = [ ...@@ -93,7 +93,7 @@ export const menuList: any = [
{ {
groupName: "课程分类", groupName: "课程分类",
groupCode: "CourseCategory", groupCode: "CourseCategory",
link: '/question-category-manage' link: '/course-category-manage'
}, },
{ {
groupName: "店铺装修", groupName: "店铺装修",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment