Commit 5ce0d807 authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

Merge branch '523-update-exam-after-finalise' into 'master'

Scans tab status not updated upon finalization

Closes #523

See merge request !314
parents bd14cb89 653217de
......@@ -771,6 +771,12 @@ class ExamTemplated extends React.Component {
)
}
onFinalize = () => {
this.props.updateExam()
// needed to enable tabs in navbar
this.props.updateExamList()
}
PanelExamActions = () => {
if (this.props.exam.finalized) {
return <PanelGenerate examID={this.state.examID} />
......@@ -779,7 +785,7 @@ class ExamTemplated extends React.Component {
return (
<PanelFinalize
examID={this.props.examID}
onFinalise={() => this.props.updateExam()}
onFinalize={this.onFinalize}
deleteExam={this.props.deleteExam}>
<p className='content' dangerouslySetInnerHTML={{__html: ExamFinalizeMarkdown}} />
</PanelFinalize>
......
......@@ -208,6 +208,12 @@ class PanelEditUnstructured extends React.Component {
}
}
onFinalize = () => {
this.props.updateExam()
// needed to enable tabs in navbar
this.props.updateExamList()
}
PanelProblem = (props) => {
return (
(
......@@ -303,7 +309,7 @@ class PanelEditUnstructured extends React.Component {
{!this.state.exam.finalized &&
<PanelFinalize
examID={this.props.examID}
onFinalise={() => this.props.updateExam()}
onFinalize={this.onFinalize}
deleteExam={this.props.deleteExam}>
Finalized exams cannot be deleted.
Take care to not delete or add pages after finalization.
......
......@@ -25,7 +25,7 @@ class PanelFinalize extends React.Component {
finalize = () => {
api.put(`exams/${this.state.examID}`, { finalized: true })
.then(() => {
this.props.onFinalise()
this.props.onFinalize()
this.setState({ previewing: false })
})
}
......
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