Commit 3fc2fa72 authored by Adrià Labay's avatar Adrià Labay
Browse files

update exam list on finalise

parent 58d711aa
...@@ -771,6 +771,12 @@ class ExamTemplated extends React.Component { ...@@ -771,6 +771,12 @@ class ExamTemplated extends React.Component {
) )
} }
onFinalise = () => {
this.props.updateExam()
// needed to enable tabs in navbar
this.props.updateExamList()
}
PanelExamActions = () => { PanelExamActions = () => {
if (this.props.exam.finalized) { if (this.props.exam.finalized) {
return <PanelGenerate examID={this.state.examID} /> return <PanelGenerate examID={this.state.examID} />
...@@ -779,7 +785,7 @@ class ExamTemplated extends React.Component { ...@@ -779,7 +785,7 @@ class ExamTemplated extends React.Component {
return ( return (
<PanelFinalize <PanelFinalize
examID={this.props.examID} examID={this.props.examID}
onFinalise={() => this.props.updateExam()} onFinalise={this.onFinalise}
deleteExam={this.props.deleteExam}> deleteExam={this.props.deleteExam}>
<p className='content' dangerouslySetInnerHTML={{__html: ExamFinalizeMarkdown}} /> <p className='content' dangerouslySetInnerHTML={{__html: ExamFinalizeMarkdown}} />
</PanelFinalize> </PanelFinalize>
......
...@@ -208,6 +208,12 @@ class PanelEditUnstructured extends React.Component { ...@@ -208,6 +208,12 @@ class PanelEditUnstructured extends React.Component {
} }
} }
onFinalise = () => {
this.props.updateExam()
// needed to enable tabs in navbar
this.props.updateExamList()
}
PanelProblem = (props) => { PanelProblem = (props) => {
return ( return (
( (
...@@ -303,7 +309,7 @@ class PanelEditUnstructured extends React.Component { ...@@ -303,7 +309,7 @@ class PanelEditUnstructured extends React.Component {
{!this.state.exam.finalized && {!this.state.exam.finalized &&
<PanelFinalize <PanelFinalize
examID={this.props.examID} examID={this.props.examID}
onFinalise={() => this.props.updateExam()} onFinalise={this.onFinalise}
deleteExam={this.props.deleteExam}> deleteExam={this.props.deleteExam}>
Finalized exams cannot be deleted. Finalized exams cannot be deleted.
Take care to not delete or add pages after finalization. Take care to not delete or add pages after finalization.
......
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