Method all() of HomeworkController tested and refactored (for student and teacher)