题库管理和试卷管理代码提交

main
hujunpeng 4 months ago
parent 7857eb3e38
commit e32823d8a0
  1. 15
      packages/examination/src/api/examPaper/index.tsx
  2. 2
      packages/examination/src/components/contentMain/index.js
  3. 2
      packages/examination/src/views/examPaper/examPaperList.tsx
  4. 2
      packages/examination/src/views/question/questionAdd.tsx
  5. 2
      packages/examination/src/views/question/questionUp.tsx
  6. 4
      packages/examination/src/views/slider/menu.tsx

@ -105,3 +105,18 @@ export function getDetail(id: string) {
method: 'get' method: 'get'
}); });
} }
/*
*
*/
export function getRandomQuestions(industryId: string, questionCount: number){
const data = {
industryId:industryId,
questionCount:questionCount
};
return axios({
url: "/ex/examPaper/getRandomQuestions",
method: 'post',
data: data
})
}

@ -32,6 +32,7 @@ import QuestionList from 'views/question/questionList';
import QuestionAdd from 'views/question/questionAdd'; import QuestionAdd from 'views/question/questionAdd';
import QuestionUp from 'views/question/questionUp'; import QuestionUp from 'views/question/questionUp';
import ExamPaperList from 'views/examPaper/examPaperList'; import ExamPaperList from 'views/examPaper/examPaperList';
import ExamPaperAdd from 'views/examPaper/examPaperAdd';
class ContentMain extends Component { class ContentMain extends Component {
@ -58,6 +59,7 @@ class ContentMain extends Component {
<Route exact path='/questionAdd' component={ QuestionAdd }/> <Route exact path='/questionAdd' component={ QuestionAdd }/>
<Route exact path='/questionUp' component={ QuestionUp }/> <Route exact path='/questionUp' component={ QuestionUp }/>
<Route exact path='/examPaperList' component={ ExamPaperList }/> <Route exact path='/examPaperList' component={ ExamPaperList }/>
<Route exact path='/examPaperAdd' component={ ExamPaperAdd }/>
<Redirect exact from='/' to='/home'/> <Redirect exact from='/' to='/home'/>
</Switch> </Switch>
</div> </div>

@ -277,7 +277,7 @@ class ExamPaperList extends Component<any, States> {
// 页面跳转 // 页面跳转
const handleAddQuestion = () => { const handleAddQuestion = () => {
this.props.history.push('/questionAdd'); this.props.history.push('/examPaperAdd');
}; };
const columns: any = [ const columns: any = [

@ -265,7 +265,7 @@ class QuestionAdd extends Component<any, States> {
this.props.history.push('/questionList'); this.props.history.push('/questionList');
}; };
return ( return (
<div className="container"> <div className="container" >
<div style={{ textAlign: 'right'}}> <div style={{ textAlign: 'right'}}>
<Button type="default" style={{ marginRight: 10 }} onClick={this.downloadTemplate}></Button> <Button type="default" style={{ marginRight: 10 }} onClick={this.downloadTemplate}></Button>
<Button type="default" onClick={this.handleImportClick}></Button> <Button type="default" onClick={this.handleImportClick}></Button>

@ -76,7 +76,7 @@ class QuestionUp extends Component<any, States> {
getDetail(id).then((res: any) => { getDetail(id).then((res: any) => {
if (res.data) { if (res.data) {
let answerOptions = {}; let answerOptions = {};
const options = res.data.options.split(';'); const options = res.data.options.split('');
options.forEach((option: any) => { options.forEach((option: any) => {
const [key, value] = option.split(':'); const [key, value] = option.split(':');
answerOptions[key] = value; answerOptions[key] = value;

@ -40,7 +40,7 @@ const menuList = [
icon: 'icon-peizhi', icon: 'icon-peizhi',
subs: [ subs: [
{ {
title: '题库管理', title: '题库列表',
key: 'questionList', key: 'questionList',
} }
] ]
@ -51,7 +51,7 @@ const menuList = [
icon: 'icon-peizhi', icon: 'icon-peizhi',
subs: [ subs: [
{ {
title: '试卷管理', title: '试卷列表',
key: 'examPaperList', key: 'examPaperList',
} }
] ]

Loading…
Cancel
Save