<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Demadewe</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Demadewe"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Demadewe"/>
	<updated>2026-05-16T06:11:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137238</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137238"/>
		<updated>2020-11-17T17:50:43Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Summary Report Page - Under progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/helpers/grades_helper.rb&lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/models/on_the_fly_calc.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/grades_helper.rb''&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; was created from the original code shared by both &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; in ''app/controllers/grades_controller'', but with the additional functionality of checking for Revision Plans in responses.  When &amp;lt;code&amp;gt;assignment.vary_by_round&amp;lt;/code&amp;gt;, an additional heatgrid is added for each round of Revision Planning.  When &amp;lt;code&amp;gt;!assignment.vary_by_round&amp;lt;/code&amp;gt;, only one heatgrid is added for the Revision Plan used in the most recent round of review.&lt;br /&gt;
&lt;br /&gt;
  def generate_heatgrid(participant, assignment, team, team_id, questionnaires, vmlist)&lt;br /&gt;
    counter_for_revisions = -1&lt;br /&gt;
    counter_for_same_rubric = 0&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
        questionnaires = AssignmentQuestionnaire.where(assignment_id: assignment.id, questionnaire_id: questionnaire.id)&lt;br /&gt;
        if questionnaires.count &amp;gt; 1&lt;br /&gt;
          @round = questionnaires[counter_for_same_rubric].used_in_round&lt;br /&gt;
          counter_for_same_rubric += 1&lt;br /&gt;
        else&lt;br /&gt;
          @round = questionnaires[0].used_in_round&lt;br /&gt;
          counter_for_same_rubric = 0&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, @round)&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; assignment.is_revision_planning_enabled?&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: counter_for_revisions).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
        counter_for_revisions += 1&lt;br /&gt;
      elsif assignment.is_revision_planning_enabled? &amp;amp;&amp;amp; questionnaire == questionnaires.last&lt;br /&gt;
        if assignment.get_current_stage == &amp;quot;Finished&amp;quot;&lt;br /&gt;
          current_round = assignment.rounds_of_reviews&lt;br /&gt;
        else&lt;br /&gt;
          reviewees_topic = SignedUpTeam.topic_id_by_team_id(participant.id)&lt;br /&gt;
          current_round = assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
        end&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;add_response_to_vmlist&amp;lt;/code&amp;gt; was added to refactor the code that is used multiple times to add another review to the view model.&lt;br /&gt;
&lt;br /&gt;
  def add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, round)&lt;br /&gt;
    vm = VmQuestionResponse.new(questionnaire, assignment, round)&lt;br /&gt;
    vmquestions = questionnaire.questions&lt;br /&gt;
    vm.add_questions(vmquestions)&lt;br /&gt;
    vm.add_team_members(team)&lt;br /&gt;
    vm.add_reviews(participant, team, assignment.vary_by_round)&lt;br /&gt;
    vm.number_of_comments_greater_than_10_words&lt;br /&gt;
    vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
*Refactored &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method in ''app/helpers/grades_helper.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; in ''app/helpers/grades_helper.rb'' and used in &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_team&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @questions = retrieve_questions questionnaires, @assignment.id&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/grades_helper.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method in ''app/controllers/grades_controller.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; and used in &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_heatgrid(participant_id, type)&lt;br /&gt;
    # get participant, team, questionnaires for assignment.&lt;br /&gt;
    @participant = AssignmentParticipant.find(participant_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    @type = type&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    render &amp;quot;grades/view_heatgrid.html.erb&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137235</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137235"/>
		<updated>2020-11-17T17:46:47Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/helpers/grades_helper.rb&lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/models/on_the_fly_calc.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/grades_helper.rb''&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; was created from the original code shared by both &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; in ''app/controllers/grades_controller'', but with the additional functionality of checking for Revision Plans in responses.  When &amp;lt;code&amp;gt;assignment.vary_by_round&amp;lt;/code&amp;gt;, an additional heatgrid is added for each round of Revision Planning.  When &amp;lt;code&amp;gt;!assignment.vary_by_round&amp;lt;/code&amp;gt;, only one heatgrid is added for the Revision Plan used in the most recent round of review.&lt;br /&gt;
&lt;br /&gt;
  def generate_heatgrid(participant, assignment, team, team_id, questionnaires, vmlist)&lt;br /&gt;
    counter_for_revisions = -1&lt;br /&gt;
    counter_for_same_rubric = 0&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
        questionnaires = AssignmentQuestionnaire.where(assignment_id: assignment.id, questionnaire_id: questionnaire.id)&lt;br /&gt;
        if questionnaires.count &amp;gt; 1&lt;br /&gt;
          @round = questionnaires[counter_for_same_rubric].used_in_round&lt;br /&gt;
          counter_for_same_rubric += 1&lt;br /&gt;
        else&lt;br /&gt;
          @round = questionnaires[0].used_in_round&lt;br /&gt;
          counter_for_same_rubric = 0&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, @round)&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; assignment.is_revision_planning_enabled?&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: counter_for_revisions).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
        counter_for_revisions += 1&lt;br /&gt;
      elsif assignment.is_revision_planning_enabled? &amp;amp;&amp;amp; questionnaire == questionnaires.last&lt;br /&gt;
        if assignment.get_current_stage == &amp;quot;Finished&amp;quot;&lt;br /&gt;
          current_round = assignment.rounds_of_reviews&lt;br /&gt;
        else&lt;br /&gt;
          reviewees_topic = SignedUpTeam.topic_id_by_team_id(participant.id)&lt;br /&gt;
          current_round = assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
        end&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;add_response_to_vmlist&amp;lt;/code&amp;gt; was added to refactor the code that is used multiple times to add another review to the view model.&lt;br /&gt;
&lt;br /&gt;
  def add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, round)&lt;br /&gt;
    vm = VmQuestionResponse.new(questionnaire, assignment, round)&lt;br /&gt;
    vmquestions = questionnaire.questions&lt;br /&gt;
    vm.add_questions(vmquestions)&lt;br /&gt;
    vm.add_team_members(team)&lt;br /&gt;
    vm.add_reviews(participant, team, assignment.vary_by_round)&lt;br /&gt;
    vm.number_of_comments_greater_than_10_words&lt;br /&gt;
    vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
