CSC/ECE 517 Fall 2021 - E2128. Refactor student quizzes controller.rb & late policies controller.rb
This wiki page is for the description of changes made under E2128 OSS assignment for Fall 2021, CSC/ECE 517.
Introduction
Expertiza is a web application developed using Ruby on Rails that serves as a peer-review system. The application allows students to submit and peer-review learning objects (articles, code, websites, etc)Expertiza on GitHub Expertiza Wiki Page. It is an open-source project and its codebase is maintained on GitHub. We are contributing to Expertiza as a part of our Object-Oriented Design and Development's Open-Source Software (OSS) Project. Our goal in this project is to refactor the StudentQuiz controller and LatePolicies Controller. In this Wiki Page, we would be explaining the changes that we have made for the same.
Modifications made to student_quizzes_controller
Line 24
Updated the query from .first to .last as we want to get the latest score and not the first score, in the case a team/student submitted the quiz multiple times.
Method : finished_quiz
Before Refactoring
@response = Response.where(map_id: params[:map_id]).first
After Refactoring
@response = Response.where(map_id: params[:map_id]).last # Get the last score if a student took a quiz multiple times
Line 110
< Add description here >
Method : record_response
Before Refactoring
flash[:error] = "You have already taken this quiz, below are the records for your responses."
After Refactoring
flash[:error] = "You have already taken this quiz. Please find your previous submission below."
Line 98
< Add description here >
Method : calculate_score
After Refactoring
# Saves the response by the student only if the student has not taken the quiz before.
Line 34
< Add description here >
Method : self.take_quiz
Before Refactoring
# Create an array of candidate quizzes for current reviewer
After Refactoring
# Returns an array of candidate quizzes for current reviewer
Line 23
< Add description here >
Method : finished_quiz
After Refactoring
# Gets the last submission for a quiz by a student
Line 119
< Add description here >
Method : review_questions
Before Refactoring
# This method is only for quiz questionnaires, it is called when instructors click "view quiz questions" on the pop-up panel.
After Refactoring
# Gets all the questionnaire responses by all the teams for a particular assignment
Line 53-96
< Add description here >
Line 108
< Add description here >
Modifications made to late_policies_controller
Issue 1
< Add description here >
Issue 2
< Add description here >
Issue 3
< Add description here >