CSC/ECE 517 Fall 2020 - E2086. Let course staff as well as students do reviews

From Expertiza_Wiki
Jump to navigation Jump to search

Project Index

  • Deployment Link:
  http://152.7.98.249:8080/
  • Github Repository:
   https://github.com/MayoNaizz/expertiza
  • Github Pull Request:
   https://github.com/expertiza/expertiza/pull/1834
  • Youtube Video Link:
   https://youtu.be/FyBfWrdX5Dk

Project Background

  • Expertiza Project - E2086 : Let course staff as well as students do reviews

Why This Project

Peer review is a great way for students to learn about how well they have developed their application. However, sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development. By letting course staff perform reviews as well, the reviewer and the reviewee both benefit, improving the overall learning experience. Currently, there exists no method for the instructor/TA to perform reviews of assignments submitted by the students. Hence this is what this project aims at, allowing instructor/TA to perform reviews.

Primary Goal of this Project

This project aims to allow instructors to submit reviews of student work, using the same review form that students use to do reviews

Files Edited

Controller:

  app/controllers/response_controller.rb

Model:

  app/models/review_response_map.rb
  app/models/response_map.rb

View:

  app/views/student_review/_responses.html.erb
  app/views/shared/responses/_response_actions.html.erb
  app/views/grades/view_team.html.erb
  app/views/grades/_add_icon_to_name.html.erb
  app/views/assignments/list_submissions.html.erb
  app/views/assignments/_responses.html.erb

Project Team Member

  • Chenwei Zhou (czhou6)
  • Tianrui Wang (twang33)
  • Zhuolin Li(zli82)
  • Hao Zhang (hzhang62)

Project Design Philosophy

Our project aims at enabling the instructor/TA to review the submissions using the same form that a student uses while peer-reviewing. For this, our implementation has been divided into 3 parts, and can be described as follows:

  1. The first part involves the primary functionality of letting the staff perform a review on students submission.
  2. The second part involves allowing the students to identify from their end, which review has been performed by an instructor/TA. This will help students improve their project as the opinions presented by a staff member would be valid.
  3. Third, we plan to enable the instructor/TA to do review instead of assign grade in the review round. After the review Round, the review review session will be closed and replaced with assigning grade interface

Design Flowchart

  • Functions that were included

Issue

Plan of Work

  • In the assignment page of the Expertiza, If an instructor or a TA is a participant in an assignment, then the instructor should be able to review any team that has submitted the assignment.
  • In order to see who is participating in the assignment, click on the “Add participants” icon (the one with the + sign and a picture of a person). That will bring up a list of participants and allow you to add more participants.
  • Make the instructor and/or TAs participants, and then they should be allowed to do reviews.

  • Then, to perform reviews, the instructor/TA would click on the clipboard-like “View submissions” icon, as shown below.

  • A list of submissions would be pulled up:

  • If the last due date for the assignment has not passed, then the “Assign grade” link should be changed to “Perform review”, and when clicked on, it should pull up a review page for the team, showing their submitted work at the top, as a review page normally does.
  • We will add the review link in views/assignments/list_submissions.html.erb and once instructor/TA click that link. Controller response will be called. Once the get_current_stage() change to "Finished" it means the due day of the review round is over. The review link will be replaced by the grade link.
  • Also, it would be more clear if we could mark the instructor's review with something special on the reviews page, as shown below.
  • We will add an icon in views/grades/view_team.html.erb and app/views/response/view.html.erb if these review is made by instructor or TA.

This function will be implemented in helpers/grades_helper.rb

Test Plan

The basic idea of this project is to change the 'Assign Grade' link to 'Perform review' if the deadline of a assignment has not passed. Thus, to test the functionality of this part, we plan to test it at the frontend

Configuration

  1. Click 'Manage' -> 'Assignments' to go to assignment page.
  2. Add a new assignment for a course that the current account has registered. Make sure the due date of the assignment is after the the time to perform the review as an instructor.
  3. Click 'Add participants' icon in the new created assignment row, and 'Copy participants from course' to add all students registered to this course. Then add the current instructor account to this assignment through 'Enter a user login:' input space.
  4. Impersonate as one of the students to simulate the submission of work.

Perform review

  1. Click 'Manage' -> 'Assignments' to go to assignment page as instructor.
  2. Click 'View submission' icon in the new created assignment row. Now the 'Perform review' link show be under participants name if the due date has not passed.
  3. Click one of the 'Perform review' link to do the review for a certain submission by using the same templet of student peer review.
  4. Impersonate the student that was previously reviewed by instructor. Check score for the assignment, and the review from the instructor should be recognizable from other student reviews.

Refactor & Code Modification

Running Tests

  rspec spec/features/instructor_do_review_spec.rb

Rspec Test Cases

