CSC/ECE 517 Fall 2019 - E1968. Fixes for adding members to teams: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 32: Line 32:
2. The reason for the second problem was that before we used t.assignment.course.instructor_id, we had to confirm that t.assignment.course was not equal to nil. If there existed an assignment without being subject to any course, when this assignment was assigned to a specific student, it would raise an error when it came to showing the tasks of the student. Thus, in order to show student tasks correctly, we changed the code to at first checking whether the t.assignment.course was nil. If t.assignment was not nil, we could use t.assignment.course.instructor_id to retrieve data needed from the database, otherwise, we used t.assignment.instructor_id directly to retrieve data needed.  
2. The reason for the second problem was that before we used t.assignment.course.instructor_id, we had to confirm that t.assignment.course was not equal to nil. If there existed an assignment without being subject to any course, when this assignment was assigned to a specific student, it would raise an error when it came to showing the tasks of the student. Thus, in order to show student tasks correctly, we changed the code to at first checking whether the t.assignment.course was nil. If t.assignment was not nil, we could use t.assignment.course.instructor_id to retrieve data needed from the database, otherwise, we used t.assignment.instructor_id directly to retrieve data needed.  
<br/>[[File:problem2.jpg]]<br/>
<br/>[[File:problem2.jpg]]<br/>
4. TODO<br/>
3. TODO<br/>


== Testing Details==
== Testing Details==

Revision as of 23:00, 27 October 2019

This wiki page is for the description of changes made under E1968 OSS assignment for Fall 2019, CSC/ECE 517.

Background

This project fixed several bugs related to Assignment teams. Expertiza has Assignment objects, which represent an assignment usually assigned by an in structor for a course. If the instructor allowe teams for the assignment, the participants in that course can create teams with each other. Also, the instructor can create teams or add team membert to a exsiting team. Our project is focused on fixing bugs related to these functionalities.

Problem Description

In this project we fixed three problems, the problems and the way to reproduce them is shown below.
1. Adding a member from the UI (typing the ID into the textbox) raises an error.

   Reproduciton:
   (1)Login as an instructor.
   (2)Go to Assignment tab under Manage.
   (3)Click any assignment for example : OSS project & documentation.
   (4)Select Create Teams.
   (5)Select Add Team Member option for any team. 
   (6)Adding a member from the UI (typing the ID into the textbox) raises an error.

2. Impersonating a student who has an assignment without affiliating to any course will cause an error.

   (1)Login as an instructor.
   (2)Go to the Assignment tab under Manage.
   (3)Click the "+" button and then create a new assignment named "E1968" without choosing any course from the course dropdown menu.
   (4)Go back to the Assignment tab under Manage, and click the "Add participants" of the assignment of "E1968".
   (5)Fill in the form "Enter a user login" with a student's name, for instance, "student7515".
   (6)Go to the Impersonate User tab under Manage, fill in the form "Enter  user account" with the student "student7515".
   (7)Clicking the button "Impersonate" raises an error.

3. TODO

Solutions

1. The reason for the first problem was actually due to a key error. In teams_users_controller.rb line 35, 'assignment_id' was used to find AssignmentParticipant. But in the model of AssignmentParticipant, the foreign key name is acctually 'parent_id'. So, by changing it, problem solved.
2. The reason for the second problem was that before we used t.assignment.course.instructor_id, we had to confirm that t.assignment.course was not equal to nil. If there existed an assignment without being subject to any course, when this assignment was assigned to a specific student, it would raise an error when it came to showing the tasks of the student. Thus, in order to show student tasks correctly, we changed the code to at first checking whether the t.assignment.course was nil. If t.assignment was not nil, we could use t.assignment.course.instructor_id to retrieve data needed from the database, otherwise, we used t.assignment.instructor_id directly to retrieve data needed.

3. TODO

Testing Details

RSpec

For each of the problems, we did feature tests with Rspec. They all follows the reproduction steps decribed above.

Feature Testing

  • Problem 1: assignment_team_member_spec.rb

Following steps needs to be performed to test this code:
1. Login as instructor.
2. Create a course and an assignment under that course.
2. Add at least two students as participants to the assignment.
3. Create a team for the assignment.
4. Add a participant to the team.
5. Check if the student is a team member of that team.

  • Problem 2 TODO
  • Problem 3 TODO

Run the test locally: TODO: the snapshot of console result of all test.