<?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=Pkeny</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=Pkeny"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pkeny"/>
	<updated>2026-06-05T14:04:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117213</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117213"/>
		<updated>2018-04-29T03:27:11Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
*Shrinath Cheriyana&lt;br /&gt;
*Sanika Sabnis&lt;br /&gt;
*Pratik Keny&lt;br /&gt;
*Praneet Mocherla&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Pull Request: https://github.com/expertiza/expertiza/pull/1178&lt;br /&gt;
*Expertiza YouTube channel:&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117212</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117212"/>
		<updated>2018-04-29T03:26:55Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
*Shrinath Cheriyana&lt;br /&gt;
*Sanika Sabnis&lt;br /&gt;
*Pratik Keny&lt;br /&gt;
*Praneet Mocherla&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Pull Request: https://github.com/expertiza/expertiza/pull/1178&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117211</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117211"/>
		<updated>2018-04-29T03:26:32Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Team members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
*Shrinath Cheriyana&lt;br /&gt;
*Sanika Sabnis&lt;br /&gt;
*Pratik Keny&lt;br /&gt;
*Praneet Mocherla&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117210</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117210"/>
		<updated>2018-04-29T03:26:18Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Team members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
::*Shrinath Cheriyana&lt;br /&gt;
::*Sanika Sabnis&lt;br /&gt;
::*Pratik Keny&lt;br /&gt;
::*Praneet Mocherla&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117209</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117209"/>
		<updated>2018-04-29T03:25:55Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
Shrinath Cheriyana&lt;br /&gt;
Sanika Sabnis&lt;br /&gt;
Pratik Keny&lt;br /&gt;
Praneet Mocherla&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117207</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117207"/>
		<updated>2018-04-29T03:24:24Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
4. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which are added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
*Added a migration to create a subclass &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/add_srq_id_to_teams.rb''' &lt;br /&gt;
*Added a migration which will add the Supplementary Review Questionnaire id column to the &amp;quot;Teams&amp;quot; table. This is to link the team which created the supplementary review questionnaire to the created questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
*To create Supplementary Review Questionnaire&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/response_controller.rb'''&lt;br /&gt;
* Obtained supplementary review questionnaire from the questionnaires table for new response&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire_for_new_response&lt;br /&gt;
    case @map.type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;, &amp;quot;SelfReviewResponseMap&amp;quot;&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;
      @questionnaire = @map.questionnaire(@current_round)&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@contributor.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    when&lt;br /&gt;
      &amp;quot;MetareviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;TeammateReviewResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;FeedbackResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;CourseSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;AssignmentSurveyResponseMap&amp;quot;,&lt;br /&gt;
      &amp;quot;GlobalSurveyResponseMap&amp;quot;&lt;br /&gt;
      @questionnaire = @map.questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Obtained answers for the supplementary review questionnaire from the responses&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_questionnaire&lt;br /&gt;
    # if user is not filling a new rubric, the @response object should be available.&lt;br /&gt;
    # we can find the questionnaire from the question_id in answers&lt;br /&gt;
    answer = @response.scores.first&lt;br /&gt;
    @questionnaire = @response.questionnaire_by_answer(answer)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    sr_answer = @response.scores.last&lt;br /&gt;
    @sr_questionnaire = @response.questionnaire_by_answer(sr_answer)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Appended responses of the supplementary review questionnaire in the edit method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit&lt;br /&gt;
    @header = &amp;quot;Edit&amp;quot;&lt;br /&gt;
    @next_action = &amp;quot;update&amp;quot;&lt;br /&gt;
    @return = params[:return]&lt;br /&gt;
    @response = Response.find(params[:id])&lt;br /&gt;
    @map = @response.map&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if @prev.present?&lt;br /&gt;
      @sorted = @review_scores.sort {|m1, m2| m1.version_num.to_i and m2.version_num.to_i ? m2.version_num.to_i &amp;lt;=&amp;gt; m1.version_num.to_i : (m1.version_num ? -1 : 1) }&lt;br /&gt;
      @largest_version_num = @sorted[0]&lt;br /&gt;
    end&lt;br /&gt;
    @modified_object = @response.response_id&lt;br /&gt;
    # set more handy variables for the view&lt;br /&gt;
    set_content(new_response = true)&lt;br /&gt;
    @review_scores = []&lt;br /&gt;
    @questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @sr_questions.each do |question|&lt;br /&gt;
      @review_scores &amp;lt;&amp;lt; Answer.where(response_id: @response.response_id, question_id: question.id).first&lt;br /&gt;
    end&lt;br /&gt;
    render action: 'response'&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Append questions of supplementary review questionnaire in create method and set content method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
    map_id = params[:id]&lt;br /&gt;
    map_id = params[:map_id] if !params[:map_id].nil?# pass map_id as a hidden field in the review form&lt;br /&gt;
    @map = ResponseMap.find(map_id)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    @team_id = @map.reviewee_id&lt;br /&gt;
    set_all_responses&lt;br /&gt;
    if params[:review][:questionnaire_id]&lt;br /&gt;
      @questionnaire = Questionnaire.find(params[:review][:questionnaire_id])&lt;br /&gt;
      @round = params[:review][:round]&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team_id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      @round = nil&lt;br /&gt;
    end&lt;br /&gt;
    is_submitted = (params[:isSubmit] == 'Yes')&lt;br /&gt;
&lt;br /&gt;
    if params[:saved].nil? || params[:saved] == &amp;quot;0&amp;quot; # a flag so the autosave doesn't create different versions. The value's changed by the javascript in response.js&lt;br /&gt;
      @response = Response.create(&lt;br /&gt;
          map_id: @map.id,&lt;br /&gt;
          additional_comment: params[:review][:comments],&lt;br /&gt;
          round: @round,&lt;br /&gt;
          is_submitted: is_submitted&lt;br /&gt;
      )&lt;br /&gt;
    else&lt;br /&gt;
      @response = Response.find_by(map_id: @map.id, round: @round)&lt;br /&gt;
      if !@response.nil?&lt;br /&gt;
        @response.update(additional_comment: params[:review][:comments]) # ignore if autoupdate try to save when the response object is not yet created.&lt;br /&gt;
      else&lt;br /&gt;
        logger.error(&amp;quot;Can't find response with '#{@map.id}' and round '#{@round}' to update, even though params[:saved] = #{params[:saved]}&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # ,:version_num=&amp;gt;@version)&lt;br /&gt;
    # Change the order for displaying questions for editing response views.&lt;br /&gt;
    questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
      questions += sr_questions&lt;br /&gt;
    end&lt;br /&gt;
    create_answers(params, questions) if params[:responses]&lt;br /&gt;
&lt;br /&gt;
    msg = &amp;quot;Your response was successfully saved.&amp;quot;&lt;br /&gt;
    error_msg = &amp;quot;&amp;quot;&lt;br /&gt;
    # @response.notify_instructor_on_difference if (@map.is_a? ReviewResponseMap) &amp;amp;&amp;amp; @response.is_submitted &amp;amp;&amp;amp; @response.significant_difference?&lt;br /&gt;
    # @response.email&lt;br /&gt;
    redirect_to controller: 'response', action: 'saving', id: @map.map_id, return: params[:return], msg: msg, error_msg: error_msg, save_options: params[:save_options]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def set_content(new_response = false)&lt;br /&gt;
    @title = @map.get_title&lt;br /&gt;
    if @map.survey?&lt;br /&gt;
      @survey_parent = @map.survey_parent&lt;br /&gt;
    else&lt;br /&gt;
      @assignment = @map.assignment&lt;br /&gt;
    end&lt;br /&gt;
    @participant = @map.reviewer&lt;br /&gt;
    @contributor = @map.contributor&lt;br /&gt;
    new_response ? set_questionnaire_for_new_response : set_questionnaire&lt;br /&gt;
    set_dropdown_or_scale&lt;br /&gt;
    @questions = sort_questions(@questionnaire.questions)&lt;br /&gt;
    # added for srq&lt;br /&gt;
    unless @sr_questionnaire.nil?&lt;br /&gt;
      @sr_questions = sort_questions(@sr_questionnaire.questions)&lt;br /&gt;
    end&lt;br /&gt;
    @min = @questionnaire.min_question_score&lt;br /&gt;
    @max = @questionnaire.max_question_score&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5. '''app/controllers/grades_controller.rb''' &lt;br /&gt;
:Added supplementary review responses to &amp;quot;Your Scores&amp;quot; section.&lt;br /&gt;
&amp;lt;pre&amp;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;
    @questions = {}&lt;br /&gt;
    questionnaires = @assignment.questionnaires&lt;br /&gt;
    retrieve_questions questionnaires&lt;br /&gt;
    @pscore = @participant.scores(@questions)&lt;br /&gt;
    @vmlist = []&lt;br /&gt;
&lt;br /&gt;
    # loop through each questionnaire, and populate the view model for all data necessary&lt;br /&gt;
    # to render the html tables.&lt;br /&gt;
    questionnaires.each do |questionnaire|&lt;br /&gt;
      @round = if @assignment.varying_rubrics_by_round? &amp;amp;&amp;amp; questionnaire.type == &amp;quot;ReviewQuestionnaire&amp;quot;&lt;br /&gt;
                 AssignmentQuestionnaire.find_by(assignment_id: @assignment.id, questionnaire_id: questionnaire.id).used_in_round&lt;br /&gt;
               end&lt;br /&gt;
      vm = VmQuestionResponse.new(questionnaire, @assignment)&lt;br /&gt;
      vmquestions = questionnaire.questions&lt;br /&gt;
      # added for srq&lt;br /&gt;
      @sr_questionnaire_id = Team.get_srq_id_of_team(@team.id)&lt;br /&gt;
      unless @sr_questionnaire_id.nil?&lt;br /&gt;
        @sr_questionnaire = Questionnaire.find(@sr_questionnaire_id)&lt;br /&gt;
        unless @sr_questionnaire.nil?&lt;br /&gt;
          sr_questions = @sr_questionnaire.questions&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
      vmquestions += sr_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.varying_rubrics_by_round?)&lt;br /&gt;
      vm.get_number_of_comments_greater_than_10_words&lt;br /&gt;
      @vmlist &amp;lt;&amp;lt; vm&lt;br /&gt;
    end&lt;br /&gt;
    @current_role_name = current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6. '''app/views/assignments/edit/_rubrics.html.erb''' &lt;br /&gt;
*Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;assignment_form[assignment][srq]&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][srq]', 'true', @assignment_form.assignment.srq) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('assignment_form[assignment][srq]', 'Allow students to add Supplementary Review Questionnaire?') %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
*Created a link &amp;quot; Create Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section if the instructor has enabled student generated Questions for this assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if stage != &amp;quot;Finished&amp;quot; and controller.controller_name == 'submitted_content' and @can_submit %&amp;gt;&lt;br /&gt;
  &amp;lt;h2&amp;gt;Add Supplementary Review Questions:&amp;lt;/h2&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.srq? %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to &amp;quot;Create Supplementary Review Questionnaire&amp;quot;, {:controller =&amp;gt; &amp;quot;questionnaires&amp;quot;, :action =&amp;gt; &amp;quot;create_srq&amp;quot;, :id =&amp;gt; participant.id } %&amp;gt;&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      The instructor has not enabled this feature for this assignment&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. '''app/controllers/questionnaires_controller''' &lt;br /&gt;
* Added a method to create Supplementary Review Questionnaire&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_srq&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @team = Team.find(@participant.team.id)&lt;br /&gt;
    if @team.srq_id.nil? then&lt;br /&gt;
      @questionnaire = Questionnaire.new&lt;br /&gt;
      @questionnaire.private = false&lt;br /&gt;
      @questionnaire.name = &amp;quot;SRQ_&amp;quot; + @team.id.to_s&lt;br /&gt;
      @questionnaire.instructor_id = @team.id&lt;br /&gt;
      @questionnaire.min_question_score = 0&lt;br /&gt;
      @questionnaire.max_question_score = 5&lt;br /&gt;
      @questionnaire.type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.display_type = &amp;quot;SupplementaryReviewQuestionnaire&amp;quot;&lt;br /&gt;
      @questionnaire.instruction_loc = Questionnaire::DEFAULT_QUESTIONNAIRE_URL&lt;br /&gt;
      @questionnaire.save&lt;br /&gt;
      @team.srq_id = @questionnaire.id&lt;br /&gt;
      @team.save&lt;br /&gt;
      flash[:success] = 'You have successfully created a questionnaire!'&lt;br /&gt;
    else&lt;br /&gt;
      @questionnaire = Questionnaire.find(@team.srq_id)&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'questionnaires', action: 'edit', id: @questionnaire.id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117195</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117195"/>
		<updated>2018-04-29T02:50:03Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* File that will be added/modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File which were added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117194</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117194"/>
		<updated>2018-04-29T02:43:22Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
:In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
:This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117193</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117193"/>
		<updated>2018-04-29T02:42:52Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb :&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb :&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117192</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117192"/>
		<updated>2018-04-29T02:39:59Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*Expertiza on Github:https://github.com/Pratik2611/expertiza/tree/shrinathedit &lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117191</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117191"/>
		<updated>2018-04-29T02:37:18Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Supplementary Review Questionnaire Testing : '''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Topic Helper : '''topic_helper.rb&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117190</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117190"/>
		<updated>2018-04-29T02:36:24Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* File that will be added/modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117189</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117189"/>
		<updated>2018-04-29T02:32:11Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117188</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117188"/>
		<updated>2018-04-29T02:28:20Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': More tests may be added as we proceed through the design. The above given list is temporary.&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
This file is included in the helper folder inside spec/features. This helper is used because the given methods are used in more than one place and to keep the code &amp;quot;DRY&amp;quot;. In the first method we are stubbing the user so that that user signs up for an assignment. In the second method more testing is being performed to test the upload link.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117187</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117187"/>
		<updated>2018-04-29T02:25:14Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': More tests may be added as we proceed through the design. The above given list is temporary.&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117186</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117186"/>
		<updated>2018-04-29T02:24:50Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': More tests may be added as we proceed through the design. The above given list is temporary.&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
::In this test, we are testing the addition and editing of the supplementary questionnaire. Furthermore, we are also checking whether the questionnaire is being displayed or not to the reviewer. Also a test has been added to check if the questionnaire gets added to the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117185</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117185"/>
		<updated>2018-04-29T02:22:33Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': More tests may be added as we proceed through the design. The above given list is temporary.&lt;br /&gt;
::'''Supplementary Review Questionnaire Testing :'''supplementary_review_rubric_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::''' Topic Helper :'''topic_helper.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117184</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=117184"/>
		<updated>2018-04-29T02:22:01Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of Project ===&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Solution === &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowcharts below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire only then a student can create a supplementary review questionnaire. A student can click on the &amp;quot;Your Work&amp;quot; tab and see a link to the add/edit Supplementary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire (SRQ), the entry in the SRQ column added to the Teams table will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:1flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:2flow.PNG]]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:3flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When responses of questionnaire need to be displayed&lt;br /&gt;
