Skip to content
Snippets Groups Projects
Commit cb0d527b authored by Joseph Weston's avatar Joseph Weston
Browse files

fix off-by-one error when selecting exams

parent cb062bce
No related branches found
No related tags found
No related merge requests found
......@@ -231,11 +231,11 @@ class CheckStudents extends React.Component {
}
selectExam = (event) => {
var id = this.state.exam.list.findIndex(ex => ex.name === event.target.value);
const id = this.state.exam.list.findIndex(ex => ex.name === event.target.value);
this.setState({
exam: {
...this.state.exam,
id: id,
id: id + 1, // exam IDs are 1-based and the exam list is 0-based
name: event.target.value
}
}, this.loadSubmissions)
......@@ -472,4 +472,4 @@ class CheckStudents extends React.Component {
}
}
export default CheckStudents;
\ No newline at end of file
export default CheckStudents;
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