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

Update newly viewed submission on student page

parent 536ba8b7
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,10 @@ class CheckStudents extends React.Component {
if (newIndex >= 0 && newIndex < this.props.exam.submissions.length) {
this.setState({
index: newIndex,
input: this.props.exam.submissions[newIndex].id
}, this.setSubmission)
})
this.props.updateSubmission(newIndex)
}
}
next = () => {
......@@ -67,8 +69,10 @@ class CheckStudents extends React.Component {
if (newIndex >= 0 && newIndex < this.props.exam.submissions.length) {
this.setState({
index: newIndex,
input: this.props.exam.submissions[newIndex].id
}, this.setSubmission)
})
this.props.updateSubmission(newIndex)
}
}
......@@ -102,7 +106,8 @@ class CheckStudents extends React.Component {
if (i >= 0) {
this.setState({
index: i,
}, /* UPDATE SUBMISSION IN TOP COMPONENT */)
})
this.props.updateSubmission(i)
} else {
this.setState({
input: this.props.submissions[this.state.index].id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment