Skip to content
Snippets Groups Projects
Commit ea5fcbba authored by Hidde Leistra's avatar Hidde Leistra
Browse files

Fix linter errors

parent 27eaa15e
No related branches found
No related tags found
3 merge requests!26Premade feedback merge,!24Master->develop (this MR contains no useful information),!23WIP: Highlight feedback
Pipeline #18099 passed
This commit is part of merge request !24. Comments created here will be created in the context of that merge request.
......@@ -104,14 +104,14 @@ class Exams extends React.Component {
updateFeedback = (feedback) => {
var widgets = this.state.widgets
const idx = widgets[this.state.selectedWidgetId].problem.feedback.findIndex(e => { return e.id == feedback.id })
if(idx == -1) widgets[this.state.selectedWidgetId].problem.feedback.push(feedback)
const idx = widgets[this.state.selectedWidgetId].problem.feedback.findIndex(e => { return e.id === feedback.id })
if (idx === -1) widgets[this.state.selectedWidgetId].problem.feedback.push(feedback)
else {
if(feedback.deleted) widgets[this.state.selectedWidgetId].problem.feedback.splice(idx, 1)
if (feedback.deleted) widgets[this.state.selectedWidgetId].problem.feedback.splice(idx, 1)
else widgets[this.state.selectedWidgetId].problem.feedback[idx] = feedback
}
this.setState({
widgets:widgets
widgets: widgets
})
}
......
......@@ -40,8 +40,8 @@ class EditPanel extends React.Component {
}
static getDerivedStateFromProps (nextProps, prevState) {
// In case nothing is set, use an empty function that no-ops
const updateCallback = nextProps.updateCallback || ( _ => {})
// In case nothing is set, use an empty function that no-ops
const updateCallback = nextProps.updateCallback || (_ => {})
if (nextProps.feedback && prevState.id !== nextProps.feedback.id) {
const fb = nextProps.feedback
return {
......@@ -94,7 +94,7 @@ class EditPanel extends React.Component {
} else {
api.post(uri, fb)
.then((response) => {
// Response is the feedback option
// Response is the feedback option
this.state.updateCallback(response)
this.setState({
id: null,
......
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