CSC/ECE 517 Spring 2018- Project E1818: Role-based reviewing
Introduction
Problem Statement
The project is created to enable role-based team-mate reviews. These roles can be better named as duties, corresponding to the duty of a team member in a particular project. Borrowing from different Agile methodologies like SCRUM, each team member has a particular role for example: architect,facilitator and implementer.A much more meaningful review can be done if the review rubric was duty-specific. Currently, there is a generic teammate review rubric for all assignments. This means that some review questions are not applicable for all team members. For instance, if there is a question “What percentage of the code was written by this member?” This may not be applicable for the team member who wrote tests or documentation.Similarly, design document specific questions may not be applicable to other members.The instructor should be able to use a different team-mate review rubrics for evaluating the contribution of students depending on their duty.
UML Diagram
In a UML Class diagram, The relationships depicted above are as follows:
- Between the User and Duty class, there is a bidirectional association. The user table is used for both the instructor and the student.
- Each instructor can have multiple roles that he can choose from for a particular assignment/questionnaire.
- Each student can have 0 or 1 role for a particular project.
- For each Questionnaire instance, there are one or more Questions that can be stored, hence there is an aggregation relationship from Question to Questionnaire. This is for the grading rubric based on the role.
- The Question table and the Questionnaire table each will be using the the duty ID to sort out questions for a particular assignment.
Implementation
The project introduces changes from the instructor view and the student view. The changes are as follow:
Migration changes
- . Create Duties table: This table stores all the duties created by any instructor.
* id - The duty ID will be used by other tables like the questionnaire table and hence will be the primary key. * assignment_id - An assignment has particular duties. Thus, the assignment number will be the foreign key for the Duties table. * instructor_id - The Duties created by one Instructor should be visible and reusable by that instructor only. Thus, the instructor id will also be a foreign key in the Duties table.
- Create assignments_duty_mappings table: If an instructor wants to add multiple duties for an assignment, storing it in the duty table will cause the duty to be overwritten. Thus we have created a table which maps an assignment and all its duties.
* id * assignment_id * duty_id
- Create assignment_duty_questionnaire_mappings table : This table is created to store the questionnaire for team-mate review rubrics and the corresponding duty id.
* id * assignment_id * duty_id * questionnaire_id
- Added a column entry named "role_based_assignment" in the assignments table which would be of type boolean. This field saves the status of the role based review check box.
- Added a column entry named "allow_multiple_duties" in the assignments table which would be of type boolean. This field saves the status of the check box for allowing multiple students with the same role.
- Added a column entry named "Duties" to the Users table of type string. This field saves the duty that a student would select if role based reviews are enabled.
Instructor view changes
- For a particular assignment, in the 'Review Strategy' tab of edit assignment, a check box called "Allow role based review?" is created. This allows an instructor to enable a role based team-mate review for a particular assignment.
- When the check box is ticked, the hidden fields become visible. This includes the duties that have been already added, displayed in a drop-down. Also, a button "New duty" pops up. This takes us to the create method of Duties controller where an instructor can add new duties.
- In order to display the hidden fields, We call the java script function dutiesAssign() using the ischecked listener. The function queries the checkbox variable for role_based_review and depending its value(true or false), the hidden attributes i.e. allow_multiple_duties and duties_dropdown are displayed or kept hidden.
- The instructor can select from the dropdown of duties. We have allowed multiple duties to be selected at once.The duties created by an instructor are unique for that instructor and are not displayed for any other instructor.
- An instructor can decide the number of duties for a particular assignment. We have included a field for Allow multiple duties but not used it as we have the default case that one duty can be taken by multiple students. Work can be done in the future to allow the instructor to choose if students can take multiple duties.
- When the assignment is saved, the duty_id is saved to the assignment_duty_mappings table and thus it is associated with that assignment.
- The instructor can create Team-mate review Questionnaires for the different duties he created or can use any from the existing list of questionnaires.
- In order to do this, the instructor has to go to the Rubrics tab of edit assignment. There, if the assignment is role-based, a drop down menu displays the list of all the duties selected for an assignment.
- When the assignment is saved, the questionnaire_id is stored in the assignment_duty_questionnaire_mappings table. This is later used while displaying team-mate review questionnaire to students.
Student view changes
- When a student goes to “Your team”, they can see the team members, their selected duties and the option to review if these are enabled. Students will either see "Review" link to start the teammate review or a message that says that "Teammate has not selected a duty."
- The student can select their duty from a particular set of duties created by the instructor for that particular assignment. Upon clicking "Select" option in the Duty column, they are redirected to a new page where all the duties appear as radio-buttons and the student can select one of these. This occurs only if role based reviewing is permitted for that particular assignment. If not, the existing view will be displayed which does not give any such option.
- The logic for this is implemented in the 'student_teams' controller and view. This is enclosed in a conditional which only appears if role based reviewing is permitted.
- A student can only select one duty.
- A team member cannot change their role after the assignment submission deadline.
- When a student selects a particular duty , it is stored in the database table of that user. Thus when a team-mate reviews that student , they will see a questionnaire corresponding to the duty of that student. This would enable reviews of the teammates to be accurate and specific to their role in a project.
- After the teammate review questionnaire is opened once, 'View' and 'Edit' links are shown which redirect the user to view/edit the appropriate last saved response.
Files to be modified
New files
Some of the new migration files we have created are
- db/migrate/add_duties_table.rb
In this file, a duties table is created with a name field
- db/migrate/add_reference_of_instructor_and_assignment_to_duties.rb
In this file, we have adding foreign key reference of assignment id into duties table.
- db/migrate/add_duties_to_users.rb
In this file, a column named duties is added to the Users table
- db/migrate/add_multiple_duties_to_assignments.rb
In this file, we have added a column allow_multiple_duties to assignments table
- db/migrate/create_assignment_duty_questionnaire_mapping.rb
In this file, we have created assignment_duty_questionnaire_mappings table and added columns for questionnaire_id, assignment_id and duty_id
Files that have to be modified
- app/views/assignments/edit/review_strategy.html.erb
In this file, a checkbox is added to permit role based review.
A hidden checkbox is added to allow multiple students to have the same role and hidden fields for adding duties along with a dropdown box for selecting from existing duties.
<input name="assignment_form[assignment][role_based_review]" type="hidden" value="false"/> <%= check_box_tag('assignment_form[assignment][role_based_review]', 'true' , @assignment_form.assignment.role_based_review, {:onClick => 'dutiesAssign()'}) %> <%= label_tag('assignment_form[assignment][role_based_review]', 'Allow Role based Reviews?') %> <%duties_list=[]%> <% duties_list=@assignment_form.assignment_duties if(@assignment_form.assignment_duties.any?) %> <%flag_rolebased=@assignment_form.assignment.role_based_review==false%> <span id="duties_dropdown" <%='hidden' if (flag_rolebased) %> > <%= label_tag('assignment_form[assignment][duty_id]', ' Select Duties ') %> <%= select('assignment_form[assignment_duties]', 'duty_id', duty_index(@assignment_form.assignment.instructor_id).select {|p| !duties_list.include? p.id }.collect{|p| [p.name, p.id]},{}, {:multiple => true, :include_blank => 'None'}) %> <span id="duties_assigned" <%='hidden' if (flag_rolebased) %> > <%= link_to('Add Duty',new_duty_path(:instructor_id => @assignment_form.assignment.instructor_id,:assignment_id => @assignment_form.assignment)) %>
<td id="assignment_allow_multiple_duties" <%='hidden' if (flag_rolebased) %>> <%= check_box_tag('assignment_form[assignment][allow_multiple_duties]', 'false' , @assignment_form.assignment.allow_multiple_duties ) %> <%= label_tag('assignment_form[assignment][allow_multiple_duties]', 'Allow multiple team-members to have same duty?') %> A java script function is added which removes the hidden attributes from for the above stated entries once the checkbox is selected. function dutiesAssign() { var checkbox = jQuery('#assignment_form_assignment_role_based_review'); var duties_assigned = jQuery('#duties_assigned'); var assignment_allow_multiple_duties =jQuery('#assignment_allow_multiple_duties'); var duties_dropdown= jQuery('#duties_dropdown'); if (checkbox.is(':checked')) { duties_assigned.removeAttr('hidden'); assignment_allow_multiple_duties.removeAttr('hidden') duties_dropdown.removeAttr('hidden') jQuery('#assignment_form.assignment.role_based_review').val(true); } else { duties_assigned.attr('hidden', true); assignment_allow_multiple_duties.attr('hidden',true) duties_dropdown.attr('hidden',true) jQuery('#assignment_form.assignment.role_based_review').val(false); } }
- app/views/assignments/edit/rubrics.html.erb
In this file , a conditional statement is added, which displays the dropdown for selecting duties and a dropdown for selecting a teammate review for the selected duties if role based reviewing is permitted or else display the standard view. if (round_no ==null && role_based_review == false) { html += '<label for="questionnaire_id">' + questionnaire.display_type + ':</label>';
} else if (round_no == null & role_based_review == true) {
html += '<label for="questionnaire_id">' + questionnaire.display_type + ':</label>';
} //Rubric options if (questionnaire_type == 'TeammateReviewQuestionnaire' && role_based_review == true) {
html += '' +
'<select id="duty_id" name="assignment_form[assignment_duty_questionnaire][duty_id]" style="width:300px">' + '<option value="">Please Select a duty</option>'; for (j = 0; j<duty_names.length ; j++) { html += '<option value="' + duty_names[j][1] + '">' + duty_names[j][0] + '</option>'; } html += '</select>'; html += '<select id="questionnaire_id" name="assignment_form[assignment_questionnaire][][questionnaire_id]" style="width:300px">' + '<option value="">--None--</option>'; for (i = 0; i < questionnaire_options.length; i++) { html += '<option value="' + questionnaire_options[i][1] + '">' + questionnaire_options[i][0] + '</option>'; }
html += '</select>'; } function saveQuestionnaireId(assignment_id){ var dropdown1 = jQuery('#duty_id'); var dropdown2 = jQuery('#questionnaire_id'); saveQuestionnaireIdtoAssignmentDutyMappings(dropdown1,dropdown2,assignment_id); }
- app/controllers/student_teams/student_teams_controller.rb
In this file, a variable is set that extracts from Assignments table if the role based reviewing is enabled or not. This variable is then used as a condition to display the various duties available for selection and also to display the particular duty chosen by the student.
- app/views/student_teams/view.html.erb
In this file, a conditional statement is added which redirects to a new page and displays the radio buttons of all the available duties if role based reviewing is allowed. If not, the standard view is displayed.
- app/controllers/response_controller.rb
In this file, the new_feedback function will be edited to map the team-mate review questionnaires according to the duties created.
- app/questionnaire/new.html.erb
A new questionnaire will be created for each new duty created or the same questionnaire can be used.
- app/questionnaire/edit.html.erb
A newly created questionnaire for a particular duty can be edited.
- app/views/duties/_form.html.erb
In this file we are creating a new duty and saving the assignment id and instructor id to the
<%= form_for @duty do |form| %>
<%= form.label :name%> <%= form.text_field :name ,id: :name %> <%= form.hidden_field :instructor_id, id: :instructor_id, :value => params[:instructor_id].to_i %> <%= form.hidden_field :assignment_id, id: :assignment_id, :value => params[:assignment_id].to_i %>
<%= form.submit %>
<% end %>
Test Plan
- Instructor tests
- Check the box for role based reviewing.
- Display and select from already existing roles(duties) with option to create new roles(duties).
- Should not be able to see roles(duties) from other instructors.
- Select corresponding rubrics for a particular role(duty).
- If not, proceed with the default questions for the rubric for the assignment.
- Check the box for role based reviewing.
- Student(team member) tests
- Before submitting the project, all team members should select a role(duty) for themselves from the roles(duties) set by the instructor.
- Multiple students may have the role(duty) but 1 student cannot have multiple roles(duties).
- Reviewer tests
- For the teammate review, only the questions related to the role(duty) selected by the student should appear in the rubric.