index.js 1.17 KB
Newer Older
zhanghaozhe committed
1 2
import React, { Component } from 'react';
import './index.scss'
zhanghaozhe committed
3
import { Switch, Route } from 'react-router-dom'
zhanghaozhe committed
4 5
import Scores from './scores'
import Exam from './exam'
zhanghaozhe committed
6 7 8 9 10
import SubmitAnswer from "src/components/ai-test/submit-answer"
import Analysis from "src/components/ai-test/analysis"
import Assist from "src/components/ai-test/assist"
import Help from 'src/components/ai-test/share'
import Report from 'src/components/ai-test/report'
zhanghaozhe committed
11 12

class AiTest extends Component {
zhanghaozhe committed
13

zhanghaozhe committed
14 15 16 17
  render() {
    const {match} = this.props
    return (
      <Switch>
zhanghaozhe committed
18 19 20 21 22 23 24
        <Route path={`${match.path}/exam`} render={props => <Exam {...props}/>}/>
        <Route path={`${match.path}/submit`} render={props => <SubmitAnswer {...props}/>}/>
        <Route path={`${match.path}/analysis/:recordId`} render={props => <Analysis {...props}/>}/>
        <Route path={`${match.path}/assist/:assistCode`} render={props => <Assist {...props}/>}/>
        <Route path={`${match.path}/share`} render={props => <Help {...props}/>}/>
        <Route path={`${match.path}/report`} render={props => <Report {...props}/>}/>
        <Route render={(props) => <Scores {...props}/>}/>
zhanghaozhe committed
25 26 27 28 29 30
      </Switch>
    );
  }
}

export default AiTest;