** When the responses of the reviewer is recorded, the student can click on &amp;quot;View Scores&amp;quot; tab for a particular assignment which contains the responses of the reviewer. This view should contain the responses for both the default review questions as well the supplementary review questions added by the student. So if the entry of the SRQ column in the Teams table is not empty the responses of the supplementary review questions is appended to the responses of the default review questions.&lt;br /&gt;
'''NOTE''': The responses of the Supplementary Review Questions will not be added to the review scores of the project. It will just be shown to the team that has asked these questions so that they can see what suggestions does the reviewer has for the questions. &lt;br /&gt;
&lt;br /&gt;
[[File:4flow.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the User Interface ===&lt;br /&gt;
&lt;br /&gt;
The following changes need to be made to the User Interface. &lt;br /&gt;
&lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a student to add supplementary review rubric. Once ‘checked’ a button or link will appear in the student's &amp;quot;Your Work&amp;quot; section.  This link will redirect the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
:[[File:Finaledit1r.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*A link called &amp;quot;Supplemantary Review Questionnaire&amp;quot; will appear in the student's &amp;quot;Your Work&amp;quot; section when the Instructor has allowed students to create supplementary review questions. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if the Supplementary Review rubric has been added. Thus, now the reviewer will be able to see the Supplementary Review questions along with the existing review questions.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will add another column to the “View scores” page (for both instructor and students) so that the responses of the Supplementary Review Questions are also shown to student. &lt;br /&gt;
'''NOTE''':The student-generated questions (Supplementary Review Questions) will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire, the supplementary questionnaire column of the Teams table has a correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
5. To check if the responses of the Supplementary Review Questions have been added to the responses of the existing review questions.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': More tests may be added as we proceed through the design. The above given list is temporary.&lt;br /&gt;
::''''Supplementary Review Questionnaire Testing :''''supplementary_review_rubric_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include TopicHelper&lt;br /&gt;
describe &amp;quot;supplementary rubric testing&amp;quot; do&lt;br /&gt;
  before(:each) do&lt;br /&gt;
      # create assignment and topic&lt;br /&gt;
      create(:assignment, name: &amp;quot;TestAssignment&amp;quot;, directory_path: &amp;quot;TestAssignment&amp;quot;)&lt;br /&gt;
      create_list(:participant, 3)&lt;br /&gt;
      create(:assignment_team)&lt;br /&gt;
      create(:team_user, user: User.where(role_id: 2).first, team: AssignmentTeam.first)&lt;br /&gt;
      create(:topic, topic_name: &amp;quot;TestTopic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;submission&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;review&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;metareview&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;drop_topic&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;signup&amp;quot;)&lt;br /&gt;
      create(:deadline_type, name: &amp;quot;team_formation&amp;quot;)&lt;br /&gt;
      create(:deadline_right)&lt;br /&gt;
      create(:deadline_right, name: 'Late')&lt;br /&gt;
      create(:deadline_right, name: 'OK')&lt;br /&gt;
      create(:assignment_questionnaire)&lt;br /&gt;
      create(:questionnaire)&lt;br /&gt;
      create(:question)&lt;br /&gt;
      create(:assignment_due_date, deadline_type: DeadlineType.where(name: &amp;quot;submission&amp;quot;).first, due_at: DateTime.now.in_time_zone + 1.day)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;has srq to add/edit supplementary questionnaire&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    expect(page).to have_content &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;add supplementary questionnaire to teams model&amp;quot; do&lt;br /&gt;
    signup_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
   # assert !Team.supplementary_rubric_by_team_id(2).nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;should display Supplementary Questionnaire to assigned student&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    click_link &amp;quot;Create Supplementary Review Questionnaire&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Add&amp;quot;&lt;br /&gt;
    click_button &amp;quot;Save supplementaryreview questionnaire&amp;quot;&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Begin&amp;quot;&lt;br /&gt;
    #expect(page).to have_content &amp;quot;Supplementary Reviewee Generated Questions&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::'''' Topic Helper :''''topic_helper.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module TopicHelper&lt;br /&gt;
    def signup_topic&lt;br /&gt;
        user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
        stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        visit '/sign_up_sheet/sign_up?id=1&amp;amp;topic_id=1' # signup topic&lt;br /&gt;
        visit '/student_task/list'&lt;br /&gt;
        click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
        click_link &amp;quot;Your work&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    def submit_to_topic&lt;br /&gt;
        signup_topic&lt;br /&gt;
        fill_in 'submission', with: &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
        click_on 'Upload link'&lt;br /&gt;
        expect(page).to have_content &amp;quot;https://www.ncsu.edu&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
7. '''app/views/assignments/edit/_general.html.erb''' &lt;br /&gt;
:Add a checkbox called &amp;quot;Allow students to create supplementary review questionnaire&amp;quot; .&lt;br /&gt;
&lt;br /&gt;
8. '''app/views/submitted_content/_main.html.erb''' &lt;br /&gt;
:Allow a link &amp;quot;Supplementary Review Questionnaire&amp;quot; to appear in the student's &amp;quot;Your Work&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added. The above given list is temporary.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*Expertiza on Github: https://github.com/expertiza/expertiza&lt;br /&gt;
*Expertiza Documentation: http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
*Expertiza YouTube channel: https://www.youtube.com/channel/UCdKXzox7hrWjfOMML6FzTWg/videos&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=116418</id>
		<title>CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1817:_Adding_Student-generated_Questions_to_Rubric&amp;diff=116418"/>
		<updated>2018-04-09T01:44:52Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
== Overview of Project ==&lt;br /&gt;
&lt;br /&gt;
Expertiza contains Peer-Review where in all students are asked to review the work done by their fellow classmates. The rubric for the same are created by instructors. These Rubrics contain questions that are related to the submitted topics. But sometimes students have questions which may or may not be related to the work other students are working on. So there is no option currently available to ask these questions to their peers. This project (E1817) aims to solve this problem by allowing students to add questions to the standard instructor generated rubric so that they can get specific feedback on from the reviewers.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution == &lt;br /&gt;
&lt;br /&gt;
In order to solve the above problem, we intend to add a Supplementary Review Questions to the existing Review Questions already added by the instructor. These “extra” questions will not be graded. However, they will increase the benefit that each person gets because they can get feedback that is specific to their project. The rest of this document describes the design and approach for project E1817. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Expertiza, all rubrics and surveys are subclasses of Questionnaire. A Questionnaire has “questions” that make use of checkboxes, dropdowns, text boxes, etc. We want to add a new subclass of Questionnaire called SupplementaryReviewQuestionnaire to help us implement this project.&lt;br /&gt;
&lt;br /&gt;
=== Design Strategy ===&lt;br /&gt;
The flowchart below describes the design that we chose to implement for this project.&lt;br /&gt;
&lt;br /&gt;
*When a student wants to create/edit Supplementary Review Questionnaire&lt;br /&gt;
** If the instructor has enabled a particular assignment to have supplementary review questionnaire a student when clicks on the &amp;quot;Your Work&amp;quot; tab sees a link to the add/edit Supplemntary Review Questionnaire. This link directs the student to the create review questionnaire(same as instructor).&lt;br /&gt;
**When a student creates a Supplementary Review Questionnaire(SRQ), a SRQ column needs to be added to the Teams Table which will contain the questionnaire id to link the SRQ with the team that generated it. If the SRQ column of a team is empty it means no supplementary review questionnaire was created. If its not empty, it will indicate that a supplementary review questionnaire was created. &lt;br /&gt;
&lt;br /&gt;
[[File:Flow1edited.PNG]]&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
*When Reviewer wants to access the Review Questions.&lt;br /&gt;
** When a reviewer requests for a review, first the entry of the SRQ column in the Teams table is checked to see if supplementary review questionnaire was added. If the field is not empty, the supplementary review questionnaire is appended to the existing review questionnaire created by the instructor. Otherwise the reviewer only sees the default review questionnaire.&lt;br /&gt;
[[File:Flow2edited.PNG]]&lt;br /&gt;
&lt;br /&gt;
*When scores need to be displayed&lt;br /&gt;
** When the response of the reviewer is recorded, the student can view the scores for a particular assignment which contains the response of the review questions. This view should contain both the scores of default review questions as well the supplementary review questions added by the student. So if the SRQ field in the Teams table is not empty the scores of the supplementary review questions is appended to the scores of the default review questions.&lt;br /&gt;
[[File:Flow3edited.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Changes in the UserInterface ===&lt;br /&gt;
&lt;br /&gt;
To be able to achieve the goal for this project, we need to implement some changes in the UI. &lt;br /&gt;
*Assignment Page&lt;br /&gt;
**An assignment will have a checkbox that the instructor can ‘check’ to enable a supplementary review rubric. Once ‘checked’ a button or link on the page will appear.  This button will take the student to the same page that an instructor lands on when creating a new rubric, which will allow the student to create a review rubric just like an instructor does.&lt;br /&gt;
*A link needs to be added to the submission of the work. So when a student clicks the link he/she can add the desired questions.&lt;br /&gt;
:[[File:rsz_link.png]]&lt;br /&gt;
&lt;br /&gt;
* The page where student will be directed to when he/she clicks the Supplementary Review Questionnaire link.&lt;br /&gt;
:[[File:rsz_review.png]]&lt;br /&gt;
&lt;br /&gt;
* The page which allows students to add different types of questions to the Supplementary Review Questionnaire.&lt;br /&gt;
:[[File:rsz_append.png]]&lt;br /&gt;
&lt;br /&gt;
*Review Page&lt;br /&gt;
**When a reviewer fills out a rubric, the ResponseController will display a set of rubrics, in order, on the same page. This set would normally consist of just a review rubric, which is a Response object. However, the set would now have a review rubric and a supplementary review rubric (two items in the set instead of one) if supplementary Review rubric has been added.&lt;br /&gt;
&lt;br /&gt;
*Review Results Page&lt;br /&gt;
**The “View” function for a rubric will display answers submitted for the SupplementaryReviewQuestionnaire as well as the ReviewQuestionnaire.  We will also add another column to the “View scores” page (for both instructor and students) to report the scores that the students gave on these questions. The student-generated questions will not be graded to avoid encouraging students to ask “easy” questions so that their reviewers would give them a high scores.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Firstly, we need to add tests for the following:&lt;br /&gt;
&lt;br /&gt;
1. To check the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; appears in the &amp;quot;Your Work&amp;quot; section of a student.&lt;br /&gt;
&lt;br /&gt;
2. To check if the link for &amp;quot;Supplementary Review Questionnaire&amp;quot; redirects to page which allows to create questionnaire.&lt;br /&gt;
&lt;br /&gt;
3. To check if after creation of the supplementary questionnaire the supplementary questionnaire column of the Teams table has correct value (i.e not NIL).&lt;br /&gt;
&lt;br /&gt;
4. To check if the reviewers can see the supplementary questions that were added by the team as part of the review questions.&lt;br /&gt;
&lt;br /&gt;
Apart from these we will need to add some tests to '''assignments_spec''' and '''response_controller_spec''' to test the addition of Supplementary Review Questionnaire.&lt;br /&gt;
&lt;br /&gt;
== File that will be added/modified ==&lt;br /&gt;
&lt;br /&gt;
As of now, we have figured out that the following files need to be added/modified:&lt;br /&gt;
&lt;br /&gt;
1. '''app/models/supplementary_review_questionnaire.rb''' &lt;br /&gt;
:We need to create a subclass &amp;quot;SupplementaryQuestionnaire&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
2. '''db/migrate/Add_Supplementary_Questionnaire_to_Teams.rb''' &lt;br /&gt;
:We need to add to create a migration which will add the Supplementary Questionnaire column to the &amp;quot;Teams&amp;quot; table.&lt;br /&gt;
&lt;br /&gt;
3. '''config/routes.rb''' &lt;br /&gt;
:For correct switching between the various views&lt;br /&gt;
&lt;br /&gt;
4. '''app/controllers/student_review_controller.rb, app/controllers/review_mapping_controller.rb, app/controllers/response_controller.rb'''&lt;br /&gt;
:Files that need modification for adding Supplementary questions to the existing rubrics.&lt;br /&gt;
&lt;br /&gt;
5. '''spec/models/assignment_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
6. '''spec/controllers/response_controller_spec.rb''' &lt;br /&gt;
:Add additional test case to test the new functionality.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' : There will be additional files that need modification and some new files may also need to be added the above given list is temporary.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=116000</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=116000"/>
		<updated>2018-04-03T18:12:40Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;Final Project (and Design Document)&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:UnfinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the available actions(add,edit,delete) and bookmarks available for each unfinished topic.&lt;br /&gt;
#:[[File:UnfinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
To add a topic to an assignment,&lt;br /&gt;
#Select the [[File:addButton.jpg]] on the Topics tab of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Add Dialog, enter values for the Topic id, Topic name and Number of slots and click Save.&lt;br /&gt;
#:[[File:AddDialog.jpg]]&lt;br /&gt;
#The newly added topic will appear in the table sorted by Topic #.&lt;br /&gt;
#:[[File:NewlyAddedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
To Delete a topic from the Topics tab,&lt;br /&gt;
#Select the [[File:DeleteButton.jpg]] for the topic you wish to delete.&lt;br /&gt;
#Confirm that you would like to delete the selected topic.&lt;br /&gt;
#:[[File:DeleteConfirmation.jpg]]&lt;br /&gt;
#:[[File:ToBeDeleted.jpg]]&lt;br /&gt;
#Note that the topic is no longer in the table.&lt;br /&gt;
#:[[File:DeletedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
To edit a topic to an assignment,&lt;br /&gt;
#Select the [[File:editButton.jpg]] on the desired topic of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Edit Dialog, make the desired edits and click Save.&lt;br /&gt;
#:[[File:EditDialog.jpg]]&lt;br /&gt;
#The newly editted topic will appear with the new value(s).&lt;br /&gt;
#:[[File:NewlyEdittedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;OSS project/Writing assignment 2&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:FinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the unavailable actions(add,edit,delete) and bookmarks absent for each unfinished topics.&lt;br /&gt;
#:[[File:FinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
#Log in as &amp;quot;student5918&amp;quot; with the password &amp;quot;password&amp;quot; at &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt;.&lt;br /&gt;
#Select &amp;quot;Final Project (and Design Document)&amp;quot; from the assignments list.&lt;br /&gt;
#:[[File:StudentAssignmentsList.jpg]]&lt;br /&gt;
#Select &amp;quot;Signup sheet&amp;quot; from the assignment menu.&lt;br /&gt;
#:[[File:AssignmentMenu.jpg]]&lt;br /&gt;
#Select the check icon next to the desired topic.&lt;br /&gt;
#:[[File:SignupSheet.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
&lt;br /&gt;
::For testing the new functionality of  methods in the sign_up_sheet_controller, we tested that JSON was correctly rendered from the load_add_signup_topics method, which loads the topics into the edit assignment table&lt;br /&gt;
::* There were four JSON outputs which were tested:&lt;br /&gt;
::**slots_waitlisted is correctly outputted as JSON&lt;br /&gt;
::**slots_filled_value is correctly outputted as JSON&lt;br /&gt;
::**slots_available is correctly outputted as JSON&lt;br /&gt;
::**participants is correctly outputted as JSON&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describe'#load_add_signup_topics' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(SignUpTopic).to receive(:where).with(&amp;quot;assignment_id = ?&amp;quot;, &amp;quot;1&amp;quot;).and_return([topic])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_filled).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_waitlisted).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignedUpTeam).to receive(:find_team_participants).with(&amp;quot;1&amp;quot;).and_return([double('User', topic_id: 0)])&lt;br /&gt;
      params = {id: 1, topic_id: 1}&lt;br /&gt;
      get :load_add_signup_topics, params&lt;br /&gt;
      @parsed_response = JSON.parse( response.body )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_waitlisted correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_waitlisted&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_filled_value correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_filled_value&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_available correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_available&amp;quot;]).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'There are no participants' do&lt;br /&gt;
      it 'returns participants as empty as JSON' do&lt;br /&gt;
        expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;participants&amp;quot;]).to be_empty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Testing Walkthrough''' ====&lt;br /&gt;
::In order to test this area of the project, you need to:&lt;br /&gt;
::*Install the environment using ./setup.sh&lt;br /&gt;
::*run bundle install&lt;br /&gt;
::*run 'rspec spec/controllers/sign_up_sheet_controller_spec.rb'&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Overall there are a few more outputs from the method that could be tested. These are values that are pivotal to the table and so testing them is important, so if we are able to, we would like to add those to the project as well, but besides that are proud of the tests that do work.&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
=====Goals achieved according to the spec file:=====&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
=====Additional Goals achieved:=====&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
=====Files which have been changed to reflect the changes:=====&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115999</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115999"/>
		<updated>2018-04-03T18:11:17Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;Final Project (and Design Document)&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:UnfinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the available actions(add,edit,delete) and bookmarks available for each unfinished topic.&lt;br /&gt;
#:[[File:UnfinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
To add a topic to an assignment,&lt;br /&gt;
#Select the [[File:addButton.jpg]] on the Topics tab of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Add Dialog, enter values for the Topic id, Topic name and Number of slots and click Save.&lt;br /&gt;
#:[[File:AddDialog.jpg]]&lt;br /&gt;
#The newly added topic will appear in the table sorted by Topic #.&lt;br /&gt;
#:[[File:NewlyAddedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
To Delete a topic from the Topics tab,&lt;br /&gt;
#Select the [[File:DeleteButton.jpg]] for the topic you wish to delete.&lt;br /&gt;
#Confirm that you would like to delete the selected topic.&lt;br /&gt;
#:[[File:DeleteConfirmation.jpg]]&lt;br /&gt;
#:[[File:ToBeDeleted.jpg]]&lt;br /&gt;
#Note that the topic is no longer in the table.&lt;br /&gt;
#:[[File:DeletedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
To edit a topic to an assignment,&lt;br /&gt;
#Select the [[File:editButton.jpg]] on the desired topic of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Edit Dialog, make the desired edits and click Save.&lt;br /&gt;
#:[[File:EditDialog.jpg]]&lt;br /&gt;
#The newly editted topic will appear with the new value(s).&lt;br /&gt;
#:[[File:NewlyEdittedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;OSS project/Writing assignment 2&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:FinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the unavailable actions(add,edit,delete) and bookmarks absent for each unfinished topics.&lt;br /&gt;
#:[[File:FinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
#Log in as &amp;quot;student5918&amp;quot; with the password &amp;quot;password&amp;quot; at &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt;.&lt;br /&gt;
#Select &amp;quot;Final Project (and Design Document)&amp;quot; from the assignments list.&lt;br /&gt;
#:[[File:StudentAssignmentsList.jpg]]&lt;br /&gt;
#Select &amp;quot;Signup sheet&amp;quot; from the assignment menu.&lt;br /&gt;
#:[[File:AssignmentMenu.jpg]]&lt;br /&gt;
#Select the check icon next to the desired topic.&lt;br /&gt;
#:[[File:SignupSheet.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
&lt;br /&gt;
::For testing the new functionality of  methods in the sign_up_sheet_controller, we tested that JSON was correctly rendered from the load_add_signup_topics method, which loads the topics into the edit assignment table&lt;br /&gt;
::* There were four JSON outputs which were tested:&lt;br /&gt;
::**slots_waitlisted is correctly outputted as JSON&lt;br /&gt;
::**slots_filled_value is correctly outputted as JSON&lt;br /&gt;
::**slots_available is correctly outputted as JSON&lt;br /&gt;
::**participants is correctly outputted as JSON&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describe'#load_add_signup_topics' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(SignUpTopic).to receive(:where).with(&amp;quot;assignment_id = ?&amp;quot;, &amp;quot;1&amp;quot;).and_return([topic])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_filled).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_waitlisted).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignedUpTeam).to receive(:find_team_participants).with(&amp;quot;1&amp;quot;).and_return([double('User', topic_id: 0)])&lt;br /&gt;
      params = {id: 1, topic_id: 1}&lt;br /&gt;
      get :load_add_signup_topics, params&lt;br /&gt;
      @parsed_response = JSON.parse( response.body )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_waitlisted correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_waitlisted&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_filled_value correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_filled_value&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_available correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_available&amp;quot;]).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'There are no participants' do&lt;br /&gt;
      it 'returns participants as empty as JSON' do&lt;br /&gt;
        expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;participants&amp;quot;]).to be_empty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Testing Walkthrough''' ====&lt;br /&gt;
::In order to test this area of the project, you need to:&lt;br /&gt;
::*Install the environment using ./setup.sh&lt;br /&gt;
::*run bundle install&lt;br /&gt;
::*run 'rspec spec/controllers/sign_up_sheet_controller_spec.rb'&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Overall there are a few more outputs from the method that could be tested. These are values that are pivotal to the table and so testing them is important, so if we are able to, we would like to add those to the project as well, but besides that are proud of the tests that do work.&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::=====Goals achieved according to the spec file:=====&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115998</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115998"/>
		<updated>2018-04-03T18:10:52Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;Final Project (and Design Document)&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:UnfinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the available actions(add,edit,delete) and bookmarks available for each unfinished topic.&lt;br /&gt;
#:[[File:UnfinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
To add a topic to an assignment,&lt;br /&gt;
#Select the [[File:addButton.jpg]] on the Topics tab of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Add Dialog, enter values for the Topic id, Topic name and Number of slots and click Save.&lt;br /&gt;
#:[[File:AddDialog.jpg]]&lt;br /&gt;
#The newly added topic will appear in the table sorted by Topic #.&lt;br /&gt;
#:[[File:NewlyAddedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
To Delete a topic from the Topics tab,&lt;br /&gt;
#Select the [[File:DeleteButton.jpg]] for the topic you wish to delete.&lt;br /&gt;
#Confirm that you would like to delete the selected topic.&lt;br /&gt;
#:[[File:DeleteConfirmation.jpg]]&lt;br /&gt;
#:[[File:ToBeDeleted.jpg]]&lt;br /&gt;
#Note that the topic is no longer in the table.&lt;br /&gt;
#:[[File:DeletedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
To edit a topic to an assignment,&lt;br /&gt;
#Select the [[File:editButton.jpg]] on the desired topic of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Edit Dialog, make the desired edits and click Save.&lt;br /&gt;
#:[[File:EditDialog.jpg]]&lt;br /&gt;
#The newly editted topic will appear with the new value(s).&lt;br /&gt;
#:[[File:NewlyEdittedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;OSS project/Writing assignment 2&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:FinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the unavailable actions(add,edit,delete) and bookmarks absent for each unfinished topics.&lt;br /&gt;
#:[[File:FinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
#Log in as &amp;quot;student5918&amp;quot; with the password &amp;quot;password&amp;quot; at &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt;.&lt;br /&gt;
#Select &amp;quot;Final Project (and Design Document)&amp;quot; from the assignments list.&lt;br /&gt;
#:[[File:StudentAssignmentsList.jpg]]&lt;br /&gt;
#Select &amp;quot;Signup sheet&amp;quot; from the assignment menu.&lt;br /&gt;
#:[[File:AssignmentMenu.jpg]]&lt;br /&gt;
#Select the check icon next to the desired topic.&lt;br /&gt;
#:[[File:SignupSheet.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
&lt;br /&gt;
::For testing the new functionality of  methods in the sign_up_sheet_controller, we tested that JSON was correctly rendered from the load_add_signup_topics method, which loads the topics into the edit assignment table&lt;br /&gt;
::* There were four JSON outputs which were tested:&lt;br /&gt;
::**slots_waitlisted is correctly outputted as JSON&lt;br /&gt;
::**slots_filled_value is correctly outputted as JSON&lt;br /&gt;
::**slots_available is correctly outputted as JSON&lt;br /&gt;
::**participants is correctly outputted as JSON&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describe'#load_add_signup_topics' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(SignUpTopic).to receive(:where).with(&amp;quot;assignment_id = ?&amp;quot;, &amp;quot;1&amp;quot;).and_return([topic])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_filled).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_waitlisted).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignedUpTeam).to receive(:find_team_participants).with(&amp;quot;1&amp;quot;).and_return([double('User', topic_id: 0)])&lt;br /&gt;
      params = {id: 1, topic_id: 1}&lt;br /&gt;
      get :load_add_signup_topics, params&lt;br /&gt;
      @parsed_response = JSON.parse( response.body )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_waitlisted correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_waitlisted&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_filled_value correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_filled_value&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_available correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_available&amp;quot;]).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'There are no participants' do&lt;br /&gt;
      it 'returns participants as empty as JSON' do&lt;br /&gt;
        expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;participants&amp;quot;]).to be_empty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Testing Walkthrough''' ====&lt;br /&gt;