*Refactored &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method in ''app/helpers/grades_helper.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; in ''app/helpers/grades_helper.rb'' and used in &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_team&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @questions = retrieve_questions questionnaires, @assignment.id&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/grades_helper.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method in ''app/controllers/grades_controller.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; and used in &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_heatgrid(participant_id, type)&lt;br /&gt;
    # get participant, team, questionnaires for assignment.&lt;br /&gt;
    @participant = AssignmentParticipant.find(participant_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    @type = type&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    render &amp;quot;grades/view_heatgrid.html.erb&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137234</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137234"/>
		<updated>2020-11-17T17:41:24Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/helpers/grades_helper.rb&lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/models/on_the_fly_calc.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method in ''app/helpers/grades_helper.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; in ''app/helpers/grades_helper.rb'' and used in &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_team&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @questions = retrieve_questions questionnaires, @assignment.id&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/grades_helper.rb''&lt;br /&gt;
&lt;br /&gt;
The code in the &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt; method was almost identical to the code in the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method in ''app/controllers/grades_controller.rb''.  It was refactored into a new method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; and used in &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  def view_heatgrid(participant_id, type)&lt;br /&gt;
    # get participant, team, questionnaires for assignment.&lt;br /&gt;
    @participant = AssignmentParticipant.find(participant_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
    @type = type&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
    generate_heatgrid(@participant, @assignment, @team, @team_id, questionnaires, @vmlist)&lt;br /&gt;
    render &amp;quot;grades/view_heatgrid.html.erb&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;generate_heatgrid&amp;lt;/code&amp;gt; was created from the original code in &amp;lt;code&amp;gt;view_heatgrid&amp;lt;/code&amp;gt;, but with the additional functionality of checking for Revision Plans in responses.  When &amp;lt;code&amp;gt;assignment.vary_by_round&amp;lt;/code&amp;gt;, an additional heatgrid is added for each round of Revision Planning.  When &amp;lt;code&amp;gt;!assignment.vary_by_round&amp;lt;/code&amp;gt;, only one heatgrid is added for the Revision Plan used in the most recent round of review.&lt;br /&gt;
&lt;br /&gt;
  def generate_heatgrid(participant, assignment, team, team_id, questionnaires, vmlist)&lt;br /&gt;
    counter_for_revisions = -1&lt;br /&gt;
    counter_for_same_rubric = 0&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
        questionnaires = AssignmentQuestionnaire.where(assignment_id: assignment.id, questionnaire_id: questionnaire.id)&lt;br /&gt;
        if questionnaires.count &amp;gt; 1&lt;br /&gt;
          @round = questionnaires[counter_for_same_rubric].used_in_round&lt;br /&gt;
          counter_for_same_rubric += 1&lt;br /&gt;
        else&lt;br /&gt;
          @round = questionnaires[0].used_in_round&lt;br /&gt;
          counter_for_same_rubric = 0&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, @round)&lt;br /&gt;
      if assignment.vary_by_round? &amp;amp;&amp;amp; assignment.is_revision_planning_enabled?&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: counter_for_revisions).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
        counter_for_revisions += 1&lt;br /&gt;
      elsif assignment.is_revision_planning_enabled? &amp;amp;&amp;amp; questionnaire == questionnaires.last&lt;br /&gt;
        if assignment.get_current_stage == &amp;quot;Finished&amp;quot;&lt;br /&gt;
          current_round = assignment.rounds_of_reviews&lt;br /&gt;
        else&lt;br /&gt;
          reviewees_topic = SignedUpTeam.topic_id_by_team_id(participant.id)&lt;br /&gt;
          current_round = assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
        end&lt;br /&gt;
        rp_questionnaire = RevisionPlanTeamMap.find_by(team: Team.find(team_id), used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
        if rp_questionnaire&lt;br /&gt;
          add_response_to_vmlist(participant, assignment, team, rp_questionnaire, vmlist, @round)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;code&amp;gt;add_response_to_vmlist&amp;lt;/code&amp;gt; was added to refactor the code that is used multiple times to add another review to the view model.&lt;br /&gt;
&lt;br /&gt;
  def add_response_to_vmlist(participant, assignment, team, questionnaire, vmlist, round)&lt;br /&gt;
    vm = VmQuestionResponse.new(questionnaire, assignment, round)&lt;br /&gt;
    vmquestions = questionnaire.questions&lt;br /&gt;
    vm.add_questions(vmquestions)&lt;br /&gt;
    vm.add_team_members(team)&lt;br /&gt;
    vm.add_reviews(participant, team, assignment.vary_by_round)&lt;br /&gt;
    vm.number_of_comments_greater_than_10_words&lt;br /&gt;
    vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137229</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137229"/>
		<updated>2020-11-17T17:28:38Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Files Modified - Under progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/helpers/grades_helper.rb&lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/models/on_the_fly_calc.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137211</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137211"/>
		<updated>2020-11-17T14:42:55Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Files Modified - Under progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/models/on_the_fly_calc.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137207</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137207"/>
		<updated>2020-11-17T07:14:54Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137206</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137206"/>
		<updated>2020-11-17T07:14:36Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ temporary deployment link]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 demo video]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137205</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137205"/>
		<updated>2020-11-17T07:14:03Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 Demo Video]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137204</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137204"/>
		<updated>2020-11-17T07:13:48Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;br /&gt;
# Demo: [https://youtu.be/7pdz_A8vDkk E2083 Demo Video&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137156</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137156"/>
		<updated>2020-11-17T02:59:15Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
'''Bug Fix:''' Reverted &amp;lt;code&amp;gt;get_sentences&amp;lt;/code&amp;gt; back to version in master branch to prevent Active Record Error caused by beta version of code.&lt;br /&gt;
&lt;br /&gt;
  def get_sentences(ans)&lt;br /&gt;
    unless ans.comments.nil?&lt;br /&gt;
      ans.comments.gsub!(/[.?!]/, '\1|')&lt;br /&gt;
      sentences = ans.comments.split('|')&lt;br /&gt;
      sentences.map!(&amp;amp;:strip)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if vm.questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or vm.questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Separated Review and Revision Plan questions in response&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
