diff --git a/src/components/forms/SolutionDetailsForm.js b/src/components/forms/SolutionDetailsForm.js index f702c516f06ec49d4b7faf30169f683269984929..005cd935949086902f6c3f252868a47f2e4cb8bc 100644 --- a/src/components/forms/SolutionDetailsForm.js +++ b/src/components/forms/SolutionDetailsForm.js @@ -25,22 +25,22 @@ class SolutionDetailsForm extends Component { const noAcceptStudents = []; const acceptedStudents = []; - for (let i = 0; i < this.props.homeworks.profiles.length; i += 1) { - const profileSolutions = taskSolutions.filter(solution => - solution.created_by === this.props.homeworks.profiles[i].id); + this.props.homeworks.profiles.forEach((profile) => { + const profileSolutions = taskSolutions.filter(solution => + solution.created_by === profile.id); - if (this.props.homeworks.profiles[i].role === 'Student') { - if (profileSolutions.length === 0) { - noSubmitStudents.push(this.props.homeworks.profiles[i]); - } else if (taskSolutions[taskSolutions.length - 1].corrected === false) { - waitForCorrectionStudents.push(this.props.homeworks.profiles[i]); - } else if (taskSolutions[taskSolutions.length - 1].accepted === false) { - noAcceptStudents.push(this.props.homeworks.profiles[i]); - } else { - acceptedStudents.push(this.props.homeworks.profiles[i]); - } - } - } + if (profile.role === 'Student') { + if (profileSolutions.length === 0) { + noSubmitStudents.push(profile); + } else if (profileSolutions[profileSolutions.length - 1].corrected === false) { + waitForCorrectionStudents.push(profile); + } else if (profileSolutions[profileSolutions.length - 1].accepted === false) { + noAcceptStudents.push(profile); + } else { + acceptedStudents.push(profile); + } + } + }); const emptyStudentText = 'Nincs ilyen kĂŠpzĹdĹ jelenleg.';