CSC/ECE 517 Fall 2021 - E2128. Refactor student quizzes controller.rb & late policies controller.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
=== Line 24 ===
=== Line 24 ===
----
----
Updated the query from <b>.first</b> to  <b>.last</b> as we want to get the latest score and not the first score, in the case a team/student submitted the quiz multiple times. <br>
Updated the query from <b>.first</b> to  <b>.last</b> as we want to get the latest score and not the first score, in the case a team/student submitted the quiz multiple times.<br><br>
<br> Method : finished_quiz <br><br>
Method : finished_quiz <br><br>
<b>Before Refactoring</b>
<b>Before Refactoring</b>


Line 44: Line 44:
=== Line 98 ===
=== Line 98 ===
----
----
Added method comment to record response to describe its purpose. <br>
Added method comment to record response to describe its purpose.<br><br>
 
Method : record_response
Method : record_response


Line 58: Line 57:
=== Line 110 ===
=== Line 110 ===
----
----
Fixed the english of the flash message as the word records was ambiguous.<br>
Fixed the english of the flash message as the word records was ambiguous.<br><br>
<br> Method : record_response <br>
Method : record_response <br>
<b>Before Refactoring</b>
<b>Before Refactoring</b>


Line 70: Line 69:
=== Line 119 ===
=== Line 119 ===
----
----
Update the method comment to better describe <b>review_questions</b>. <br>
Update the method comment to better describe <b>review_questions</b>.<br><br>
 
Method : review_questions <br>
Method : review_questions <br>



Revision as of 02:32, 21 October 2021

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 23


Added a method comment to better describe the purpose of finished_quiz method.

Method : finished_quiz

After Refactoring

 # Gets the last submission for a quiz by a student 

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 34


Updated the method comment to better explain its purpose.

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 

Lines 53-96


As the method calculate_score has not yet been completed, skipping this issue, as directed by Professor Gehringer.

Line 98


Added method comment to record response to describe its purpose.

Method : record_response

After Refactoring

 # Saves the response by the student only if the student has not taken the quiz before. 

Line 108


As the method calculate_score has not yet been completed, skipping this issue, as directed by Professor Gehringer.

Line 110


Fixed the english of the flash message as the word records was ambiguous.

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 119


Update the method comment to better describe review_questions.

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 

Modifications made to late_policies_controller

Issue 1


< Add description here >

Issue 2


< Add description here >

Issue 3


< Add description here >