Skip to content
Snippets Groups Projects
Commit f3a8dccd authored by Thomas Roos's avatar Thomas Roos
Browse files

Fix exam unable to change bug

parent 44552bb4
Branches
Tags
No related merge requests found
......@@ -119,7 +119,7 @@ class App extends React.Component {
<Switch>
<Route exact path="/" component={Home} />
<Route path="/exams/:examID" render={({match}) =>
<Exam exam={exam} urlID={match.params.examID} changeExam={this.changeExam} updateSubmission={this.updateSubmission}/> }/>
<Exam exam={exam} urlID={match.params.examID} updateExam={this.updateExam} updateSubmission={this.updateSubmission}/> }/>
<Route path="/exams" render={({history}) =>
<AddExam updateExamList={() => this.menu.current.updateExamList()} changeURL={history.push} /> }/>
<Route path="/students" render={() =>
......
......@@ -31,7 +31,8 @@ class Exams extends React.Component {
state = {
yaml: "",
pdfs: []
pdfs: [],
examID: null
};
putYaml = () => {
......@@ -97,6 +98,7 @@ class Exams extends React.Component {
}
componentDidUpdate = (prevProps) => {
if (prevProps.exam.id != this.props.exam.id) this.updatePDFs()
if (prevProps.urlID !== this.props.urlID) this.props.updateExam(this.props.urlID)
}
componentWillUnmount = () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment