Router, dashboard
This commit is contained in:
@@ -10,9 +10,7 @@ class AnswerKeyForm extends React.Component {
|
||||
courseName: '',
|
||||
numTests: 10,
|
||||
numQuestionsPerTest: 10,
|
||||
answers: Array(
|
||||
props.defaultNumTests * props.defaultNumQuestionsPerTest
|
||||
).fill(null),
|
||||
answers: Array(10 * 10).fill(null),
|
||||
};
|
||||
|
||||
this.handleInputChange = this.handleInputChange.bind(this);
|
||||
@@ -112,7 +110,7 @@ class AnswerKeyForm extends React.Component {
|
||||
|
||||
return (
|
||||
<div className="answerkeyform">
|
||||
<h1>New Answer Key</h1>
|
||||
<h2>New Answer Key</h2>
|
||||
<form>
|
||||
<label>Course name</label>
|
||||
<input
|
||||
|
||||
13
src/components/AnswerKeyList/index.js
Normal file
13
src/components/AnswerKeyList/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
|
||||
class AnswerKeyList extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="answerkeylist row">
|
||||
<h2>Answer Keys</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AnswerKeyList;
|
||||
@@ -1,15 +1,22 @@
|
||||
import React, {Component} from 'react';
|
||||
import NavBar from './NavBar';
|
||||
import Dashboard from './Dashboard';
|
||||
import AnswerKeyForm from './AnswerKeyForm';
|
||||
import AnswerKeyList from './AnswerKeyList';
|
||||
import {BrowserRouter as Router, Route} from 'react-router-dom';
|
||||
|
||||
class App extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
<NavBar />
|
||||
<Router>
|
||||
<div className="container">
|
||||
<AnswerKeyForm defaultNumTests={10} defaultNumQuestionsPerTest={10} />
|
||||
<Route path="/" exact component={Dashboard} />
|
||||
<Route path="/answerkeys" exact component={AnswerKeyList} />
|
||||
<Route path="/answerkeys/create" exact component={AnswerKeyForm} />
|
||||
</div>
|
||||
</Router>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
0
src/components/Dashboard/index.css
Normal file
0
src/components/Dashboard/index.css
Normal file
23
src/components/Dashboard/index.js
Normal file
23
src/components/Dashboard/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import './index.css';
|
||||
import {Link} from 'react-router-dom';
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="dashboard row">
|
||||
<Link to="/grade" className="button four columns">
|
||||
Grade a test
|
||||
</Link>
|
||||
<Link to="/answerkeys/create" className="button four columns">
|
||||
Enter an answer key
|
||||
</Link>
|
||||
<Link to="/answerkeys" className="button four columns">
|
||||
List answer keys
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Dashboard;
|
||||
Reference in New Issue
Block a user