describe "check 'Begin review' showing up before due date and 'Assign grade' after due date" do
  let(:team) { build(:assignment_team, id: 1, name: 'team1') }

  it "Begin review" do
    instructor6 = create(:instructor)   #create instructor6
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course
    create(:deadline_type, name: "submission")
    create(:deadline_type, name: "review")
    create(:deadline_type, name: "team_formation")
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "submission").first, due_at: DateTime.now.in_time_zone .day)
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "review").first, due_at: DateTime.now.in_time_zone + 10.day)
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "team_formation").first, due_at: DateTime.now.in_time_zone .day)

    questionnaire1 = create(:questionnaire, name: "TestQuestionnaire1")
    create(:questionnaire, name: "TestQuestionnaire2")
    create(:question, txt: "Question1", questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)
    create(:question, txt: "Question2", questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)

    expect(assignment_test.instructor_id).to eql(instructor6.id)
    expect(assignment_test.course_id).to eql(nil)
    student_test = create(:student, name: "student6666", email: "stu6666@ncsu.edu") #create a student for test

    visit(root_path)
    fill_in('login_name', with: 'instructor6')
    fill_in('login_password', with: 'password')
    click_button('Sign in')
    expect(current_path).to eql("/tree_display/list")
    expect(page).to have_content('Manage content')


    visit("/participants/list?id=#{assignment_test.id}&model=Assignment")
    expect(page).to have_content("E2086")
    fill_in("user_name", match: :first, with: instructor6.name)
    click_button("Add", match: :first)
    expect(page).to have_content(instructor6.name)
    expect(page).to have_content(instructor6.email)
    click_button("Submit", match: :first)

    visit("/participants/list?id=#{assignment_test.id}&model=Assignment")
    expect(page).to have_content("E2086")
    fill_in("user_name", match: :first, with: student_test.name)
    click_button("Add", match: :first)
    expect(page).to have_content(student_test.name)
    expect(page).to have_content(student_test.email)

    user_id = User.find_by(name: 'student6666').id
    participant_student = Participant.where(user_id: user_id)
    participant_id = participant_student.first.id
    parent_id = participant_student.first.parent_id
    team_student = Team.where(parent_id: parent_id)
    team_user = create(:team_user, user_id: user_id)

    visit("/assignments/list_submissions?id=#{assignment_test.id}")
    expect(page).to have_content("student6666")
    expect(page).to have_content("https://www.expertiza.ncsu.edu")

    visit("/response/new?id=#{questionnaire1.id}&return=ta_review")
    expect(page).to have_content("E2086")

    fill_in "responses[0][comment]", with: "Excellent Work"
    click_button "Submit Review"
    expect(page).to have_content "Your response was successfully saved."


    visit("/assignments/list_submissions?id=#{assignment_test.id}")
    expect(page).to have_content("student6666")
    expect(page).to have_content("https://www.expertiza.ncsu.edu")

    visit('/impersonate/start')
    expect(page).to have_content("Enter user account")
    fill_in("user_name", with: student_test.name)
    click_button("Impersonate")
    expect(current_path).to eql("/student_task/list")
    expect(page).to have_content("User: #{student_test.name}")
    expect(page).to have_content("E2086")
    click_link("E2086")
  end

  it "Assign grade" do
    instructor6 = create(:instructor)   #create instructor6
    assignment_test = create(:assignment, name: 'E2086', course: nil) #create an assignment without course
    create(:deadline_type, name: "submission")
    create(:deadline_type, name: "review")
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "submission").first, due_at: DateTime.now.in_time_zone - 10.day)
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "review").first, due_at: DateTime.now.in_time_zone - 5.day)

    create(:questionnaire, name: "TestQuestionnaire1")
    create(:questionnaire, name: "TestQuestionnaire2")
    create(:question, txt: "Question1", questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first)
    create(:question, txt: "Question2", questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first)
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire1').first, used_in_round: 1)
    create(:assignment_questionnaire, questionnaire: ReviewQuestionnaire.where(name: 'TestQuestionnaire2').first, used_in_round: 2)

    expect(assignment_test.instructor_id).to eql(instructor6.id)
    expect(assignment_test.course_id).to eql(nil)
    student_test = create(:student, name: "student6666", email: "stu6666@ncsu.edu") #create a student for test

    visit(root_path)
    fill_in('login_name', with: 'instructor6')
    fill_in('login_password', with: 'password')
    click_button('Sign in')
    expect(current_path).to eql("/tree_display/list")
    expect(page).to have_content('Manage content')

    visit("/participants/list?id=#{assignment_test.id}&model=Assignment")
    expect(page).to have_content("E2086")
    fill_in("user_name", match: :first, with: instructor6.name)
    click_button("Add", match: :first)
    expect(page).to have_content(instructor6.name)
    expect(page).to have_content(instructor6.email)
    click_button("Submit", match: :first)

    visit("/participants/list?id=#{assignment_test.id}&model=Assignment")
    expect(page).to have_content("E2086")
    fill_in("user_name", match: :first, with: student_test.name)
    click_button("Add", match: :first)
    expect(page).to have_content(student_test.name)
    expect(page).to have_content(student_test.email)

    user_id = User.find_by(name: 'student6666').id
    participant_student = Participant.where(user_id: user_id)
    participant_id = participant_student.first.id
    parent_id = participant_student.first.parent_id
    team_student = Team.where(parent_id: parent_id)
    team_user = create(:team_user, user_id: user_id)

    visit("/assignments/list_submissions?id=#{assignment_test.id}")
    expect(page).to have_content("https://www.expertiza.ncsu.edu")
    expect(page).to have_link('Assign Grade', exact:true)

  end
end

Reference & Links

Previous Implementation

This project was done by Team E1985 on Fall 2019 with the following work:

Expertiza wiki: http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1985._Let_course_staff_and_students_do_reviews

Github Pull Request: https://github.com/expertiza/expertiza/pull/1631

Github repository: https://github.com/Matrawick/expertiza

Youtube screencast: https://youtu.be/kLfZ22vlu30

Comments From Mentor

  • Code for testing whether a reviewer is a staff member is put into an unrelated class (same method already exists elsewhere in system).
  • There is a long code clone because the process of creating a mapping and a review is not quite the same as when the reviewer is a non-instructor; a lot of checks needed in that case are not needed here. But the current code should have been refactored to put the common code into another method.
  • One test has been removed because it broke the build, & was evid. unrelated to their functionality.
  • The commit was too messy; if this had been merged, it would have required refactoring.

for more information about this project, please visit Project Lists