Commit 7a00caf3 authored by Hidde Leistra's avatar Hidde Leistra

Only show feedback when selecting a problem

parent d9823391
......@@ -106,6 +106,10 @@ class Exams extends React.Component {
})
}
isProblemWidget = (widget) => {
return widget && this.state.widgets[widget].problem
}
saveProblemName = () => {
const changedWidgetId = this.state.changedWidgetId
if (!changedWidgetId) return
......@@ -330,7 +334,7 @@ class Exams extends React.Component {
</div>
</div>
<div>
{selectedWidgetId !== null && (this.state.editActive
{this.isProblemWidget(selectedWidgetId) && (this.state.editActive
? <EditPanel problemID={props.problem.id} feedback={this.state.feedbackToEdit}
goBack={this.backToFeedback} />
: <FeedbackPanel examID={this.props.examID} problem={props.problem}
......
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