::In order to test this area of the project, you need to:&lt;br /&gt;
::*Install the environment using ./setup.sh&lt;br /&gt;
::*run bundle install&lt;br /&gt;
::*run 'rspec spec/controllers/sign_up_sheet_controller_spec.rb'&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Overall there are a few more outputs from the method that could be tested. These are values that are pivotal to the table and so testing them is important, so if we are able to, we would like to add those to the project as well, but besides that are proud of the tests that do work.&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::====='''Goals achieved according to the spec file:'''=====&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115997</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115997"/>
		<updated>2018-04-03T18:09:52Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Further Implementation Required */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;Final Project (and Design Document)&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:UnfinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the available actions(add,edit,delete) and bookmarks available for each unfinished topic.&lt;br /&gt;
#:[[File:UnfinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
To add a topic to an assignment,&lt;br /&gt;
#Select the [[File:addButton.jpg]] on the Topics tab of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Add Dialog, enter values for the Topic id, Topic name and Number of slots and click Save.&lt;br /&gt;
#:[[File:AddDialog.jpg]]&lt;br /&gt;
#The newly added topic will appear in the table sorted by Topic #.&lt;br /&gt;
#:[[File:NewlyAddedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
To Delete a topic from the Topics tab,&lt;br /&gt;
#Select the [[File:DeleteButton.jpg]] for the topic you wish to delete.&lt;br /&gt;
#Confirm that you would like to delete the selected topic.&lt;br /&gt;
#:[[File:DeleteConfirmation.jpg]]&lt;br /&gt;
#:[[File:ToBeDeleted.jpg]]&lt;br /&gt;
#Note that the topic is no longer in the table.&lt;br /&gt;
#:[[File:DeletedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
To edit a topic to an assignment,&lt;br /&gt;
#Select the [[File:editButton.jpg]] on the desired topic of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Edit Dialog, make the desired edits and click Save.&lt;br /&gt;
#:[[File:EditDialog.jpg]]&lt;br /&gt;
#The newly editted topic will appear with the new value(s).&lt;br /&gt;
#:[[File:NewlyEdittedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;OSS project/Writing assignment 2&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:FinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the unavailable actions(add,edit,delete) and bookmarks absent for each unfinished topics.&lt;br /&gt;
#:[[File:FinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
#Log in as &amp;quot;student5918&amp;quot; with the password &amp;quot;password&amp;quot; at &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt;.&lt;br /&gt;
#Select &amp;quot;Final Project (and Design Document)&amp;quot; from the assignments list.&lt;br /&gt;
#:[[File:StudentAssignmentsList.jpg]]&lt;br /&gt;
#Select &amp;quot;Signup sheet&amp;quot; from the assignment menu.&lt;br /&gt;
#:[[File:AssignmentMenu.jpg]]&lt;br /&gt;
#Select the check icon next to the desired topic.&lt;br /&gt;
#:[[File:SignupSheet.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
&lt;br /&gt;
::For testing the new functionality of  methods in the sign_up_sheet_controller, we tested that JSON was correctly rendered from the load_add_signup_topics method, which loads the topics into the edit assignment table&lt;br /&gt;
::* There were four JSON outputs which were tested:&lt;br /&gt;
::**slots_waitlisted is correctly outputted as JSON&lt;br /&gt;
::**slots_filled_value is correctly outputted as JSON&lt;br /&gt;
::**slots_available is correctly outputted as JSON&lt;br /&gt;
::**participants is correctly outputted as JSON&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describe'#load_add_signup_topics' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(SignUpTopic).to receive(:where).with(&amp;quot;assignment_id = ?&amp;quot;, &amp;quot;1&amp;quot;).and_return([topic])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_filled).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_waitlisted).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignedUpTeam).to receive(:find_team_participants).with(&amp;quot;1&amp;quot;).and_return([double('User', topic_id: 0)])&lt;br /&gt;
      params = {id: 1, topic_id: 1}&lt;br /&gt;
      get :load_add_signup_topics, params&lt;br /&gt;
      @parsed_response = JSON.parse( response.body )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_waitlisted correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_waitlisted&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_filled_value correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_filled_value&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_available correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_available&amp;quot;]).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'There are no participants' do&lt;br /&gt;
      it 'returns participants as empty as JSON' do&lt;br /&gt;
        expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;participants&amp;quot;]).to be_empty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Testing Walkthrough''' ====&lt;br /&gt;
::In order to test this area of the project, you need to:&lt;br /&gt;
::*Install the environment using ./setup.sh&lt;br /&gt;
::*run bundle install&lt;br /&gt;
::*run 'rspec spec/controllers/sign_up_sheet_controller_spec.rb'&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Overall there are a few more outputs from the method that could be tested. These are values that are pivotal to the table and so testing them is important, so if we are able to, we would like to add those to the project as well, but besides that are proud of the tests that do work.&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115996</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115996"/>
		<updated>2018-04-03T18:04:21Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Further Implementation Required */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;Final Project (and Design Document)&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:UnfinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the available actions(add,edit,delete) and bookmarks available for each unfinished topic.&lt;br /&gt;
#:[[File:UnfinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
To add a topic to an assignment,&lt;br /&gt;
#Select the [[File:addButton.jpg]] on the Topics tab of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Add Dialog, enter values for the Topic id, Topic name and Number of slots and click Save.&lt;br /&gt;
#:[[File:AddDialog.jpg]]&lt;br /&gt;
#The newly added topic will appear in the table sorted by Topic #.&lt;br /&gt;
#:[[File:NewlyAddedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
To Delete a topic from the Topics tab,&lt;br /&gt;
#Select the [[File:DeleteButton.jpg]] for the topic you wish to delete.&lt;br /&gt;
#Confirm that you would like to delete the selected topic.&lt;br /&gt;
#:[[File:DeleteConfirmation.jpg]]&lt;br /&gt;
#:[[File:ToBeDeleted.jpg]]&lt;br /&gt;
#Note that the topic is no longer in the table.&lt;br /&gt;
#:[[File:DeletedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
To edit a topic to an assignment,&lt;br /&gt;
#Select the [[File:editButton.jpg]] on the desired topic of the unfinished assignment that was navigated to in the first section.&lt;br /&gt;
#In the subsequent Edit Dialog, make the desired edits and click Save.&lt;br /&gt;
#:[[File:EditDialog.jpg]]&lt;br /&gt;
#The newly editted topic will appear with the new value(s).&lt;br /&gt;
#:[[File:NewlyEdittedTopic.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
#Log in to &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt; using the username &amp;quot;instructor6&amp;quot; and password &amp;quot;password&amp;quot;.&lt;br /&gt;
#Select &amp;quot;Manage...&amp;quot; -&amp;gt; &amp;quot;Assignments&amp;quot; from the dropdown at the top.&lt;br /&gt;
#:[[File:ManageAssignments.jpg]]&lt;br /&gt;
#Click the [[File:EditPencilIcon.JPG]] for the &amp;quot;OSS project/Writing assignment 2&amp;quot; assignment.&lt;br /&gt;
#Select the &amp;quot;Topics&amp;quot; tab for the assignment.&lt;br /&gt;
#:[[File:FinishedAssignmentsTabs.JPG]]&lt;br /&gt;
#Note the unavailable actions(add,edit,delete) and bookmarks absent for each unfinished topics.&lt;br /&gt;
#:[[File:FinishedAssignmentTopicsTab.JPG]]&lt;br /&gt;
&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
#Log in as &amp;quot;student5918&amp;quot; with the password &amp;quot;password&amp;quot; at &amp;lt; https://vast-bastion-53966.herokuapp.com &amp;gt;.&lt;br /&gt;
#Select &amp;quot;Final Project (and Design Document)&amp;quot; from the assignments list.&lt;br /&gt;
#:[[File:StudentAssignmentsList.jpg]]&lt;br /&gt;
#Select &amp;quot;Signup sheet&amp;quot; from the assignment menu.&lt;br /&gt;
#:[[File:AssignmentMenu.jpg]]&lt;br /&gt;
#Select the check icon next to the desired topic.&lt;br /&gt;
#:[[File:SignupSheet.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
&lt;br /&gt;
::For testing the new functionality of  methods in the sign_up_sheet_controller, we tested that JSON was correctly rendered from the load_add_signup_topics method, which loads the topics into the edit assignment table&lt;br /&gt;
::* There were four JSON outputs which were tested:&lt;br /&gt;
::**slots_waitlisted is correctly outputted as JSON&lt;br /&gt;
::**slots_filled_value is correctly outputted as JSON&lt;br /&gt;
::**slots_available is correctly outputted as JSON&lt;br /&gt;
::**participants is correctly outputted as JSON&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describe'#load_add_signup_topics' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(SignUpTopic).to receive(:where).with(&amp;quot;assignment_id = ?&amp;quot;, &amp;quot;1&amp;quot;).and_return([topic])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_filled).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignUpTopic).to receive(:find_slots_waitlisted).with(&amp;quot;1&amp;quot;).and_return([double('SignedUpTeam', count: 0,topic_id: 1)])&lt;br /&gt;
      allow(SignedUpTeam).to receive(:find_team_participants).with(&amp;quot;1&amp;quot;).and_return([double('User', topic_id: 0)])&lt;br /&gt;
      params = {id: 1, topic_id: 1}&lt;br /&gt;
      get :load_add_signup_topics, params&lt;br /&gt;
      @parsed_response = JSON.parse( response.body )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_waitlisted correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_waitlisted&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_filled_value correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_filled_value&amp;quot;]).to eq(0)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'returns slots_available correctly as JSON' do&lt;br /&gt;
      expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;slots_available&amp;quot;]).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'There are no participants' do&lt;br /&gt;
      it 'returns participants as empty as JSON' do&lt;br /&gt;
        expect(@parsed_response[&amp;quot;sign_up_topics&amp;quot;][0][&amp;quot;participants&amp;quot;]).to be_empty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Testing Walkthrough''' ====&lt;br /&gt;
