CSC/ECE 517 Fall 2021 - E2147. Role-based reviewing

From Expertiza_Wiki
Revision as of 22:01, 20 October 2021 by Krschulz (talk | contribs) (→‎RSPEC)
Jump to navigation Jump to search

E2147. Role-based reviewing

This page provides a description of the Expertiza based OSS project.



About Expertiza


Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation.

Problem Statement


In various agile methodologies, such as Scrum, different team members take on different roles, such as architect, facilitator, and implementer. One might want to use a different rubric for evaluating the contribution of members with different roles. Thus, this would not be separate from teammate review, but it would be a specialization of teammate review.

The following tasks were accomplished in this project:

  • Created a new database table, model, view, and controller for duties.
  • Allow assignments to be marked for role-based reviewing.
  • Certain users can add and edit roles for assignments.

Due to naming issues all of the backend components for role-based reviewing are known as duty or duties. When referring to the backend this documentation will refer to them as duty or duties and when referring to frontend components they will be called role or roles.

About Current Reviewing


Currently reviewing does not allow students to have different rubrics for an assignment based on their role in the team.

Solutions Implemented and Delivered


Below we have listed the solutions that we implemented, why we did certain design decisions, and explanations on how they were implemented.

Created a new database table, model, view, and controller for duties.


Database

We created a new duty table using scaffolding. In the database, each duty entry has an assignment_id, a max_duty_limit, and a duty_name.

  • The assignment_id is the id of the assignment to which this duty belongs to.
  • The max_duty_limit field is an integer and is the maximum number of students who are allowed to have a specific duty (e.g. 1 scrum master but 5 developers are allowed).
  • The duty_name is the name of the duty and will be displayed as Role name on the frontend.

Model

The model for duty is simple and simply marks a duty as belonging to assignment:

class Duty < ActiveRecord::Base
  belongs_to :assignment
end

Views

There were quite a few new views added for the implementation, they will simply be mentioned in this section and then explained in the corresponding solution description.

The new views were:

  • actions
  • add_duties
  • add_duty
  • checkbox
  • duty
  • table_header
  • table_line
  • edit
  • new


Controller

We created a new duties controller which allows for creation, editing, and deletion of duties from an assignment. The controller has a check to see if the current user is authorized to make the request.

Allow assignments to be marked for role-based reviewing.


Under the Review Strategy Tab of an assignment a checkbox was added that when clicked marks the assignment as role-based reviewing and displays an interface for adding, editing, and deleting roles.

In the Review Strategy Tab under the self review checkbox we added a render call to the checkbox view:

<% if current_page?(action: 'edit') %>
    <!--E2147 Duty Based Reviewing-->
    <tr>
      <td id='is_duty_based_assignment'>
        <input name="assignment_form[assignment][is_duty_based_assignment]" type="hidden" value="false"/>
        <%= check_box_tag('assignment_form[assignment][is_duty_based_assignment]', 'true', @assignment_form.assignment.is_duty_based_assignment, {:id => "is_duty_checkbox", :onChange => 'hasDutiesChanged()'}) %>
        <%= label_tag('duty_assignment', 'Is Role-Based Reviewing?') %>
        <img src="/assets/info.png" title='Check the box if this assignment allows role assignments within the team'>

        <div id="add_duties" <%= "hidden" if not @assignment_form.assignment.is_duty_based_assignment %> >
          <br>

          <%= render '/duties/add_duties' %>
        </div>
      </td>
    </tr>
<% end %>

The checkbox view checks if the current page is being edited rather than created since duties rely on an assignment existing to link via id. This functionality is similar to how topics are added to the assignment.

If the checkbox is checked and saved the assignment will be marked as a role-based reviewing assignment via the database column is_duty_based_assignment in the assignment table. When the checkbox is checked the add_duties view is rendered and displayed as well. When unchecked the view is hidden and the is_duty_based_assignment is marked as false when saved.

If the assignment has no duties in the backend the add_duties view will display a note with the text "Roles have not yet been created.".

If there are duties linked to the currently edited assignment then the view will render a table header from the table_header view and a line for each duty from the table_line view. At the end of this view, the add_duty partial view is rendered.

The table_header view displays a table header with three items. Role name, Maximum member limit, and Actions, each with respective widths of 45%, 45%, and 10%.

The table_line view crafts a table row based on the duty that was passed to it. The first column is the duty's duty_name with a link to the editing page for the duty if clicked. The next column is the duty's max_duty_limit, and the final column is a list of actions for the current duty which is rendered using the actions view.

The actions view displays two linked images, these are named "Edit Role" and "Delete Role", and are linked to their respective actions. The icons used for these actions are in line with other parts of expertiza for the actions that they represent.

The add_duty view is a link to the new view and is labelled "New role".

When clicked the user is directed to the new duty view:

Selecting back or create link back to the original assignment and upon successful creation there is a notification stating "Role was successfully created.".

Certain users can add and edit roles for assignments.


Users with TA privileges are able to add a role (added as duty to backend for clarity) to an assignment.

An authorized user can select the edit role icon or the name of a duty on the Review Strategy tab and will be redirected to a form (duty view) that is auto populated by the edit view for the duty they are attempting to edit:

After successfully updating the duty the user is redirected back to the assignment edit page and get a notification of the change:

An authorized user can also delete an existing duty, after deletion they will get another notification:

Testing


RSPEC


Since duties_controller was a brand new file we created a new spec files "duties_controller_spec.rb" which covers creation, editing, and deletion of duties in the system. To run this file use the following command while in the top level of the expertiza directory:

rspec ./spec/controllers/duties_controller_spec.rb 

UI


The following steps need to be performed to test this code from the UI:

1. Login as an instructor. Create a course and an assignment or navigate to an existing course with assignments.

2. Mark the assignment as a team assignment and navigate to the Review Strategy tab.

3. Check the Is Role-Based Reviewing checkbox and save the assignment.

4. Click New Role and fill out the information for creating a new duty.

5. Save and exit the assignment.

6. Login as a student and attempt to apply to the duty.

To test editing of a duty:

1. Login as an instructor. Create a course and an assignment or navigate to an existing course with assignments.

2. Mark the assignment as a team assignment and navigate to the Review Strategy tab.

3. Check the Is Role-Based Reviewing checkbox and save the assignment.

4. Click New Role and fill out the information for creating a new duty.

5. Click create and navigate to the Review Strategy tab again.

6. Click either the edit icon or the duty name listed under Role name.

7. Edit the duty, press Update and navigate to the Review Strategy tab again.

To test deleting of a duty:

1. Login as an instructor. Create a course and an assignment or navigate to an existing course with assignments.

2. Mark the assignment as a team assignment and navigate to the Review Strategy tab.

3. Check the Is Role-Based Reviewing checkbox and save the assignment.

4. Click New Role and fill out the information for creating a new duty.

5. Click create and navigate to the Review Strategy tab again.

6. Click either the delete icon.

Scope for Future Improvement


1. If a duty's maximum member limit is changed to be below the current number of students who are assigned to that duty nothing happens. We feel that a good future improvement would be to notify the students of the change and require them to select which students are dropped from the duty.

2. We believe that the checkbox for role-based reviewing can be moved to the general tab and only be displayed when the assignment is team based. This is due to dole-based reviewing being only available when an assignment is team based.

3. We believe that a possible future improvement would be to allow a user to import duties and their corresponding rubrics into other assignments.

References


  1. Expertiza on GitHub