Created separate arrays for ReviewQuestionnaire questions and RevsionPlanQuestionnaire questions.  Added headings for Review Responses and Revision Plan Responses. &lt;br /&gt;
&lt;br /&gt;
  review_questions = []&lt;br /&gt;
  revision_plan_questions = []&lt;br /&gt;
  #begin table for Review Responses&lt;br /&gt;
  ...&lt;br /&gt;
  map = ResponseMap.find(self.map_id)&lt;br /&gt;
  unless map.is_a? ReviewResponseMap&lt;br /&gt;
    code = add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
  else&lt;br /&gt;
    assignment = map.assignment&lt;br /&gt;
    questions.each do |question|&lt;br /&gt;
      if(question.questionnaire.type == 'ReviewQuestionnaire')&lt;br /&gt;
        review_questions.append(question)&lt;br /&gt;
      elsif(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
        revision_plan_questions.append(question)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    code = add_table_rows questionnaire_max, review_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    if assignment.is_revision_planning_enabled&lt;br /&gt;
    #end table for Review Responses and begin table for Revision Plan Responses&lt;br /&gt;
      code = add_table_rows questionnaire_max, revision_plan_questions, answers, code, tag_prompt_deployments, current_user&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137153</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137153"/>
		<updated>2020-11-17T02:25:42Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
if (@questionnaire_type == &amp;quot;ReviewQuestionnaire&amp;quot; or @questionnaire_type == &amp;quot;RevisionPlanQuestionnaire&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137152</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137152"/>
		<updated>2020-11-17T02:24:17Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;view_team&amp;lt;/code&amp;gt; method, for each review that is passed to the view model, do an additional check for &amp;lt;code&amp;gt;is_revision_plan_enabled&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vary_by_round&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow &amp;lt;code&amp;gt;RevisionPlanQuestionnaires&amp;lt;/code&amp;gt; to be added to the view model in the same way as &amp;lt;code&amp;gt;ReviewQuestionnaires&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137151</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137151"/>
		<updated>2020-11-17T02:22:36Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
Heat grids for review responses are currently implemented in a view model defined in ''vm_question_response.rb''.  All functionality of this view model has remained in place, and additional responses are passed to it to create the additional heat grids for revision plan responses.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
In the view_team method, for each review that is passed to the view model, do an additional check for is_revision_plan_enabled and vary_by_round.&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
Allow RevisionPlanQuestionnaires to be added to the view model in the same way as ReviewQuestionnaires.&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
Print round number headings for Revision Plan heat grids.&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137148</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137148"/>
		<updated>2020-11-17T02:11:05Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* User Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137147</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137147"/>
		<updated>2020-11-17T02:10:13Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Assignment Overview Page (contains the Link to the revision planning page) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137146</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137146"/>
		<updated>2020-11-17T02:09:42Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137025</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137025"/>
		<updated>2020-11-16T22:28:00Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Reviewing an Assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Plan_Questionnaire.png|400px|thumb|center|Review page demonstrating added Revision Plan questions]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137023</id>
		<title>File:Revision Plan Questionnaire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137023"/>
		<updated>2020-11-16T22:23:58Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: Demadewe uploaded a new version of File:Revision Plan Questionnaire.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137021</id>
		<title>File:Revision Plan Questionnaire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137021"/>
		<updated>2020-11-16T22:20:43Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: Demadewe uploaded a new version of File:Revision Plan Questionnaire.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137020</id>
		<title>File:Revision Plan Questionnaire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Plan_Questionnaire.png&amp;diff=137020"/>
		<updated>2020-11-16T22:17:54Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137007</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137007"/>
		<updated>2020-11-16T21:47:28Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Reviewing an Assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that round.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137006</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137006"/>
		<updated>2020-11-16T21:46:47Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Editing the Revision Plan Questionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|500px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|700px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137005</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137005"/>
		<updated>2020-11-16T21:45:54Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|600px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137004</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137004"/>
		<updated>2020-11-16T21:45:39Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Assignment Overview Page (contains the Link to the revision planning page) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|600px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137003</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137003"/>
		<updated>2020-11-16T21:45:24Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Editing the Revision Plan Questionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|600px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137002</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137002"/>
		<updated>2020-11-16T21:45:04Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Summary Report Page - Under progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|600px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
=====Initial Wireframe=====&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
=====Final UI=====&lt;br /&gt;
[[File:Summary_Report.png|600px|thumb|center|Summary Report page demonstrating added Revision Plan heatgrid]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137001</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137001"/>
		<updated>2020-11-16T21:43:44Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Editing the Revision Plan Questionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Edit_Revision_Plan.png|600px|thumb|center|Edit Revision Plan page demonstrating added view]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137000</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=137000"/>
		<updated>2020-11-16T21:42:34Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Assignment Overview Page (contains the Link to the revision planning page) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Revision_Planning_Link.png|600px|thumb|center|Submit or Review Work page demonstrating added Revision Planning link]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136999</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136999"/>
		<updated>2020-11-16T21:40:43Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
