CSC/ECE 517 Spring 2023 - E2348 Replicate Roles and Institution UIs ReactJS: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
|Redefined <code>self.get</code> method and added two new methods <code>self.get_assignment_query_conditions</code> and <code>self.get_assignments_managed_by_user</code>.
|Redefined <code>self.get</code> method and added two new methods <code>self.get_assignment_query_conditions</code> and <code>self.get_assignments_managed_by_user</code>.
|The <code>self.get</code> method calls these two methods and creates the database query for getting the assignments. Creating two extra methods and calling them from <code>self.get</code> makes the code readable and uniform among all the files.  
|The <code>self.get</code> method calls these two methods and creates the database query for getting the assignments. Creating two extra methods and calling them from <code>self.get</code> makes the code readable and uniform among all the files.  
|-
|2
|<code>self.get_assignment_query_conditions</code> has all the conditions needed for the database query.
|It makes it easy to list all the query conditions at one place rather than in one method.
|-
|3
|<code>self.get_assignments_managed_by_user</code> manages all the user permissions with various conditions.
|It is better to maintain all the rights and accesses at one place rather than in the same method as <code>self.get</code>.
|-
|4
|Renamed the methods <code>get_max_team_size</code>, <code>get_is_intelligent</code>, <code>get_require_quiz</code>, <code>get_allow_suggestions</code> to <code>get_max_assignment_team_size</code>, <code>get_assignment_is_intelligent</code>, <code>get_assignment_require_quiz</code> <code>get_assignment_allow_suggestions</code>.
|Adding the word assignment to the methods name makes the methods more informative and adds meaning.
|-
|5
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
=== Changes to <code>app/controllers/tree_display_controller.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Renamed the methods that were renamed in <code>assignment_node.rb</code> above
|The methods tha renamed in <code>assignment_node.rb</code> have to be the same in controller so that when they are called, it does not give an error.
|}
=== Changes to <code>app/models/course_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Renamed the method <code>get_survey_distribution_id</code> to <code>get_course_survey_distribution_id</code>.
|Adding the word course to the method name makes the method more informative and adds meaning to survey distribution id.
|-
|2
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|-
|3
|Added a method named - course_is_private?
|Currently the courses are categorized as private or not private. In future there can be a use case where true or false needs to be returned depending on whether the course is private or not. This has been handled by the course_is_private? method which is commented now and can be uncommented when required.
|}
=== Changes to <code>app/models/folder_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Renamed the method <code>get_child_type</code> to <code>get_folder_child_type</code>.
|Adding the word folder to the method name makes the method more informative and adds meaning to the child type of the folder.
|-
|2
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
=== Changes to <code>app/models/node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Changed the method name from <code>get_child_type</code> to <code>get_folder_child_type</code>
|The method name was changed in the <code>folder_node.rb</code>. Since <code>node.rb</code> is its super class, the method name in it also has to be the same
|}
=== Changes to <code>app/models/questionnaire_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Redefined <code>self.get</code> method and added two new methods <code>self.get_questionnaire_query_conditions</code> and <code>self.get_questionnaires_managed_by_user</code>.
|The <code>self.get</code> method calls these two methods and creates the database query for getting the assignments. Creating two extra methods and calling them from <code>self.get</code> makes the code readable and uniform among all the files.
|-
|2
|<code>self.get_questionnaire_query_conditions</code> has all the conditions needed for the database query.
|It makes it easy to list all the query conditions at one place rather than in one method.
|-
|3
|<code>self.get_questionnaires_managed_by_user</code> manages all the user permissions with various conditions.
|It is better to maintain all the rights and accesses at one place rather than in the same method as <code>self.get</code>.
|-
|4
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
=== Changes to <code>app/models/questionnaire_type_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
=== Changes to <code>app/models/team_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
=== Changes to <code>app/models/team_user_node.rb</code> ===
{| class="wikitable" style="width: 100%;
! &nbsp;#&nbsp; !! Change !! Why?
|-
|1
|Added appropriate comments for all the methods of the file.
|Understanding the need of the method: A well-written comment makes it clear about what that method is supposed to do.
Code readability: Comments help to break up large blocks of code and make it easier to understand what is happening in each section.
Maintenance and updates: When the developer re-visits the code that was written months or years ago, it can be difficult to remember how each method works.
Team Work: While working with a team, comments to methods can help other coders understand your code and can facilitate collaboration.
|}
|}



Revision as of 21:00, 6 April 2023

Overview of Expertiza

Expertiza is a learning management system that is developed with Ruby on Rails and is accessible as open source software. It can create assignments, tests, assignment teams, and courses, among a wide range of other features and functions. It also has a thorough system for giving other teams and groups of teammates peer reviews and feedback. The files that are largely addressed in this project, such as assignment_node.rb, course_node.rb, team_node.rb, folder_node.rb, and questionnaire_node.rb, are essential in executing this functionality.

Description of Project

Files Modified

Changes to app/models/assignment_node.rb

 #  Change Why?
1 Redefined self.get method and added two new methods self.get_assignment_query_conditions and self.get_assignments_managed_by_user. The self.get method calls these two methods and creates the database query for getting the assignments. Creating two extra methods and calling them from self.get makes the code readable and uniform among all the files.

Changes to spec/models/course_node_spec.rb

 #  Change Why?
1 Changed the method name from get_survey_distribution_id to get_course_survey_distribution_id in the test case where it is used Any changes made to the name of methods in the files should also be reflected in the test cases for them to pass successfully. If a method name is changed in a file and the same is not updated in the test case, the test case will fail

Testing

Testing was not in the scope for this project as it did not involve creating new methods or functions. However, care was taken that the existing test cases pass after refactoring the code as mentioned in the previous sections. Screenshots for all passing test cases have been attached below


Test Plan - Manual/System Test Cases

We ran a few system tests manually to make sure the functionality works as expected.

1) Test instructor login & redirect to home page

Login page was displayed properly from our branch. After logging in user is properly redirected to the home page.

Page shown to the user after logging in to expertiza
Page shown to the user after logging in to expertiza

2) Test Course Section

Then, when the user clicks the course section, the course section is loaded with all the public and private courses displayed.

3) Test Assignment section

Then, when the user clicks the assignment section, the assignment section is loaded with all the assignments displayed.

4) Test Questionnaire section

Then, when the user clicks the questionnaire section, the questionnaire section is loaded with all the questionnaires displayed.

Automated Testing of course_node.rb

After refactoring the code for course_node.rb, all the test cases passed for it.

Automated Testing of questionnaire_node.rb

After refactoring the code for questionnaire_node.rb, all the test cases passed for it.

Automated Testing of team_node.rb

After refactoring the code for team_node.rb, all the test cases passed for it.

Relevant Links

Credentials

Username: instructor6

Password: password

Contributors to this project

  • Palash Rathod (unityid: prathod, github: palash27)
  • Neha Kale (unityid: nkale2, github: nehakale8)
  • Vansh Mehta (unityid: vpmehta2, github: vanshmehta-7)