::In order to test this area of the project, you need to:&lt;br /&gt;
::*Install the environment using ./setup.sh&lt;br /&gt;
::*run bundle install&lt;br /&gt;
::*run 'rspec spec/controllers/sign_up_sheet_controller_spec.rb'&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Overall there are a few more outputs from the method that could be tested. These are values that are pivotal to the table and so testing them is important, so if we are able to, we would like to add those to the project as well, but besides that are proud of the tests that do work.&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::*Automatic testing&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115846</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115846"/>
		<updated>2018-04-03T02:32:42Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* Important links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* '''Deployed app: https://vast-bastion-53966.herokuapp.com/'''&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115842</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115842"/>
		<updated>2018-04-03T02:30:38Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_2.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Rsz_1capturestu_3.png|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:Rsz_capturesugg_comm.png|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_1capturestu_3.png&amp;diff=115841</id>
		<title>File:Rsz 1capturestu 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_1capturestu_3.png&amp;diff=115841"/>
		<updated>2018-04-03T02:30:15Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturesugg_comm.png&amp;diff=115839</id>
		<title>File:Rsz capturesugg comm.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturesugg_comm.png&amp;diff=115839"/>
		<updated>2018-04-03T02:29:28Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115836</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115836"/>
		<updated>2018-04-03T02:27:24Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_capturestu_1.png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115834</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115834"/>
		<updated>2018-04-03T02:25:50Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz_Capture(stu_1).png|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturestu_2.png&amp;diff=115833</id>
		<title>File:Rsz capturestu 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturestu_2.png&amp;diff=115833"/>
		<updated>2018-04-03T02:24:56Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturestu_1.png&amp;diff=115832</id>
		<title>File:Rsz capturestu 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturestu_1.png&amp;diff=115832"/>
		<updated>2018-04-03T02:24:32Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115828</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115828"/>
		<updated>2018-04-03T02:20:39Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Rsz_captureaedit.png|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_captureedit.png&amp;diff=115825</id>
		<title>File:Rsz captureedit.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_captureedit.png&amp;diff=115825"/>
		<updated>2018-04-03T02:19:58Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115824</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115824"/>
		<updated>2018-04-03T02:18:40Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