=====Wireframe=====&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
=====UI Screenshot=====&lt;br /&gt;
[[File:Create_New_Assignment.png|700px|thumb|center|Create New Assignment page in the UI, with added Revision Planning checkbox]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_New_Assignment.png&amp;diff=136998</id>
		<title>File:Create New Assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_New_Assignment.png&amp;diff=136998"/>
		<updated>2020-11-16T21:37:46Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_Revision_Plan.png&amp;diff=136997</id>
		<title>File:Edit Revision Plan.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_Revision_Plan.png&amp;diff=136997"/>
		<updated>2020-11-16T21:37:20Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Planning_Link.png&amp;diff=136996</id>
		<title>File:Revision Planning Link.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Revision_Planning_Link.png&amp;diff=136996"/>
		<updated>2020-11-16T21:36:53Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Summary_Report.png&amp;diff=136995</id>
		<title>File:Summary Report.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Summary_Report.png&amp;diff=136995"/>
		<updated>2020-11-16T21:36:21Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136994</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136994"/>
		<updated>2020-11-16T20:46:42Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; (Boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;. Adding a Boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heat-grid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified - Under progress===&lt;br /&gt;
This is a list of files modified and added. The list will be updated as the implementation progresses.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''Changed'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/advice_controller.rb&lt;br /&gt;
*app/controllers/grades_controller.rb&lt;br /&gt;
*app/controllers/questionnaires_controller.rb&lt;br /&gt;
*app/controllers/questions_controller.rb&lt;br /&gt;
*app/controllers/response_controller.rb &lt;br /&gt;
*app/controllers/student_task_controller.rb&lt;br /&gt;
*app/helpers/summary_helper.rb &lt;br /&gt;
*app/models/questionnaire.rb &lt;br /&gt;
*app/models/response.rb&lt;br /&gt;
*app/models/student_task.rb&lt;br /&gt;
*app/models/vm_question_response.rb&lt;br /&gt;
*app/views/advice/edit_advice.html.erb&lt;br /&gt;
*app/views/assignments/edit/_general.html.erb&lt;br /&gt;
*app/views/grades/view_team.html.erb&lt;br /&gt;
*app/views/questionnaires/_questionnaire.html.erb &lt;br /&gt;
*app/views/response/response.html.erb&lt;br /&gt;
*app/views/student_task/view.html.erb &lt;br /&gt;
*config/routes.rb &lt;br /&gt;
*db/schema.rb&lt;br /&gt;
*spec/controllers/response_controller_spec.rb&lt;br /&gt;
*spec/models/response_spec.rb&lt;br /&gt;
*spec/models/review_response_map_spec.rb&lt;br /&gt;
&lt;br /&gt;
''Added'':&amp;lt;br&amp;gt;&lt;br /&gt;
*app/controllers/revision_plan_questionnaires_controller.rb &lt;br /&gt;
*app/models/revision_plan_questionnaire.rb&lt;br /&gt;
*app/models/revision_plan_team_map.rb&lt;br /&gt;
*app/views/questionnaires/_questions.html.erb&lt;br /&gt;
*app/views/revision_plan_questionnaires/edit.html.erb &lt;br /&gt;
*db/migrate/20201106020642_create_revision_plan_team_maps.rb /&lt;br /&gt;
*db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Changes:&lt;br /&gt;
*In the assignment table we have added &amp;lt;code&amp;gt;is_revision_planning_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanTeamMap&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire of type revision plan that will be created by the revewee.&lt;br /&gt;
*&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; using single table inheritance.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Revision plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
* Added a Boolean field &amp;lt;code&amp;gt;is_revision_planning_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; that saves whether revision planning is enabled.&lt;br /&gt;
''db/migrate/20201105023711_add_is_revison_planning_enabled_to_assignments.rb'' &lt;br /&gt;
&lt;br /&gt;
    class AddIsRevisonPlanningEnabledToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
      def change&lt;br /&gt;
        add_column :assignments, :is_revision_planning_enabled, :boolean, default: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
* Add checkbox to enable revision planning in edit assignment view.&lt;br /&gt;
''app/views/assignments/edit/_general.html.erb''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_revison_planning_field'&amp;gt;&lt;br /&gt;
      &amp;lt;input name=&amp;quot;assignment_form[assignment][is_revision_planning_enabled]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;%= check_box_tag('assignment_form[assignment][is_revision_planning_enabled]', 'true', @assignment_form.assignment.is_revision_planning_enabled) %&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('assignment_form[assignment][is_revision_planning_enabled]', 'Revision Planning?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to the ‘Revision planning page’.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Show link to revision planning page when revision planning is enabled for an assignment, round 1 has passed and current stage is submission. &lt;br /&gt;
&lt;br /&gt;
In order to check if a team is allowed to submit a revision plan &amp;lt;code&amp;gt;@can_submit_revision_plan&amp;lt;/code&amp;gt; field is added to &amp;lt;code&amp;gt;StudentTaskController&amp;lt;/code&amp;gt;'s view action. If a revision plan questionnaire (&amp;lt;code&amp;gt;@revision_plan_questionnaire_id&amp;lt;/code&amp;gt;) exists for the current round then clicking the link performs &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;'s edit action else new action is performed.&lt;br /&gt;
&lt;br /&gt;
''app/views/student_task/view.html.erb'' &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @team &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;li&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% if @can_submit_revision_plan %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @revision_plan_questionnaire_id %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'edit', id: @revision_plan_questionnaire_id %&amp;gt; &lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to &amp;quot;Revision Planning&amp;quot;, controller: 'revision_plan_questionnaires', action: 'new', team_id: @team %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        (Add new questions to next-round rubric)&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color=&amp;quot;gray&amp;quot;&amp;amp;gt;Revision Planning&amp;amp;lt;/font&amp;amp;gt; (You are not allowed to submit your revison plan right now)&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''app/controllers/student_task_controller.rb'' &lt;br /&gt;
 &lt;br /&gt;
  def view&lt;br /&gt;
    student_task = StudentTask.from_participant_id params[:id]&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    # Revision plan feature&lt;br /&gt;
    @can_submit_revision_plan = student_task.can_submit_revision_plan?&lt;br /&gt;
    @revision_plan_questionnaire_id = student_task.revision_plan_questionnaire_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/student_task.rb''&lt;br /&gt;
&lt;br /&gt;
  def current_round&lt;br /&gt;
    assignment.number_of_current_round(@topic.try(:id))&lt;br /&gt;
  end&lt;br /&gt;
  def can_submit_revision_plan?&lt;br /&gt;
    current_stage == 'submission' &amp;amp;&amp;amp; current_round &amp;gt; 1&lt;br /&gt;
  end&lt;br /&gt;
  def revision_plan_questionnaire_id&lt;br /&gt;
    RevisionPlanTeamMap.find_by(team: @participant.team, used_in_round: current_round).try(:questionnaire_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
* Create a model RevisionPlanTeamMap that maps a revision plan to a team and stores information of the round it is used in.&lt;br /&gt;
&lt;br /&gt;
''/app/models/revision_plan_team_map.rb''&lt;br /&gt;
&lt;br /&gt;
  class RevisionPlanTeamMap &amp;lt; ActiveRecord::Base&lt;br /&gt;
    belongs_to :team&lt;br /&gt;
    belongs_to :questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''/db/migrate/20201106020642_create_revision_plan_team_maps.rb'' &lt;br /&gt;
&lt;br /&gt;
  class CreateRevisionPlanTeamMaps &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      create_table :revision_plan_team_maps do |t|&lt;br /&gt;
        t.references :team, index: true, foreign_key: true&lt;br /&gt;
        t.references :questionnaire, index: true, foreign_key: true&lt;br /&gt;
        t.integer :used_in_round&lt;br /&gt;
        t.timestamps null: false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Create a Revision Plan Questionnaire Model and Controller&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/models/revision_plan_questionnaire.rb ''app/models/revision_plan_questionnaire.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a model for revision plan questionnaire. The code provides method to get questionnaire for a current round based on team.&lt;br /&gt;
&lt;br /&gt;
  def self.get_questionnaire_for_current_round(team_id)&lt;br /&gt;
    assignment_team = Team.find(team_id)&lt;br /&gt;
    assignment = assignment_team.assignment&lt;br /&gt;
    current_round = assignment.number_of_current_round(assignment_team.topic)&lt;br /&gt;
    questionnaire = RevisionPlanTeamMap.find_by(team: assignment_team, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
    unless questionnaire&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.new&lt;br /&gt;
      questionnaire.name = 'Revision Plan Questionnaire'&lt;br /&gt;
      questionnaire.instructor_id = assignment.instructor_id&lt;br /&gt;
      questionnaire.max_question_score = 5&lt;br /&gt;
      questionnaire.save&lt;br /&gt;
      questionnaire_team_map = RevisionPlanTeamMap.create(team_id: assignment_team.id, used_in_round: current_round, questionnaire_id: questionnaire.id)&lt;br /&gt;
    end&lt;br /&gt;
    return questionnaire&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method returns the team associated to a revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def team&lt;br /&gt;
    revision_plan_team_map.team&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Added a new type of questionnaire &amp;lt;code&amp;gt;'RevisionPlanQuestionnaire'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;QUESTIONNAIRE_TYPES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  QUESTIONNAIRE_TYPES = ['ReviewQuestionnaire',&lt;br /&gt;
                        ...&lt;br /&gt;
                        ...&lt;br /&gt;
                         'RevisionPlanQuestionnaire'].freeze&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SidharthMehta/expertiza/blob/1b54cf6c7aa2b1195c5259a4ee616f21fc2f37a3/app/controllers/revision_plan_questionnaires_controller.rb ''app/controllers/revision_plan_questionnaires_controller.rb'']&lt;br /&gt;
&lt;br /&gt;
Added a controller &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;. The controller derives from &amp;lt;code&amp;gt;QuestionnairesController&amp;lt;/code&amp;gt;, it overrides the &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt; action to allow creation of a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; for a &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt;. It also updates permissions for controller.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'edit'&lt;br /&gt;
      questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
      questionnaire.team.users.collect { |u| u.id }.include? session[:user].id || super&lt;br /&gt;
      (user_logged_in? &amp;amp;&amp;amp; questionnaire.team.users.collect { |u| u.id }.include?(session[:user].id)) || super&lt;br /&gt;
    else&lt;br /&gt;
      super&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    begin&lt;br /&gt;
      questionnaire = RevisionPlanQuestionnaire.get_questionnaire_for_current_round(params[:team_id])&lt;br /&gt;
      redirect_to action: 'edit', id: questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = $ERROR_INFO&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''config/routes.rb'' &lt;br /&gt;
&lt;br /&gt;
Add routes for &amp;lt;code&amp;gt;RevisionPlanQuestionnairesController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  resources :revision_plan_questionnaires, controller: :revision_plan_questionnaires, only: %i[new edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :add_new_questions&lt;br /&gt;
      post :save_all_questions&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
* Add a view to edit Revision Plan&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/revision_plan_questionnaires/edit.html.erb ''app/views/revision_plan_questionnaires/edit.html.erb'']&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'question_weight' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;h1&amp;amp;gt;Edit &amp;lt;%= @questionnaire.display_type %&amp;gt;&amp;amp;lt;/h1&amp;amp;gt;&lt;br /&gt;
  &amp;lt;%= render :partial =&amp;gt; 'questions' %&amp;gt;&lt;br /&gt;
  &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;a href=&amp;quot;javascript:window.history.back()&amp;quot;&amp;amp;gt;Back&amp;amp;lt;/a&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refactor code to display questions into a partial. Allows for code reuse.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questionnaires_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Updated &amp;lt;code&amp;gt;redirect_to&amp;lt;/code&amp;gt; links for &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
  redirect_to action: 'edit', id: questionnaire_id.to_sym&lt;br /&gt;
&lt;br /&gt;
''app/views/questionnaires/_questionnaire.html.erb''&lt;br /&gt;
&lt;br /&gt;
This file generates a view to edit/create a new questionnaire. It has functionality to display questions and some functions that are not needed for revision plan questionnaire. To enable code reuse the functionality to add/edit/remove/save questions was moved to a new partial ''app/views/questionnaires/_questions.html.erb''.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/blob/d97eb1c1fc8d578b18f51401dc713b0d04815fe4/app/views/questionnaires/_questions.html.erb ''app/views/questionnaires/_questions.html.erb'']&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to delete questions from revision plan questionnaire.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/questions_controller.rb ''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to remove questions from his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    if ['destroy'].include?(params[:action])&lt;br /&gt;
      question = Question.find(params[:id])&lt;br /&gt;
      if(user_logged_in? &amp;amp;&amp;amp; question.questionnaire.owner?(session[:user].id))&lt;br /&gt;
        return true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def destroy&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    if(question.questionnaire.type == 'RevisionPlanQuestionnaire')&lt;br /&gt;
      redirect_to edit_revision_plan_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to edit_questionnaire_path(questionnaire_id.to_s.to_sym)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Method returns true if user owns questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    instructor_id == user_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overrides implementation for &amp;lt;code&amp;gt;owner?&amp;lt;/code&amp;gt; defined in &amp;lt;code&amp;gt;Questionnaire&amp;lt;/code&amp;gt; to return true if a team owns the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def owner?(user_id)&lt;br /&gt;
    team.users.map{ |u| u.id }.include?(user_id) || super&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Add code to allow users to access show/edit advice functionality for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/advice_controller.rb''&lt;br /&gt;
&lt;br /&gt;
Update authorization code to allow a user to update advice his teams revision plan.&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    if(user_logged_in? &amp;amp;&amp;amp; questionnaire.owner?(session[:user].id))&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
    current_user_has_ta_privileges?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/advice/edit_advice.html.erb''&lt;br /&gt;
&lt;br /&gt;
Update 'Back to questionnaire' link.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if @questionnaire.type == 'RevisionPlanQuestionnaire'%&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'revision_plan_questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back to questionnaire', :controller =&amp;gt; 'questionnaires', :action =&amp;gt; 'edit', :id =&amp;gt; @questionnaire.id %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire is appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Add Revision Plan questions to Response&lt;br /&gt;
&lt;br /&gt;
''app/controllers/response_controller.rb''&lt;br /&gt;
&lt;br /&gt;
This methods gets questions sorted by sequence from review and revision questionnaire and merges them in a single list.&lt;br /&gt;
&lt;br /&gt;
  def set_questions_for_new_response&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    if(@assignment &amp;amp;&amp;amp; @assignment.is_revision_planning_enabled)&lt;br /&gt;
      reviewees_topic = SignedUpTeam.topic_id_by_team_id(@contributor.id)&lt;br /&gt;
      current_round = @assignment.number_of_current_round(reviewees_topic)&lt;br /&gt;
      @revision_plan_questionnaire = RevisionPlanTeamMap.find_by(team_id: @map.reviewee_id, used_in_round: current_round).try(:questionnaire)&lt;br /&gt;
      if(@revision_plan_questionnaire)&lt;br /&gt;
        @questions += sort_questions(@revision_plan_questionnaire.questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets questions from a response instead of questionnaire. We use this when response has already been created.&lt;br /&gt;
&lt;br /&gt;
  def set_questions&lt;br /&gt;
    @questions = @response.get_questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
 &lt;br /&gt;
Added a method to get all the questionnaires for a response, response is a collection of answers. Answers contain reference to their question, and question have a reference to questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def questionnaires_by_answers(answers)&lt;br /&gt;
    answers_with_questionnaires = answers.select{ |ans|  ans &amp;amp;&amp;amp; ans.question &amp;amp;&amp;amp; ans.question.questionnaire }&lt;br /&gt;
    questionnaires = answers_with_questionnaires.collect{ |ans| ans.question.questionnaire }.uniq&lt;br /&gt;
    unless(questionnaires.any?)&lt;br /&gt;
      questionnaires = []&lt;br /&gt;
      questionnaires &amp;lt;&amp;lt; questionnaire_by_answer(answers.first)&lt;br /&gt;
    end&lt;br /&gt;
    questionnaires&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
This method gets all the questions for a response.&lt;br /&gt;
&lt;br /&gt;
  def get_questions&lt;br /&gt;
    @questions = []&lt;br /&gt;
    questionnaires = questionnaires_by_answers(scores)&lt;br /&gt;
    questionnaires.each {|questionnaire| @questions += questionnaire.questions }&lt;br /&gt;
    return @questions&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*Separating questions by their questionnaire type&lt;br /&gt;
&lt;br /&gt;
''app/models/response.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;construct_review_response&amp;lt;/code&amp;gt; method has been updated to create separate tables for review questions, revision questions and additional comment.&lt;br /&gt;
&lt;br /&gt;
''app/models/questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Add a method to check if heading is to be displayed for the questionnaire.&lt;br /&gt;
&lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/models/revision_plan_questionnaire.rb''&lt;br /&gt;
&lt;br /&gt;
Overriding the method defined in questionnaire.rb to display heading for revision plan questionnaire.&lt;br /&gt;
 &lt;br /&gt;
  def display_heading?&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
''app/views/response/response.html.erb''&lt;br /&gt;
&lt;br /&gt;
View groups questions by questionnaire type and then adds a heading for questionnaires that return true for &amp;lt;code&amp;gt;display_heading?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Bug fix:''' The existing implementation has a bug where the first question in a questionnaire is displayed last in response. This was fixed as well.&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page - Under progress====&lt;br /&gt;
When a project has been reviewed at least once, a participant is able to view their team's score.  The UI below shows what this looks like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor are shown under '''Assignment Questionnaire.'''  The results of the questions created by the team are shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
'''Implementation'''&lt;br /&gt;
&lt;br /&gt;
*Show revision plan questions in heat grid.&lt;br /&gt;
&lt;br /&gt;
''app/controllers/grades_controller.rb''&lt;br /&gt;
&lt;br /&gt;
''app/helpers/summary_helper.rb''&lt;br /&gt;
&lt;br /&gt;
''app/models/vm_question_response.rb''&lt;br /&gt;
&lt;br /&gt;
''app/views/grades/view_team.html.erb''&lt;br /&gt;
&lt;br /&gt;
*Show grading for revision plan questions.&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan - Under progress===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests are written to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/grades_controller_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/revision_plan_questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
*spec/controllers/response_controller_spec.rb: Updated spec to pass build by stubbing &amp;lt;code&amp;gt;get_questions&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_questionnaire_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/revision_plan_team_map_spec.rb:&lt;br /&gt;
&lt;br /&gt;
*spec/models/response_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
*spec/models/review_response_map_spec.rb: Updated spec to pass build by updating expected html output.&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing aims to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;br /&gt;
# Deployment: [http://152.7.98.99:8080/ Deployment Link]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136625</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136625"/>
		<updated>2020-11-01T21:48:13Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* User Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;EnableRevisionPlan&amp;lt;/code&amp;gt; (boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TeamID&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.  Adding a boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heatgrid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
This is a list of files requiring modification and will be updated as the implementation progresses. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Requiring Change'': &amp;lt;br&amp;gt;&lt;br /&gt;
controllers/questionnaires_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
controllers/response_controller.rb&amp;lt;br&amp;gt;&lt;br /&gt;
controllers/grades_controller.rb&amp;lt;br&amp;gt;&lt;br /&gt;
models/response.rb&amp;lt;br&amp;gt;&lt;br /&gt;
models/assignment_team.rb&amp;lt;br&amp;gt;&lt;br /&gt;
views/questionnaires/_questioinnaire.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
views/student_task/view.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
views/assignments/edit/_review_strategy.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
views/response/view.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
views/response/response.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
views/grades/_review.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
''To be Added'': &amp;lt;br&amp;gt;&lt;br /&gt;
controllers/revision_plan_questionnaire.rb &amp;lt;br&amp;gt;&lt;br /&gt;
models/revision_plan_questionnaire.rb &amp;lt;br&amp;gt;&lt;br /&gt;
views/questionnaires/edit_revision_plan.html.erb&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# The Response currently displays section headings using &amp;lt;code&amp;gt;SectionHeader&amp;lt;/code&amp;gt;. SectionHeader is a child class of &amp;lt;code&amp;gt;QuestionnaireHeader&amp;lt;/code&amp;gt; which itself derives from &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt; A new &amp;lt;code&amp;gt;QuestionnaireNameHeader&amp;lt;/code&amp;gt; class which derives from QuestionnaireHeader will be created to display name of Questionnaire (Improvement Plan/Assignment) in a way which is similar to how we show section headings in UI.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Reviewing an Assignment====&lt;br /&gt;
Once the Revision Plan Questionnaire and its resubmission round have been finished, the Revision Plan Questionnaire will be appended to the Assignment Questionnaire for that around.&lt;br /&gt;
&lt;br /&gt;
[[File:Review_Wireframe.png|400px|thumb|center|Wireframe of Completing a Review for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
====RSpec Testing====&lt;br /&gt;
The RSpec tests would test both controller and models.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb: test revision plan questionnaire can be created and edited.&lt;br /&gt;
* spec/controllers/assignments_controller_spec.rb: create and validate an assignment with revision planning enabled.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
Test validations and logic present in revision plan and composite questionnaire models.&lt;br /&gt;
* spec/models/revision_plan_questionnaire_spec.rb&lt;br /&gt;
* spec/models/composite_questionnaire_spec.rb&lt;br /&gt;
&lt;br /&gt;
====Manual Testing====&lt;br /&gt;
Manual testing will aim to verify the following:&lt;br /&gt;
* Create an assignment with revision planning enabled.&lt;br /&gt;
* Are participants allowed to create/edit revision plan when round 1+ (1 or greater than 1) reviews have finished.&lt;br /&gt;
* Is revision plan editing disabled when assignment is in review stage.&lt;br /&gt;
* Are reviewers shown questions created by reviewees.&lt;br /&gt;
* Are participants shown summary of score for revision plan after review deadline has expired.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# Previous Implementation: [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875 wiki], [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016 wiki] &lt;br /&gt;
# Forked Repository: [https://github.com/SidharthMehta/expertiza/tree/beta E2083 github]&lt;br /&gt;
# Pull Request: [https://github.com/expertiza/expertiza/pull/1832 E2083 pull request]&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review_Wireframe.png&amp;diff=136624</id>
		<title>File:Review Wireframe.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review_Wireframe.png&amp;diff=136624"/>
		<updated>2020-11-01T21:45:31Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136252</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136252"/>
		<updated>2020-10-27T17:19:47Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in [https://expertiza.csc.ncsu.edu/index.php/E1875_Revision_Planning_Tool E1875] and once in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016]. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2020_E2016_Revision_planning_tool E2016] added &amp;lt;code&amp;gt;EnableRevisionPlan&amp;lt;/code&amp;gt; (boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TeamID&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.  Adding a boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heatgrid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# The Response currently displays section headings using &amp;lt;code&amp;gt;SectionHeader&amp;lt;/code&amp;gt;. SectionHeader is a child class of &amp;lt;code&amp;gt;QuestionnaireHeader&amp;lt;/code&amp;gt; which itself derives from &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt; A new &amp;lt;code&amp;gt;QuestionnaireNameHeader&amp;lt;/code&amp;gt; class which derives from QuestionnaireHeader will be created to display name of Questionnaire (Improvement Plan/Assignment) in a way which is similar to how we show section headings in UI.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Under development.&lt;br /&gt;
&lt;br /&gt;
We will be using RSPEC to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136251</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136251"/>
		<updated>2020-10-27T17:16:46Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Rationale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in E1875 and once in E2016. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, E2016 added &amp;lt;code&amp;gt;EnableRevisionPlan&amp;lt;/code&amp;gt; (boolean) to &amp;lt;code&amp;gt;Assignment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TeamID&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.  Adding a boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heatgrid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# The Response currently displays section headings using &amp;lt;code&amp;gt;SectionHeader&amp;lt;/code&amp;gt;. SectionHeader is a child class of &amp;lt;code&amp;gt;QuestionnaireHeader&amp;lt;/code&amp;gt; which itself derives from &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt; A new &amp;lt;code&amp;gt;QuestionnaireNameHeader&amp;lt;/code&amp;gt; class which derives from QuestionnaireHeader will be created to display name of Questionnaire (Improvement Plan/Assignment) in a way which is similar to how we show section headings in UI.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Under development.&lt;br /&gt;
&lt;br /&gt;
We will be using RSPEC to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136250</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136250"/>
		<updated>2020-10-27T17:15:53Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Previous Implementations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in E1875 and once in E2016. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a &amp;lt;code&amp;gt;team_id&amp;lt;/code&amp;gt; field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, E2016 added EnableRevisionPlan (boolean) to Assignment and TeamID to Question.  Adding a boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heatgrid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# The Response currently displays section headings using &amp;lt;code&amp;gt;SectionHeader&amp;lt;/code&amp;gt;. SectionHeader is a child class of &amp;lt;code&amp;gt;QuestionnaireHeader&amp;lt;/code&amp;gt; which itself derives from &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt; A new &amp;lt;code&amp;gt;QuestionnaireNameHeader&amp;lt;/code&amp;gt; class which derives from QuestionnaireHeader will be created to display name of Questionnaire (Improvement Plan/Assignment) in a way which is similar to how we show section headings in UI.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Under development.&lt;br /&gt;
&lt;br /&gt;
We will be using RSPEC to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136249</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136249"/>
		<updated>2020-10-27T17:15:20Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza. In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
===Previous Implementations===&lt;br /&gt;
Revision planning has been implemented twice before, once in E1875 and once in E2016. While the functionality worked and effectively minimized changes to the code, they also had the following problems:&lt;br /&gt;
*Hardcoded “round” numbers in many places of the code.&lt;br /&gt;
*Documentation does not reflect the new changes they made.&lt;br /&gt;
*Revision planning responses and responses to the other items are not distinguished in heatgrid view.&lt;br /&gt;
*The idea of adding a team_id field to each question is intuitive. However, they failed to come up with a clean implementation of this idea. Specifically, they had passed some trailing parameters several methods down before reaching the place that needs them.&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
To implement revision planning, E2016 added EnableRevisionPlan (boolean) to Assignment and TeamID to Question.  Adding a boolean to enable revision planning for an assignment makes sense, but having certain questions belong to a team is not a clean implementation. Instead, we will create a new questionnaire that will belong to each team and keep track of the set of questions. We will use this new questionnaire to separate the revision plan responses and responses to other items in heatgrid view by creating a different table for each.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
Items in green are additions.&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# The Response currently displays section headings using &amp;lt;code&amp;gt;SectionHeader&amp;lt;/code&amp;gt;. SectionHeader is a child class of &amp;lt;code&amp;gt;QuestionnaireHeader&amp;lt;/code&amp;gt; which itself derives from &amp;lt;code&amp;gt;Question&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt; A new &amp;lt;code&amp;gt;QuestionnaireNameHeader&amp;lt;/code&amp;gt; class which derives from QuestionnaireHeader will be created to display name of Questionnaire (Improvement Plan/Assignment) in a way which is similar to how we show section headings in UI.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Under development.&lt;br /&gt;
&lt;br /&gt;
We will be using RSPEC to test both controller and models.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136207</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=136207"/>
		<updated>2020-10-23T20:20:11Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Under development.&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135890</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135890"/>
		<updated>2020-10-21T03:27:47Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|700px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135889</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135889"/>
		<updated>2020-10-21T03:27:35Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|500px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135888</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135888"/>
		<updated>2020-10-21T03:27:24Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|400px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Enable_Revision_Planning_Wireframe.png&amp;diff=135887</id>
		<title>File:Enable Revision Planning Wireframe.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Enable_Revision_Planning_Wireframe.png&amp;diff=135887"/>
		<updated>2020-10-21T03:26:16Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: Demadewe uploaded a new version of File:Enable Revision Planning Wireframe.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135886</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135886"/>
		<updated>2020-10-21T03:25:31Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|600px|thumb|center|Wireframe of Enabling Assignment's Revision Planning]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135885</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135885"/>
		<updated>2020-10-21T03:25:11Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Enable Revision Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Enable_Revision_Planning_Wireframe.png|600px|thumb|center|Wireframe of Enabling Assignment's Improvement Plan]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Enable_Revision_Planning_Wireframe.png&amp;diff=135884</id>
		<title>File:Enable Revision Planning Wireframe.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Enable_Revision_Planning_Wireframe.png&amp;diff=135884"/>
		<updated>2020-10-21T03:24:29Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135883</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135883"/>
		<updated>2020-10-21T03:23:48Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* User Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
[[File:E2083_Proposed_Design.png|1000px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the assignment table we will add &amp;lt;code&amp;gt;is_revision_enabled?&amp;lt;/code&amp;gt; column to indicate whether the assignment accepts a revision plan along with review rubric.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; maps a questionnaire to an assignment team and round. This will map to a questionnaire that will be created by the reviewee.&lt;br /&gt;
&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
# A team would be allowed to create a &amp;lt;code&amp;gt;RevisionPlanQuestionnaire&amp;lt;/code&amp;gt; after completion of round 1 of review. This revision plan questionnaire would be linked to the next round and to the team. Team would be able to add questions to this revision plan questionnaire. &lt;br /&gt;
# Reviewer would be displayed questions of both the original assignment review rubric and reviewee created revision plan. To achieve this we will create a &amp;lt;code&amp;gt;CompositeQuestionnaire&amp;lt;/code&amp;gt; by combining the two questionnaires. This composite questionnaire would not have any revision plan or review rubric based code. &lt;br /&gt;
#* Composite questionnaire will be created in the following:&lt;br /&gt;
## When revision plan is enabled and a questionnaire is requested from &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;.&lt;br /&gt;
## When revision plan is enabled and questionnaire is requested from response.&lt;br /&gt;
#* Composite questionnaire would have a function &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; to return questions of contained questionnaires.&lt;br /&gt;
# To distinguish in UI whether question belongs to review questionnaire or revision plan questionnaire we can write a helper method which returns type of questionnaire that the question belong to.&lt;br /&gt;
&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Enable Revision Planning====&lt;br /&gt;
In order to enable '''Revision Planning''', the setting must be enabled when creating or editing an assignment under the '''General''' tab.  The wireframe below demonstrates creating an assignment, and editing the assignment functions similarly.  '''Improvement plan?''' should be checked to enable this option. &lt;br /&gt;
&lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Assignment Overview Page (contains the Link to the revision planning page)====&lt;br /&gt;
The '''Revision Planning''' link is available to students during every submission period (except the first round submission) and not available during every review period. As shown in the wireframe, by clicking '''Revision Planning''' students would be redirected to a page explained under the ‘Revision planning page’ subsection.&lt;br /&gt;
&lt;br /&gt;
[[File:Link_to_the_revision_planning.jpeg|600px|thumb|center|Wireframe of Assignment Overview Page]]&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking '''Remove''' in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods. &lt;br /&gt;
 &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under '''Assignment Questionnaire.'''  The results of the questions created by the team will be shown under '''Improvement Plan.'''&lt;br /&gt;
&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
[[File:Revision Planning Control Flow Diagram.jpeg|400px|thumb|center|Control Flow of the Revision Planning Function]]&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135825</id>
		<title>CSC/ECE 517 Fall 2020 - E2083. Revision planning tool E2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2083._Revision_planning_tool_E2016&amp;diff=135825"/>
		<updated>2020-10-20T20:53:10Z</updated>

		<summary type="html">&lt;p&gt;Demadewe: /* Editing the Revision Plan Questionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of the Expertiza based OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Introduction==&lt;br /&gt;
Rounds of peer reviews may be implemented between submissions for assignments on Expertiza.  In order to better track the implementation of reviewer's suggestions, a Revision Planning Tool should be implemented.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
In the first round of Expertiza reviews, we ask reviewers to give authors some guidance on how to improve their work. Then in the second round, reviewers rate how well authors have followed their suggestions. We could carry the interaction one step further if we asked authors to make up a revision plan based on the first-round reviews. That is, authors would say what they were planning to do to improve their work. Then second-round reviewers would assess how well they did it. In essence, this means that authors would be adding criteria to the second-round rubric that applied only to their submission. We are interested in having this implemented and used in a class so that we can study its effect.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Database Design===&lt;br /&gt;
===Proposed Changes===&lt;br /&gt;
===User Interface===&lt;br /&gt;
====Submission Page====&lt;br /&gt;
&lt;br /&gt;
====Editing the Revision Plan Questionnaire====&lt;br /&gt;
After creating the Revision Plan Questionnaire, it must be edited.  Questions can be added by specifying the amount of questions and their type.  Questions can be removed by clicking &amp;quot;Remove&amp;quot; in the leftmost column.  Once the questionnaire is complete, it can be saved.  This page will be visible during each submission period after the first and will be unavailable during all review periods.  &lt;br /&gt;
[[File:Edit_Revision_Plan_Wireframe.png|600px|thumb|center|Wireframe of Editing an Assignment's Revision Plan]]&lt;br /&gt;
&lt;br /&gt;
====Summary Report Page====&lt;br /&gt;
When a project has been reviewed at least once, a participant will be able to view their team's score.  The wireframe below shows what this will look like after the second round of reviews.  For the second and all subsequent reviews, the results of questions that were created by the instructor will be shown under &amp;quot;Assignment Questionnaire.&amp;quot;  The results of the questions created by the team will be shown under &amp;quot;Improvement Plan.&amp;quot;&lt;br /&gt;
[[File:View_Scores_Wireframe.png|400px|thumb|center|Wireframe of Summary Report for an Assignment]]&lt;br /&gt;
&lt;br /&gt;
===Control Flow Diagram===&lt;br /&gt;
==Team Members==&lt;br /&gt;
Chaitanya Mehta (cmehta)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Darby Madewell (demadewe)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Dongni Yang (dyang23)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sidharth Mehta (smehta22)&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
'''Mentor:''' Yulin Zhang (yzhan114)&lt;/div&gt;</summary>
		<author><name>Demadewe</name></author>
	</entry>
</feed>