Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resetCounters() {
// reset the counters
this.$scope.feedbackCorrectCount = this.$scope.situationFeedback.length;
this.$scope.feedbackIncorrectCount = 0;
for(let fb of this.$scope.situationFeedback) {
if (fb.feedbackType.id === Model.FeedbackTypes.FALSE_POSITIVE.id) {
this.$scope.feedbackCorrectCount--;
this.$scope.feedbackIncorrectCount++;
}
}
}
markIncorrect(reductionKey) {
for (let feedback of this.$scope.situationFeedback) {
if (feedback.alarmKey === reductionKey) {
if (feedback.feedbackType.id == Model.FeedbackTypes.CORRECT.id) {
feedback.feedbackType = Model.FeedbackTypes.FALSE_POSITIVE;
this.$scope.feedbackCorrectCount--;
this.$scope.feedbackIncorrectCount++;
break;
}
}
}
}