== Important links ==&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
::Furthermore, replacing the html table with a dynamic table should not disrupt the html table for topic signup available to the student.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::Addition of advertisements is pending. Values for formatting the width of the table columns to enable the table to fit the jQuery UI tab is present, but not fully operational.&lt;br /&gt;
&lt;br /&gt;
==== '''Functionality walkthroughs''' ====&lt;br /&gt;
::The functionality below is for an instructor user unless mentioned otherwise.&lt;br /&gt;
&lt;br /&gt;
===== '''Navigate to unfinished assignment''' =====&lt;br /&gt;
===== '''Add topic''' =====&lt;br /&gt;
===== '''Delete topic''' =====&lt;br /&gt;
===== '''Edit topic''' =====&lt;br /&gt;
===== '''Navigate to finished assignment''' =====&lt;br /&gt;
===== '''Sign up for a topic as a student''' =====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Rsz_capturea.png|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturea.png&amp;diff=115823</id>
		<title>File:Rsz capturea.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_capturea.png&amp;diff=115823"/>
		<updated>2018-04-03T02:18:07Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115714</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115714"/>
		<updated>2018-04-03T00:17:04Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::''''2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;.''''&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::''''3. Add your suggestion.''''&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::''''4. Login as instructor6 and password:password.''''&lt;br /&gt;
::''''5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;.''''&lt;br /&gt;
[[File:Capture(a).PNG|frame|center|x|]]&lt;br /&gt;
::''''6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen.''''&lt;br /&gt;
::''''7. Add a comment on that suggestion and submit.''''&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::''''8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.''''&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115711</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115711"/>
		<updated>2018-04-03T00:15:50Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:''''&lt;br /&gt;
::''''1. Login as a student2065/2064/2066 with password:password''''&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|frame|center|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::''''9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115705</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115705"/>
		<updated>2018-04-03T00:15:01Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::''''The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|frame|center|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.''''&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115701</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115701"/>
		<updated>2018-04-03T00:13:39Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|frame|center|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115698</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115698"/>
		<updated>2018-04-03T00:12:56Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|x|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|x|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|x|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|frame|x|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|x|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|frame|x|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115695</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115695"/>
		<updated>2018-04-03T00:11:39Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|frame|center|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|frame|center|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|frame|center|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|frame|center|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|frame|center|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115694</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115694"/>
		<updated>2018-04-03T00:10:59Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|50x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|frame|center|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115688</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115688"/>
		<updated>2018-04-03T00:07:42Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|50x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115685</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115685"/>
		<updated>2018-04-03T00:06:41Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|50px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115681</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115681"/>
		<updated>2018-04-03T00:05:06Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|xpx|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115680</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115680"/>
		<updated>2018-04-03T00:04:50Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|x,px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115679</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115679"/>
		<updated>2018-04-03T00:04:09Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG|x|]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG|x|]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG|x|]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115677</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115677"/>
		<updated>2018-04-03T00:03:36Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|5x|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x8px|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|10x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115676</id>
		<title>CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1804:_OSS_project_Yellow:_Topic_management&amp;diff=115676"/>
		<updated>2018-04-03T00:03:12Z</updated>

		<summary type="html">&lt;p&gt;Pkeny: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a description of our Expertiza project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RUN &amp;quot;./setup.sh&amp;quot; BEFORE RUNNING APP; CONTENTS OF &amp;quot;bower.json&amp;quot; HAVE CHANGED &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'''&lt;br /&gt;
&lt;br /&gt;
= Important links =&lt;br /&gt;
* Github repo: https://github.com/dburcal/expertiza&lt;br /&gt;
* Github pull request: https://github.com/expertiza/expertiza/pull/1144&lt;br /&gt;
* Deployed app: https://vast-bastion-53966.herokuapp.com/&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== '''Expertiza Background''' ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.&lt;br /&gt;
&lt;br /&gt;
=== '''Problem Statement''' ===&lt;br /&gt;
To enhance topic management for instructors and students.&lt;br /&gt;
* '''Issue 971''': Change create topic UI to AJAX&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 926''': Sort topics by topic number in assignment#edit&lt;br /&gt;
::&lt;br /&gt;
* '''Issue 718''': Allow instructors to give feedback when accepting or rejecting suggestions,add comments on those suggestions.&lt;br /&gt;
::&lt;br /&gt;
&lt;br /&gt;
=== '''Our Goals''' ===&lt;br /&gt;
We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.&lt;br /&gt;
&lt;br /&gt;
=== '''Files Edited''' ===&lt;br /&gt;
&lt;br /&gt;
* app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
* app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
* app/spec/features/topic_suggestion_spec.rb&lt;br /&gt;
* app/assets/javascripts/application.js&lt;br /&gt;
* app/assets/javascripts/signup.js&lt;br /&gt;
* app/assets/stylesheets/application.scss&lt;br /&gt;
* app/assets/stylesheets/signup.scss.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* app/models/sign_up_topic.rb&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/signup/signup_topics.html.erb&lt;br /&gt;
* app/views/suggestion/show.html.erb&lt;br /&gt;
* app/views/suggestion/update_comment.html.erb&lt;br /&gt;
* app/views/suggestion/edit_comment.html.erb&lt;br /&gt;
* app/views/suggestion/_form_comment.html.erb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
* bower.json&lt;br /&gt;
&lt;br /&gt;
== Issue 971 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::The implementation of this functionality was started using &amp;lt; http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2017/E1781_Topic_Management &amp;gt; as a baseline.  This issue calls for the replacement of the html table with a javascript table using jsGrid. The use of jsGrid in conjunction with AJAX calls allow for the user to complete actions such as edit and add for topics from a single page.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::There is logic implemented in the views that needs to be moved back to the controller. This logic deals with conditional display of fields based on the current role of the user or status of the assignment.  Additional tests need to be created to test this controller logic.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The tests were written in these files:&lt;br /&gt;
::*app/spec/controllers/assignments_controller_spec.rb&lt;br /&gt;
::*app/spec/controllers/sign_up_sheet_controller_spec.rb&lt;br /&gt;
::As mentioned previously they are still a work in progress. You can run the tests that were made by running these rspec files.&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' =====&lt;br /&gt;
'''Testing is still in progress. After a merge, aspects of the code need to be changed.'''&lt;br /&gt;
&lt;br /&gt;
::For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.&lt;br /&gt;
::* Testing that if an assignment due date has passed:&lt;br /&gt;
::**Topics are no longer editable and you can no longer add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'assignment due dates have not passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone + 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'allows a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'allows a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that if an assignment due date has not passed:&lt;br /&gt;
::**Topics are  editable and you can add/delete topics&lt;br /&gt;
::'''app/spec/controllers/assignments_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'all assignment due dates have passed' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        due_date.due_at = DateTime.now.in_time_zone - 1.day&lt;br /&gt;
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)&lt;br /&gt;
      end&lt;br /&gt;
      it 'does not allow a topic to be edited' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:edit)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a topic to be deleted' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:destroy)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'does not allow a new topic to be added' do&lt;br /&gt;
        params = {id: 1, anchor: 'tabs-2'}&lt;br /&gt;
        get :edit, params, xhr: true&lt;br /&gt;
        expect(response).not_to respond_to(:new)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::* Testing that default topic available slots is 1&lt;br /&gt;
::'''app/spec/controllers/sign_up_sheet_controller_spec.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  define '#new' do&lt;br /&gt;
    it 'has default available slots of 1' do&lt;br /&gt;
      params = {id: 1}&lt;br /&gt;
      get :new, params&lt;br /&gt;
      expect(response).to have_field('max_choosers', with: '1')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:&lt;br /&gt;
