Skip to content
Snippets Groups Projects
Commit 0def3c77 authored by Chif Gergő's avatar Chif Gergő
Browse files

Fix wrong method to select accepted homeworks

parent f02aec1d
No related branches found
No related tags found
No related merge requests found
......@@ -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.';
......
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