::*If assignment deadline has passed, you can not add students to a topic&lt;br /&gt;
::*Ensure students cant see which students are on other topics&lt;br /&gt;
::*Check that Advertisement Horn shows in the table if a team has an ad open&lt;br /&gt;
::*If you login as student, you can't add/delete topics in the table&lt;br /&gt;
&lt;br /&gt;
== Issue 926 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We let JSGrid handle the sorting of topics by the headers in the table. We altered the AJAX controller to enable this sorting.&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
::While the table is able to be sorted by the header row, whenever you make a new topic the initial list of topics is not resorted right away. This leads to say E1502, a new topic just made, to be at the bottom of the list when it would normally precede say E1700, if it were in the same topic list.&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
::There is no testing required in this aspect, since sorting is a feature of the AJAX table itself, and therefore it wouldn't make sense to test the implementation.&lt;br /&gt;
&lt;br /&gt;
== Issue 718 ==&lt;br /&gt;
==== '''Implementation''' ====&lt;br /&gt;
::We implemented the functionality for approving and rejecting any topic suggestions made by the students. Furthermore we have included comments which the instructor can give for a particular topic suggestion. Some tests have been added to verify the above functionality. The functionality of editing comments also has been correctly implemented.&lt;br /&gt;
::'''Goals achieved according to the spec file:'''&lt;br /&gt;
::1. Implement approving and rejecting suggestions.&lt;br /&gt;
::2. Adding comments to the suggestions(can be multiple).&lt;br /&gt;
::'''Additional Goals achieved:'''&lt;br /&gt;
::1. Editing comments in the suggestions view.&lt;br /&gt;
::2. Removing redundant Approve and Reject suggestion button which were present on the suggestion screen.&lt;br /&gt;
::'''Files which have been changed to reflect the changes:'''&lt;br /&gt;
::1. '''app/view/suggestion/show.html.erb'''&lt;br /&gt;
::*To see all the comments and to edit individual comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;colgroup&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=15% /&amp;gt;&lt;br /&gt;
      &amp;lt;col width=25% /&amp;gt;&lt;br /&gt;
    &amp;lt;/colgroup&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Commenter&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Vote&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Comment&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestioncomment in @suggestion.suggestion_comments %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=suggestioncomment.commenter %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;%if suggestioncomment.vote == 'Y' %&amp;gt;&lt;br /&gt;
                Yes&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'N'%&amp;gt;&lt;br /&gt;
                No&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'R'%&amp;gt;&lt;br /&gt;
                Revise&lt;br /&gt;
                &amp;lt;!-- Two more crieteria for displaying comments. During Approval and Denial. Issue #1781-718 --&amp;gt;&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'A'%&amp;gt;&lt;br /&gt;
                Approved&lt;br /&gt;
            &amp;lt;%elsif suggestioncomment.vote == 'D'%&amp;gt;&lt;br /&gt;
                Denied&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
                --&lt;br /&gt;
            &amp;lt;%end%&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td class=&amp;quot;listingRow&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= suggestioncomment.comments%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= link_to &amp;quot;Edit Comment&amp;quot;,{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;edit_comment&amp;quot;,:suggestioncomment=&amp;gt;suggestioncomment}%&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*To add a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' %&amp;gt;&lt;br /&gt;
  &amp;lt;b&amp;gt;Add new comment and vote&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag :action =&amp;gt; 'submit', :id =&amp;gt; @suggestion do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= text_area &amp;quot;suggestion_comment&amp;quot;, &amp;quot;comments&amp;quot;, :rows =&amp;gt; 5, :cols =&amp;gt; 50 %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;%= &amp;quot;Vote&amp;quot;%&amp;gt;&lt;br /&gt;
      &amp;lt;%= select(&amp;quot;suggestion_comment&amp;quot;,&amp;quot;vote&amp;quot;,{&amp;quot;Yes&amp;quot; =&amp;gt;&amp;quot;Y&amp;quot;,&amp;quot;No&amp;quot;=&amp;gt;&amp;quot;N&amp;quot;,&amp;quot;Revise&amp;quot;=&amp;gt;&amp;quot;R&amp;quot;}) %&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Submit vote&amp;quot;, :name =&amp;gt; 'add_comment' %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @suggestion.status != 'Approved' &amp;amp;&amp;amp; @suggestion.status != 'Rejected' &amp;amp;&amp;amp; session[:user] != nil &amp;amp;&amp;amp; (session[:user].role_id == 2 || session[:user].role_id == 3 || session[:user].role_id == 4) %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Approve suggestion&amp;quot;, :name =&amp;gt; 'approve_suggestion' %&amp;gt;&lt;br /&gt;
            &amp;lt;%= submit_tag &amp;quot;Reject suggestion&amp;quot;, :name =&amp;gt; 'reject_suggestion' %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::2. '''app/views/suggestion/edit_comment.html.erb'''&lt;br /&gt;
::*Link to form for editing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt; Editing suggestion comments&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt;&amp;quot;form_comment&amp;quot;, suggestion_comment: @suggestioncomment %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%#= link_to 'Back', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::3. '''app/views/suggestion/_form_comment.html.erb'''&lt;br /&gt;
::*Form for editing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_for :suggestioncomment,:url=&amp;gt;{:controller=&amp;gt;&amp;quot;suggestion&amp;quot;,:action=&amp;gt;&amp;quot;update_comment&amp;quot;,:id=&amp;gt;@suggestioncomment.id},:method=&amp;gt;&amp;quot;post&amp;quot;  do |form|%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :comments %&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_area :comments,value: @suggestioncomment.comments,:rows =&amp;gt; 5, :cols =&amp;gt; 50%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div class = &amp;quot;field&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.label :vote%&amp;gt;&lt;br /&gt;
      &amp;lt;%= form.text_field :vote,value: @suggestioncomment.vote %&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :suggestioncomment,value: @suggestioncomment%&amp;gt;&lt;br /&gt;
    &amp;lt;%= form.hidden_field :id,value: @suggestioncomment.suggestion_id%&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;actions&amp;quot;&amp;gt;&lt;br /&gt;
      Click to Update&lt;br /&gt;
      &amp;lt;%= form.submit%&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;%= link_to 'Back',:controller=&amp;gt;&amp;quot;suggestion&amp;quot;, :action =&amp;gt; &amp;quot;show&amp;quot;,:id =&amp;gt; @suggestioncomment.suggestion_id %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::4. '''app/controllers/suggestion_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
::*For approving and rejecting suggestions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def approve_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of approval as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when approval is made and saving those in&lt;br /&gt;
    # Database with Vote type as A - meaning approval&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'A', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
    end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Accepted')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully accepted.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when accepting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def reject_suggestion&lt;br /&gt;
    # 1781 - 718 issue&lt;br /&gt;
    # The Instructor should be able to give feed backs during the times of rejection as well.&lt;br /&gt;
    # Thus we are getting the comments through the request when denial is made and saving those in&lt;br /&gt;
    # Database with Vote type as D - meaning reject&lt;br /&gt;
    if params[:suggestion_comment][:comments] &amp;amp;&amp;amp; params[:suggestion_comment][:comments] != &amp;quot;&amp;quot;&lt;br /&gt;
      @suggestioncomment = SuggestionComment.new(vote: 'D', comments: params[:suggestion_comment][:comments])&lt;br /&gt;
      @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
      @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
      @suggestioncomment.save&lt;br /&gt;
      end&lt;br /&gt;
    @suggestion = Suggestion.find(params[:id])&lt;br /&gt;
&lt;br /&gt;
    if @suggestion.update_attribute('status', 'Rejected')&lt;br /&gt;
      flash[:notice] = 'The suggestion has been successfully rejected.'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = 'An error occurred when rejecting the suggestion.'&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to action: 'show', id: @suggestion&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For adding a comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.new(vote: params[:suggestion_comment][:vote], comments: params[:suggestion_comment][:comments])&lt;br /&gt;
    @suggestioncomment.suggestion_id = params[:id]&lt;br /&gt;
    @suggestioncomment.commenter = session[:user].name&lt;br /&gt;
    if @suggestioncomment.save&lt;br /&gt;
      flash[:notice] = &amp;quot;Your comment has been successfully added.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;There was an error in adding your comment.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if current_role_name.eql? 'Student'&lt;br /&gt;
      redirect_to action: &amp;quot;student_view&amp;quot;, id: params[:id]&lt;br /&gt;
    else&lt;br /&gt;
      redirect_to action: &amp;quot;show&amp;quot;, id: params[:id]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For editing comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def edit_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:suggestioncomment])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::*For updating comments:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def update_comment&lt;br /&gt;
    @suggestioncomment = SuggestionComment.find(params[:id])&lt;br /&gt;
    @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
    #if @suggestioncomment.update(suggestioncomment_params)&lt;br /&gt;
      #redirect_to :action=&amp;gt;&amp;quot;show&amp;quot;,:id=&amp;gt;@suggestioncomment.suggestion_id&lt;br /&gt;
    #end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Images showing the jist for testing&lt;br /&gt;
&lt;br /&gt;
==== '''Further Implementation Required''' ====&lt;br /&gt;
&lt;br /&gt;
==== '''Testing''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''UI Testing''' =====&lt;br /&gt;
::The following steps should be followed to test the functionality:&lt;br /&gt;
::1. Login as a student2065/2064/2066 with password:password&lt;br /&gt;
::2. Select any assignment,for example Click on view(RHS of the assignment)&amp;quot;wiki Textbook&amp;quot; and then click on &amp;quot;suggest a topic&amp;quot;&lt;br /&gt;
[[File:File-Capture(stu_1).PNG|8px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Capture(stu_2).PNG|x8px|]]&lt;br /&gt;
::3. Add your suggestion&lt;br /&gt;
[[File:Capture(stu_3).PNG|10x|]]&lt;br /&gt;
::4. Login as instructor6 and password:password&lt;br /&gt;
::5. Go to assignments and search for &amp;quot;wiki textbook&amp;quot;&lt;br /&gt;
[[File:Capture(a).PNG]]&lt;br /&gt;
::6. Click on the &amp;quot;view suggestion&amp;quot; icon on the right side of the screen&lt;br /&gt;
::7. Add a comment on that suggestion and submit&lt;br /&gt;
[[File:File-Capture(sugg comm).PNG]]&lt;br /&gt;
::8. Can edit the comment by clicking on the &amp;quot;Edit Comment&amp;quot; button.&lt;br /&gt;
[[File:Capture(edit).PNG]]&lt;br /&gt;
::9. Login as student and you can see the comment when you go to the assignment and associated topic.&lt;br /&gt;
::&lt;br /&gt;
::&lt;br /&gt;
::Tests have been added to the spec for testing the above functionality.The following changes are made to the related spec files.&lt;br /&gt;
::'''spec/features/topic_suggestion_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
===== '''Automatic Testing''' ======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#part 2###########################&lt;br /&gt;
      #######part 2#####################&lt;br /&gt;
      #############part 2###############issue 718&lt;br /&gt;
      ###################part 2#########&lt;br /&gt;
      #########################part 2###&lt;br /&gt;
      describe &amp;quot;topic_suggestion&amp;quot; do&lt;br /&gt;
        it &amp;quot;Instructor set an assignment which allow student suggest topic and register student2066&amp;quot; do&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2066 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          # DUE date need to be added here&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        it &amp;quot; student2066 hold suggest topic and suggest a new one and student2064 enroll on waitlist of suggested topic&amp;quot;, js: true do&lt;br /&gt;
          # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # student2064 suggest topic&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          click_link('View',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          # case 2 student already have topic switch to new topic&lt;br /&gt;
          # need two students one to be on the waitlist of previous suggested topic,&lt;br /&gt;
          # the other one (student2064) is holding it and suggest another topic and wish to switch to the new one&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          first(&amp;quot;img[title='Signup']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # log in student2064&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
          click_link('Suggest a topic',match: :first)&lt;br /&gt;
          fill_in 'suggestion_title', with: 'suggested_topic2_will_switch'&lt;br /&gt;
          fill_in 'suggestion_description', with: 'suggested_description_2'&lt;br /&gt;
          click_button 'Submit',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login_as instructor6 to approve the 2nd suggested topic&lt;br /&gt;
          user = User.find_by(name: 'instructor6')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
          # instructor approve the suggestion topic&lt;br /&gt;
          visit '/tree_display/list'&lt;br /&gt;
          visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
          expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          # find link for new suggested view&lt;br /&gt;
          visit '/suggestion/2'&lt;br /&gt;
          # click_link('View')&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
          click_button 'Approve suggestion',match: :first&lt;br /&gt;
          expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as student 2064 to switch to new approved topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
          click_link('Signup sheet',match: :first)&lt;br /&gt;
          expect(page).to have_content &amp;quot;Your approved suggested topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
          first(&amp;quot;img[title='Switch Topic']&amp;quot;).click&lt;br /&gt;
&lt;br /&gt;
          # login as student 2066 to see if it's holding the topic rather than on the wait list&lt;br /&gt;
          user = User.find_by(name: 'student2066')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # login as studnet 2064 to see if it's already shifted to the new suggested topic&lt;br /&gt;
          user = User.find_by(name: 'student2064')&lt;br /&gt;
          stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
          visit '/student_task/list'&lt;br /&gt;
          expect(page).to have_content &amp;quot;suggested_topic2_will_switch&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ########################################&lt;br /&gt;
    # Case 3:&lt;br /&gt;
    # One team is holding a topic. They sent a suggestion for new topic, and keep themselves in old topic&lt;br /&gt;
    ########################################&lt;br /&gt;
    it &amp;quot;student2066 hold suggest topic and suggest a new one, but wish to stay in the old topic&amp;quot;, js: true do&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      # DUE date need to be added here&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      ######################################&lt;br /&gt;
      # One team is holding a topic. They sent a suggestion for new topic&lt;br /&gt;
      ######################################&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2066 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic2_without_switch'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description2_without_switch'&lt;br /&gt;
      find('#suggestion_signup_preference').find(:xpath, 'option[2]').select_option&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;Thank you for your suggestion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;instructor6&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/tree_display/list'&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, text: 'View').click&lt;br /&gt;
      # click_link('View')&lt;br /&gt;
&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description2_without_switch&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2066&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2066')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      # click_link('publish_approved_suggested_topic')&lt;br /&gt;
      visit '/sign_up_sheet/publish_approved_suggested_topic/2?assignment_id=1'&lt;br /&gt;
      # find(:xpath, &amp;quot;//tr[contains(.,'suggested_topic2_without_switch')]/td/a&amp;quot;, :figure=&amp;gt;&amp;quot;Publish Topic&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Signup sheet&amp;quot;&lt;br /&gt;
      click_link('Signup sheet',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
      find(:xpath, &amp;quot;(//img[@title='Signup'])[2]&amp;quot;).click&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot; suggested_topic2_without_switch&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;professor could approve anonymous suggestion topic&amp;quot; do&lt;br /&gt;
      # login_as &amp;quot;student2064&amp;quot;&lt;br /&gt;
      user = User.find_by(name: 'student2064')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
      visit '/student_task/list'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Assignment_suggest_topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # student2064 suggest topic&lt;br /&gt;
      click_link('Assignment_suggest_topic',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggest a topic&amp;quot;&lt;br /&gt;
      click_link('Suggest a topic',match: :first)&lt;br /&gt;
      fill_in 'suggestion_title', with: 'suggested_topic'&lt;br /&gt;
      fill_in 'suggestion_description', with: 'suggested_description'&lt;br /&gt;
      find(:xpath, &amp;quot;//input[@name='suggestion_anonymous']&amp;quot;).click&lt;br /&gt;
      click_button 'Submit',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;You have submitted an anonymous suggestion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      user = User.find_by(name: 'instructor6')&lt;br /&gt;
      stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
&lt;br /&gt;
      # instructor approve the suggestion topic&lt;br /&gt;
      visit '/suggestion/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
      expect(page).to have_content &amp;quot;Suggested topics for Assignment_suggest_topic&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_topic&amp;quot;&lt;br /&gt;
      click_link('View',match: :first)&lt;br /&gt;
      expect(page).to have_content &amp;quot;suggested_description&amp;quot;&lt;br /&gt;
      click_button 'Approve suggestion',match: :first&lt;br /&gt;
      expect(page).to have_content &amp;quot;The suggestion was successfully approved.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Further Testing Required''' ====&lt;br /&gt;
::More tests need to be added to test whether an instructor can edit a comment or not.&lt;/div&gt;</summary>
		<author><name>Pkeny</name></author>
	</entry>
</feed>