<?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=Mjain6</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=Mjain6"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mjain6"/>
	<updated>2026-07-26T02:35:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119789</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119789"/>
		<updated>2018-11-13T22:39:28Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Problem Statement'''=&lt;br /&gt;
A key component of Expertiza is peer reviews, which provide feedback to authors so that they can improve their work. Expertiza also supports grading of these reviews to ensure students write quality reviews, helping them learn more about the assignment by looking at their peers' work. In addition, Expertiza allows for metareviews, which are reviews the authors of the original work write for the reviews of their original work. This author feedback is useful for grading the reviews because it indicates how helpful this review was to the authors of the original work. The objective of this project is to add metareview or author feedback information to the review report page, which shows a summary of all the reviews written by the students for an assignment.&lt;br /&gt;
&lt;br /&gt;
='''Goal'''=&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
='''Design'''=&lt;br /&gt;
&lt;br /&gt;
== User Interface Enhancements ==&lt;br /&gt;
&lt;br /&gt;
In the page &amp;quot;Review report for Design exercise&amp;quot; (Log in as an instructor then go to Manage -&amp;gt; Assignments -&amp;gt; View review report.), we are planning to add one more column to show the average ratings for the author feedback for a student's review of a particular assignment. The logic for calculating the average score for the metareviews would be similar to already implemented logic for the &amp;quot;Score Awarded/Average Score&amp;quot; column. Below is the page we are planning to edit.&lt;br /&gt;
&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Controller-level Logic ==&lt;br /&gt;
&lt;br /&gt;
The following method shows the code logic we are planning to write for calculating the average scores for the feedback given by authors for the reviews of their work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
 def calculate_avg_score_by_feedback(question_answers, q_max_score)&lt;br /&gt;
      # get score and summary of answers for each question&lt;br /&gt;
      # only include divide the valid_answer_sum with the number of valid answers&lt;br /&gt;
&lt;br /&gt;
      valid_answer_counter = 0&lt;br /&gt;
      question_score = 0.0&lt;br /&gt;
      question_answers.each do |ans|&lt;br /&gt;
        # calculate score per question&lt;br /&gt;
        unless ans.answer.nil?&lt;br /&gt;
          question_score += ans.answer&lt;br /&gt;
          valid_answer_counter += 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      if valid_answer_counter &amp;gt; 0 and q_max_score &amp;gt; 0&lt;br /&gt;
        # convert the score in percentage&lt;br /&gt;
        question_score /= (valid_answer_counter * q_max_score)&lt;br /&gt;
        question_score = question_score.round(2) * 100&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      question_score&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Relevant Database Tables ==&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for this feature. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire are saved in the Answers table below based on the Question ID. Now, in order to know if the answer is a feedback by team members or a review by reviewer, the mapping for the Answers table is done by the response_id which is a foreign key to the Response table. This Response table gives us the map_id which maps to a response map table. Now, the response map table gives us information on the reviewer_id, reviewee_id, reviewed_object_id (which is the ID for the assignment being reviewed) and the type (whether it's a teammate review, author feedback, a regular review, etc.). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a previous reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions for the corresponding ReviewScores table. Below are excerpts from the [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza database documentation] which describe the database tables relevant to our design.&lt;br /&gt;
&lt;br /&gt;
=== Questions Table Structure ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Answer Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Map Table ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Files that will be changed ==&lt;br /&gt;
&lt;br /&gt;
1. To calculate average author feedback score: https://github.com/jainmohit1/expertiza/blob/master/app/models/on_the_fly_calc.rb&lt;br /&gt;
&lt;br /&gt;
2. To populate average author feedback score for the view: the https://github.com/jainmohit1/expertiza/blob/master/app/controllers/review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. To add a field in the view: https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/response_report.html.haml&lt;br /&gt;
&lt;br /&gt;
4. To add a field in the partial : https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/_review_report.html.erb&lt;br /&gt;
&lt;br /&gt;
5. To add a field in the partial:  https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/_team_score.html.erb&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
We plan to test the response report page (/review_mapping/response_report?id={:assignmentID}) to make sure the new field (average author feedback) exists.&lt;br /&gt;
&lt;br /&gt;
Using [http://rspec.info/ RSpec] we will add a test case to review_mapping_controller_spec.rb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'when type is FeedbackResponseMap' do&lt;br /&gt;
      context 'when assignment has author feedback feature' do&lt;br /&gt;
        it 'renders response_report page with average author feedback data' do&lt;br /&gt;
          allow(assignment).to receive(:varying_rubrics_by_round?).and_return(true)&lt;br /&gt;
          allow(FeedbackResponseMap).to receive(:feedback_response_report).with('1', 'FeedbackResponseMap')&lt;br /&gt;
                                                                          .and_return([participant, participant1], [1, 2], [3, 4], [])&lt;br /&gt;
          params = {&lt;br /&gt;
            id: 1,&lt;br /&gt;
            report: {type: 'FeedbackResponseMap'},&lt;br /&gt;
          }&lt;br /&gt;
          get :response_report, params&lt;br /&gt;
          expect(response).to render_template(:response_report)&lt;br /&gt;
          expect(response).to have(:avg_author_feedback)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also plan to manually test the response report page to make sure the new field is aligning well in the UI in the expected place. We will attach the screenshot of the UI as the test result. We will test the cases of one and multiple reviews by a reviewer and verify the number and average scores of the metareviews for those reviews are rendered correctly.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
1. http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;br /&gt;
&lt;br /&gt;
2. https://github.com/jainmohit1/expertiza&lt;br /&gt;
&lt;br /&gt;
3. https://github.com/expertiza/expertiza/pull/1290&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119786</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119786"/>
		<updated>2018-11-13T22:36:48Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Controller-level Logic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Problem Statement'''=&lt;br /&gt;
A key component of Expertiza is peer reviews, which provide feedback to authors so that they can improve their work. Expertiza also supports grading of these reviews to ensure students write quality reviews, helping them learn more about the assignment by looking at their peers' work. In addition, Expertiza allows for metareviews, which are reviews the authors of the original work write for the reviews of their original work. This author feedback is useful for grading the reviews because it indicates how helpful this review was to the authors of the original work. The objective of this project is to add metareview or author feedback information to the review report page, which shows a summary of all the reviews written by the students for an assignment.&lt;br /&gt;
&lt;br /&gt;
='''Goal'''=&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
='''Design'''=&lt;br /&gt;
&lt;br /&gt;
== User Interface Enhancements ==&lt;br /&gt;
&lt;br /&gt;
In the page &amp;quot;Review report for Design exercise&amp;quot; (Log in as an instructor then go to Manage -&amp;gt; Assignments -&amp;gt; View review report.), we are planning to add one more column to show the average ratings for the author feedback for a student's review of a particular assignment. The logic for calculating the average score for the metareviews would be similar to already implemented logic for the &amp;quot;Score Awarded/Average Score&amp;quot; column. Below is the page we are planning to edit.&lt;br /&gt;
&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Controller-level Logic ==&lt;br /&gt;
&lt;br /&gt;
The following method shows the code logic we are planning to write for calculating the average scores for the feedback given by authors for the reviews of their work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
 def calculate_avg_score_by_feedback(question_answers, q_max_score)&lt;br /&gt;
      # get score and summary of answers for each question&lt;br /&gt;
      # only include divide the valid_answer_sum with the number of valid answers&lt;br /&gt;
&lt;br /&gt;
      valid_answer_counter = 0&lt;br /&gt;
      question_score = 0.0&lt;br /&gt;
      question_answers.each do |ans|&lt;br /&gt;
        # calculate score per question&lt;br /&gt;
        unless ans.answer.nil?&lt;br /&gt;
          question_score += ans.answer&lt;br /&gt;
          valid_answer_counter += 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      if valid_answer_counter &amp;gt; 0 and q_max_score &amp;gt; 0&lt;br /&gt;
        # convert the score in percentage&lt;br /&gt;
        question_score /= (valid_answer_counter * q_max_score)&lt;br /&gt;
        question_score = question_score.round(2) * 100&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      question_score&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Relevant Database Tables ==&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for this feature. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire are saved in the Answers table below based on the Question ID. Now, in order to know if the answer is a feedback by team members or a review by reviewer, the mapping for the Answers table is done by the response_id which is a foreign key to the Response table. This Response table gives us the map_id which maps to a response map table. Now, the response map table gives us information on the reviewer_id, reviewee_id, reviewed_object_id (which is the ID for the assignment being reviewed) and the type (whether it's a teammate review, author feedback, a regular review, etc.). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a previous reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions for the corresponding ReviewScores table. Below are excerpts from the [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza database documentation] which describe the database tables relevant to our design.&lt;br /&gt;
&lt;br /&gt;
=== Questions Table Structure ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Answer Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Map Table ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Files that will be changed ==&lt;br /&gt;
&lt;br /&gt;
1. https://github.com/jainmohit1/expertiza/blob/master/app/models/on_the_fly_calc.rb&lt;br /&gt;
&lt;br /&gt;
2. https://github.com/jainmohit1/expertiza/blob/master/app/controllers/review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
3. https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/response_report.html.haml&lt;br /&gt;
&lt;br /&gt;
4. https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/_review_report.html.erb&lt;br /&gt;
&lt;br /&gt;
5. https://github.com/jainmohit1/expertiza/blob/master/app/views/review_mapping/_team_score.html.erb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
We plan to test the response report page (/review_mapping/response_report?id={:assignmentID}) to make sure the new field (average author feedback) exists.&lt;br /&gt;
&lt;br /&gt;
Using [http://rspec.info/ RSpec] we will add a test case to review_mapping_controller_spec.rb.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    context 'when type is FeedbackResponseMap' do&lt;br /&gt;
      context 'when assignment has author feedback feature' do&lt;br /&gt;
        it 'renders response_report page with average author feedback data' do&lt;br /&gt;
          allow(assignment).to receive(:varying_rubrics_by_round?).and_return(true)&lt;br /&gt;
          allow(FeedbackResponseMap).to receive(:feedback_response_report).with('1', 'FeedbackResponseMap')&lt;br /&gt;
                                                                          .and_return([participant, participant1], [1, 2], [3, 4], [])&lt;br /&gt;
          params = {&lt;br /&gt;
            id: 1,&lt;br /&gt;
            report: {type: 'FeedbackResponseMap'},&lt;br /&gt;
          }&lt;br /&gt;
          get :response_report, params&lt;br /&gt;
          expect(response).to render_template(:response_report)&lt;br /&gt;
          expect(response).to have(:avg_author_feedback)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also plan to manually test the response report page to make sure the new field is aligning well in the UI in the expected place. We will attach the screenshot of the UI as the test result. We will test the cases of one and multiple reviews by a reviewer and verify the number and average scores of the metareviews for those reviews are rendered correctly.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
1. http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;br /&gt;
&lt;br /&gt;
2. https://github.com/jainmohit1/expertiza&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119758</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119758"/>
		<updated>2018-11-13T21:06:44Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Code Logic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Problem Statement'''=&lt;br /&gt;
In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide a feedback for this review in terms of ‘Author feedback’. While grading peer reviews, it would be nice for the instructors to take into account the author feedbacks given on a particular peer review, this will be helpful in evaluating how helpful the peer review actually was to the author of the project.&lt;br /&gt;
 &lt;br /&gt;
='''Goal'''=&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
='''Design'''=&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for mapping. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire is saved in Answers table below based on Question ID. Now, in order to know if the answers is a feedback by team members or a review by reviewer, the mapping for Answers table is done by response_id which is a foreign key to response table. Response table gives us map_id which maps to Response Maps table. Now, Response Map table gives us information of the reviewer_id, reviewee_id, reviewed_object_id (which is the id for the assignment being reviewed) and the type (whether it's a teammate review, author feedback or a regular review). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions from Review_Scores table. &lt;br /&gt;
&lt;br /&gt;
=== Questions Table Structure===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Answer Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Table Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Response Map Table ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Implementation ==&lt;br /&gt;
&lt;br /&gt;
In the page Review report for Design exercise ( login as an instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View review report ), we are planning to add one more column to show the average ratings for the authors feedback on a particular assignment. The logic for calculating the average score for the feedback would be similar to already implemented logic for score awarded/ average score column. Below attached shows the page we are planning to edit.&lt;br /&gt;
&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
== Code Logic ==&lt;br /&gt;
&lt;br /&gt;
Following shows the code logic we are planning to write for calculating the avg scores for the feedback given by authors.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
 def calculate_avg_score_by_criterion(question_answers, q_max_score)&lt;br /&gt;
      # get score and summary of answers for each question&lt;br /&gt;
      # only include divide the valid_answer_sum with the number of valid answers&lt;br /&gt;
&lt;br /&gt;
      valid_answer_counter = 0&lt;br /&gt;
      question_score = 0.0&lt;br /&gt;
      question_answers.each do |ans|&lt;br /&gt;
        # calculate score per question&lt;br /&gt;
        unless ans.answer.nil?&lt;br /&gt;
          question_score += ans.answer&lt;br /&gt;
          valid_answer_counter += 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      if valid_answer_counter &amp;gt; 0 and q_max_score &amp;gt; 0&lt;br /&gt;
        # convert the score in percentage&lt;br /&gt;
        question_score /= (valid_answer_counter * q_max_score)&lt;br /&gt;
        question_score = question_score.round(2) * 100&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      question_score&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
* Plan to test the response report page (/review_mapping/response_report?id={:assignmentID}) to make sure the new field (avg author feedback) exists&lt;br /&gt;
** Using rspec we will add a test case to ReviewMappingControllerSpec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    context 'when type is FeedbackResponseMap' do&lt;br /&gt;
      context 'when assignment has author feedback feature' do&lt;br /&gt;
        it 'renders response_report page with average author feedback data' do&lt;br /&gt;
          allow(assignment).to receive(:varying_rubrics_by_round?).and_return(true)&lt;br /&gt;
          allow(FeedbackResponseMap).to receive(:feedback_response_report).with('1', 'FeedbackResponseMap')&lt;br /&gt;
                                                                          .and_return([participant, participant1], [1, 2], [3, 4], [])&lt;br /&gt;
          params = {&lt;br /&gt;
            id: 1,&lt;br /&gt;
            report: {type: 'FeedbackResponseMap'},&lt;br /&gt;
          }&lt;br /&gt;
          get :response_report, params&lt;br /&gt;
          expect(response).to render_template(:response_report)&lt;br /&gt;
          expect(response).to have(:avg_author_feedback)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Also, we plan to test the response report page to make sure the new field is alighning well in the UI in the expected place&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
1) http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119725</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119725"/>
		<updated>2018-11-13T19:34:38Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* UI Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
&lt;br /&gt;
In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide a feedback for this review in terms of ‘Author feedback’. While grading peer reviews, it would be nice for the instructors to take into account the author feedbacks given on a particular peer review, this will be helpful in evaluating how helpful the peer review actually was to the author of the project.&lt;br /&gt;
 &lt;br /&gt;
= Goal =&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for mapping. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire is saved in Answers table below based on Question ID. Now, in order to know if the answers is a feedback by team members or a review by reviewer, the mapping for Answers table is done by response_id which is a foreign key to response table. Response table gives us map_id which maps to Response Maps table. Now, Response Map table gives us information of the reviewer_id, reviewee_id, reviewed_object_id (which is the id for the assignment being reviewed) and the type (whether it's a teammate review, author feedback or a regular review). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions from Review_Scores table. &lt;br /&gt;
&lt;br /&gt;
== Questions Table Structure==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Answer Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Map Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Implementation ==&lt;br /&gt;
&lt;br /&gt;
In the page Review report for Design exercise ( login as an instructor -&amp;gt; Manage -&amp;gt; Assignments -&amp;gt; View review report ), we are planning to add one more column to show the average ratings for the authors feedback on a particular assignment. The logic for calculating the average score for the feedback would be similar to already implemented logic for score awarded/ average score column. Below attached shows the page we are planning to edit.&lt;br /&gt;
&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
= References =&lt;br /&gt;
1) http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119722</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119722"/>
		<updated>2018-11-13T19:27:00Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Response Map Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
&lt;br /&gt;
In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide a feedback for this review in terms of ‘Author feedback’. While grading peer reviews, it would be nice for the instructors to take into account the author feedbacks given on a particular peer review, this will be helpful in evaluating how helpful the peer review actually was to the author of the project.&lt;br /&gt;
 &lt;br /&gt;
= Goal =&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for mapping. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire is saved in Answers table below based on Question ID. Now, in order to know if the answers is a feedback by team members or a review by reviewer, the mapping for Answers table is done by response_id which is a foreign key to response table. Response table gives us map_id which maps to Response Maps table. Now, Response Map table gives us information of the reviewer_id, reviewee_id, reviewed_object_id (which is the id for the assignment being reviewed) and the type (whether it's a teammate review, author feedback or a regular review). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions from Review_Scores table. &lt;br /&gt;
&lt;br /&gt;
== Questions Table Structure==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Answer Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Map Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Implementation ==&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
= References =&lt;br /&gt;
1) http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119721</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119721"/>
		<updated>2018-11-13T19:26:14Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Response Map Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
&lt;br /&gt;
In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide a feedback for this review in terms of ‘Author feedback’. While grading peer reviews, it would be nice for the instructors to take into account the author feedbacks given on a particular peer review, this will be helpful in evaluating how helpful the peer review actually was to the author of the project.&lt;br /&gt;
 &lt;br /&gt;
= Goal =&lt;br /&gt;
&lt;br /&gt;
The aim of this project is to build this into the system. We need an additional column in the 'Review Report' page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for mapping. First, the questions table has all the questions based on the questionnaire. We will be only concerned with the questions in the feedback questionnaire. The answers for each question in the feedback questionnaire is saved in Answers table below based on Question ID. Now, in order to know if the answers is a feedback by team members or a review by reviewer, the mapping for Answers table is done by response_id which is a foreign key to response table. Response table gives us map_id which maps to Response Maps table. Now, Response Map table gives us information of the reviewer_id, reviewee_id, reviewed_object_id (which is the id for the assignment being reviewed) and the type (whether it's a teammate review, author feedback or a regular review). We will have to fetch the answers from the Answer table based on response_id because in our case, the response is from a reviewee and not a reviewer. So, we will fetch those answers whose response type is FeedbackResponseMap and calculate scores for those questions from Review_Scores table. &lt;br /&gt;
&lt;br /&gt;
== Questions Table Structure==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Answer Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Map Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Feedback_new.png]]&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
= References =&lt;br /&gt;
1) http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Feedback_new.png&amp;diff=119715</id>
		<title>File:Feedback new.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Feedback_new.png&amp;diff=119715"/>
		<updated>2018-11-13T19:16:56Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: UI where we are planning to add a new column for the average ratings received from the authors.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UI where we are planning to add a new column for the average ratings received from the authors.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119712</id>
		<title>CSC/ECE 517 Fall 2018/E1876 Completion/Progress view</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1876_Completion/Progress_view&amp;diff=119712"/>
		<updated>2018-11-13T19:09:16Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Problem Statement =&lt;br /&gt;
&lt;br /&gt;
In Expertiza, peer reviews are used as a metric to evaluate someone’s project. Once someone has peer reviewed a project, the authors of the project can also provide a feedback for this review in terms of ‘Author feedback’. While grading peer reviews, it would be nice for the instructors to take into account the author feedbacks given on a particular peer review, this will be helpful in evaluating how helpful the peer review actually was to the author of the project. The aim of this project is to build this into the system. We need an additional column in the summary page for reviews which shows the calculation of the author feedback. This will help instructor's to know how the reviews proved useful to the authors/team. The aim of this project is to integrate the author feedback column in the summary page&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
The following are the table structures we will need for mapping. First, the questions table has all the questions based on the questionnaire. &lt;br /&gt;
== Questions Table Structure==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Questions page already exists,so created a page with the name Questions table and gave an external link on the tables page--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!txt   &lt;br /&gt;
|text  &lt;br /&gt;
|the question string&lt;br /&gt;
|- &lt;br /&gt;
!weight   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|specifies the weighting of the question&lt;br /&gt;
|- &lt;br /&gt;
!questionnaire_id   &lt;br /&gt;
|int(11)&lt;br /&gt;
|the id of the questionnaire that this question belongs to&lt;br /&gt;
|-&lt;br /&gt;
!seq&lt;br /&gt;
|DECIMAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Type of question&lt;br /&gt;
|-&lt;br /&gt;
!size&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Size of the question&lt;br /&gt;
|-&lt;br /&gt;
!alternatives&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|Other question which means the same&lt;br /&gt;
|-&lt;br /&gt;
!break_before&lt;br /&gt;
|BIT&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!max_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!min_label&lt;br /&gt;
|VARCHAR(255)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Answer Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|- &lt;br /&gt;
!id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Unique ID for each Answers record.&lt;br /&gt;
|- &lt;br /&gt;
!question_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of Question.&lt;br /&gt;
|- &lt;br /&gt;
!answer   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|Value of each of the answer.&lt;br /&gt;
|- &lt;br /&gt;
!comments  &lt;br /&gt;
|text  &lt;br /&gt;
|Comment given to the answer.&lt;br /&gt;
|- &lt;br /&gt;
!reponse_id   &lt;br /&gt;
|int(11) &lt;br /&gt;
|ID of the response associated with this Answer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Table Structure ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|-&lt;br /&gt;
!map_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The ID of the [[response_maps|response map]] defining the relationship that this response applies to&lt;br /&gt;
|-&lt;br /&gt;
!additional_comment&lt;br /&gt;
|text&lt;br /&gt;
|An additional comment provided by the reviewer to support his/her response&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was last modified&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|datetime&lt;br /&gt;
|The timestamp indicating when this response was created&lt;br /&gt;
|-&lt;br /&gt;
!version_num&lt;br /&gt;
|int(11)&lt;br /&gt;
|The version of the review.&lt;br /&gt;
|-&lt;br /&gt;
!round&lt;br /&gt;
|int(11)&lt;br /&gt;
|The round the review is connected to. &lt;br /&gt;
|-&lt;br /&gt;
!is_submitted&lt;br /&gt;
|tinyint(1)&lt;br /&gt;
|Boolean Field to indicate whether the review is submitted.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Response Map Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The unique record id&lt;br /&gt;
|- &lt;br /&gt;
!reviewed_object_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The object being reviewed in the [[responses|response]]. Possible objects include other ResponseMaps or [[assignments]]&lt;br /&gt;
|-&lt;br /&gt;
!reviewer_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[participants|participant]] (actually AssignmentParticipant) providing the response&lt;br /&gt;
|-&lt;br /&gt;
!reviewee_id&lt;br /&gt;
|int(11)&lt;br /&gt;
|The [[teams|team]] (AssignmentTeam) receiving the response&lt;br /&gt;
|-&lt;br /&gt;
!type&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|Used for subclassing the response map. Available subclasses are ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, TeammateReviewResponseMap  &lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time for when the record was created&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|DATETIME&lt;br /&gt;
|Date and Time when the last update was made&lt;br /&gt;
|-&lt;br /&gt;
!calibrate_to&lt;br /&gt;
|BIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Test Plan =&lt;br /&gt;
= References =&lt;br /&gt;
1) http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119239</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119239"/>
		<updated>2018-11-10T03:01:08Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Functional Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Manage -&amp;gt; Assignments.&lt;br /&gt;
# After clicking on the Assignment tab, a page will show all the assignments. &lt;br /&gt;
# Click the view suggestions icon on the right bottom corner.&lt;br /&gt;
# You will be able to see a list of suggestions given by the students for that particular topic.&lt;br /&gt;
# Add feedback in the feedback text box and click save feedback button to save it.&lt;br /&gt;
# To verify if the feedback was saved to the table, query suggestions table and match the feedback in the feedback column to the feedback given.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119238</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119238"/>
		<updated>2018-11-10T03:00:44Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.JAX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.JAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Manage -&amp;gt; Assignments.&lt;br /&gt;
# After clicking on the Assignment tab, a page will show all the assignments. &lt;br /&gt;
# Click the view suggestions icon on the right bottom corner.&lt;br /&gt;
# You will be able to see a list of suggestions given by the students for that particular topic.&lt;br /&gt;
# Add feedback in the feedback text box and click save feedback button to save it.&lt;br /&gt;
# To verify if the feedback was saved to the table, query suggestions table and match the feedback in the feedback column to the feedback given.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119237</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119237"/>
		<updated>2018-11-10T02:59:48Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Functional Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.JAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Manage -&amp;gt; Assignments.&lt;br /&gt;
# After clicking on the Assignment tab, a page will show all the assignments. &lt;br /&gt;
# Click the view suggestions icon on the right bottom corner.&lt;br /&gt;
# You will be able to see a list of suggestions given by the students for that particular topic.&lt;br /&gt;
# Add feedback in the feedback text box and click save feedback button to save it.&lt;br /&gt;
# To verify if the feedback was saved to the table, query suggestions table.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119233</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119233"/>
		<updated>2018-11-10T02:48:05Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Functional Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.JAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119232</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119232"/>
		<updated>2018-11-10T02:47:21Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119231</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119231"/>
		<updated>2018-11-10T02:46:32Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Functional Testing ===&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119036</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119036"/>
		<updated>2018-11-09T06:36:23Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;!-- New Headers --&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Creating form to have an action on the new submit feedback button --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Adding id and type in the params object which is required to reload the same page again --&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119032</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=119032"/>
		<updated>2018-11-09T06:27:05Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  # Method to save/update feedback given by the instructor in the suggestions table in feedback column&lt;br /&gt;
  # After saving the data we redirect the user to the same page&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
===== Issue #971: Change create topic UI into AJAX =====&lt;br /&gt;
# Login as an instructor.&lt;br /&gt;
# Click Assignments tab next to Courses&lt;br /&gt;
# Select the assignment for which a new topic has to be added&lt;br /&gt;
# Click the edit icon for the assignment and go to Topics tab&lt;br /&gt;
# You will be able to see the topics list in a table format. Click on add icon on the right side corner of the table header&lt;br /&gt;
# Fill in the details and click save topic&lt;br /&gt;
&lt;br /&gt;
If a user tries to set number of slots as zero, a warning pops up and prohibits the user from doing so.&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118504</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118504"/>
		<updated>2018-11-03T02:58:42Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Suggestions list page before changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:BeforeFeedbackPage.png&amp;diff=118502</id>
		<title>File:BeforeFeedbackPage.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:BeforeFeedbackPage.png&amp;diff=118502"/>
		<updated>2018-11-03T02:58:04Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: New page for before page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New page for before page&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118500</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118500"/>
		<updated>2018-11-03T02:56:11Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPageNew.png]]&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118499</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118499"/>
		<updated>2018-11-03T02:55:03Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Suggestions list page before changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118498</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118498"/>
		<updated>2018-11-03T02:54:51Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Suggestions list page before changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118497</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118497"/>
		<updated>2018-11-03T02:54:39Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Suggestions list page before changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png|200px|thumb|left]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118489</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118489"/>
		<updated>2018-11-03T02:51:00Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:AfterFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118488</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118488"/>
		<updated>2018-11-03T02:50:10Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Suggestions list page before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:BeforeFeedbackPage.png]]&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118481</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118481"/>
		<updated>2018-11-03T02:40:50Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''expertiza/db/schema.rb''' ,schema changes as effect of adding column in table suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  create_table &amp;quot;suggestions&amp;quot;, force: :cascade do |t|&lt;br /&gt;
    t.integer &amp;quot;assignment_id&amp;quot;,     limit: 4&lt;br /&gt;
    t.string  &amp;quot;title&amp;quot;,             limit: 255&lt;br /&gt;
    t.text    &amp;quot;description&amp;quot;,       limit: 65535&lt;br /&gt;
    t.string  &amp;quot;status&amp;quot;,            limit: 255&lt;br /&gt;
    t.string  &amp;quot;unityID&amp;quot;,           limit: 255&lt;br /&gt;
    t.string  &amp;quot;signup_preference&amp;quot;, limit: 255&lt;br /&gt;
    t.string  &amp;quot;feedback&amp;quot;,          limit: 255&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118480</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118480"/>
		<updated>2018-11-03T02:33:34Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''db/migrate/20181027001119_add_feedback_to_suggestion.rb''' ,added migration scripts. Script is adding a column name &amp;quot;feedback&amp;quot; in the suggestions table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  class AddFeedbackToSuggestion &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def change&lt;br /&gt;
    add_column :suggestions, :feedback, :string&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118477</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118477"/>
		<updated>2018-11-03T02:30:47Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''',added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;
&lt;br /&gt;
On the file '''app/controllers/suggestion_controller.rb''' ,added an additional method to save the changes in the feedback text box to database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  def update_feedback&lt;br /&gt;
    Suggestion.find(params[:suggestion_id]).update_attributes(feedback: params[:suggestion][:feedback])&lt;br /&gt;
    redirect_to list_suggestion_index_path(:id =&amp;gt; params[:id], :type =&amp;gt; params[:type])&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118471</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118471"/>
		<updated>2018-11-03T02:14:09Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''' we added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118470</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118470"/>
		<updated>2018-11-03T02:13:29Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''' we added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;general&amp;quot; cellpadding=5 width=100% border=1&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Submitter's user name&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Feedback&amp;lt;/th&amp;gt;&lt;br /&gt;
      &amp;lt;th&amp;gt;Save&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% for suggestion in @suggestions %&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;listingRow&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;%= form_for :suggestion, :url =&amp;gt; update_feedback_suggestion_index_path(:suggestion_id =&amp;gt; suggestion.id, :id =&amp;gt; params[:id], :type =&amp;gt; params[:type])   	do |f| %&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;max-width: 200px&amp;quot;&amp;gt;&amp;lt;%=h suggestion.title %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.status %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%=h suggestion.unityID %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to 'View', :action =&amp;gt; 'show', :id =&amp;gt; suggestion %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	 &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.text_field :feedback %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= f.submit 'Save Feedback' %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tr&amp;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;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118469</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118469"/>
		<updated>2018-11-03T02:11:00Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/suggestion/list.html.erb''' we added an additional editable textbox and a submit button. On click of the button the feedback provided in the text box is saved to the database in a table name suggestions, column name feedback.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118465</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118465"/>
		<updated>2018-11-03T02:07:14Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
We should allow instructors to give feedback when accepting or rejecting topic suggestions. As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:AfterFeedbackPage.png&amp;diff=118463</id>
		<title>File:AfterFeedbackPage.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:AfterFeedbackPage.png&amp;diff=118463"/>
		<updated>2018-11-03T02:04:22Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_Feedback_page.png&amp;diff=118460</id>
		<title>File:Before Feedback page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_Feedback_page.png&amp;diff=118460"/>
		<updated>2018-11-03T02:00:57Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: uploaded a new version of &amp;amp;quot;File:Before Feedback page.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_Feedback_page.png&amp;diff=118458</id>
		<title>File:Before Feedback page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_Feedback_page.png&amp;diff=118458"/>
		<updated>2018-11-03T01:59:28Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118455</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118455"/>
		<updated>2018-11-03T01:56:48Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Files Added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
A possible solution would be to add a column in the views&amp;gt;suggestion&amp;gt;list.html.erb with a textbox in the table and “send” button and handle sending the comments when the send button is pressed in suggestion_controller.rb. Add an extra column called “feedback” in the suggestion table to store instructor’s comments to the suggested topics.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118365</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118365"/>
		<updated>2018-11-03T00:18:25Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Files Added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
* db/migrate/20181027001119_add_feedback_to_suggestion.rb&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
A possible solution would be to add a column in the views&amp;gt;suggestion&amp;gt;list.html.erb with a textbox in the table and “send” button and handle sending the comments when the send button is pressed in suggestion_controller.rb. Add an extra column called “feedback” in the suggestion table to store instructor’s comments to the suggested topics.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118363</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118363"/>
		<updated>2018-11-03T00:17:46Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Files modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
A possible solution would be to add a column in the views&amp;gt;suggestion&amp;gt;list.html.erb with a textbox in the table and “send” button and handle sending the comments when the send button is pressed in suggestion_controller.rb. Add an extra column called “feedback” in the suggestion table to store instructor’s comments to the suggested topics.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118361</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118361"/>
		<updated>2018-11-03T00:17:07Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Files modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
* app/views/suggestion/list.html.erb&lt;br /&gt;
* app/controllers/suggestion_controller.rb&lt;br /&gt;
* expertiza/db/schema.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
A possible solution would be to add a column in the views&amp;gt;suggestion&amp;gt;list.html.erb with a textbox in the table and “send” button and handle sending the comments when the send button is pressed in suggestion_controller.rb. Add an extra column called “feedback” in the suggestion table to store instructor’s comments to the suggested topics.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118352</id>
		<title>E1827 Topic management</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1827_Topic_management&amp;diff=118352"/>
		<updated>2018-11-03T00:13:14Z</updated>

		<summary type="html">&lt;p&gt;Mjain6: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the changes made according to the specification of E1827 OSS assignment for Fall 2018.&lt;br /&gt;
----&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
The following credentials are recommended for testing the changes:&lt;br /&gt;
&lt;br /&gt;
* Instructor Login: username: instructor6 password: password&lt;br /&gt;
* Youtube link: https://www.youtube.com/watch?v=_0UU0r4IOf4&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
Expertiza is a web portal which can be used to manage assignments related to a course. It provides a platform to view assignments, manage teams, select topics and work on improvement through anonymous peer reviews.&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
Expertiza allows the instructor to define different topics that students or teams could choose from as their assignment. Each topic can have 0 or more slots that indicate the number of students or teams that can sign up for that topic. We identified several ideas that can improve user experience when managing the topics. Thus, we would like you to introduce new features to implement these ideas.&lt;br /&gt;
&lt;br /&gt;
===== What needs to be done?: =====&lt;br /&gt;
&lt;br /&gt;
* Issue #971 Change create topic UI into AJAX.&lt;br /&gt;
&lt;br /&gt;
* Issue #926 We need a way to sort topics by topic number in assignment#edit page.&lt;br /&gt;
&lt;br /&gt;
* Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.&lt;br /&gt;
&lt;br /&gt;
== Files modified ==&lt;br /&gt;
The following files were modified&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/views/assignments/edit.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
== Files Added ==&lt;br /&gt;
The following files were added&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
== Solutions Implemented ==&lt;br /&gt;
=== Issue #971 Change create topic UI into AJAX ===&lt;br /&gt;
Currently, when instructors manually enter topics, they have to go back and forth between the list of the topic page (views&amp;gt;sign_up_sheet&amp;gt;_add_signup_topics.html.erb) and the create topic page (views&amp;gt;sign_up_sheet&amp;gt;new.html.erb). This should be done via AJAX so that the adding a new topic can be done through an editable grid or a popup form without leaving the list of topic page. Then and the list should be automatically updated when a new topic is entered. &lt;br /&gt;
&lt;br /&gt;
In addition, when adding a topic, the default slot should be 1 instead of 0. the current warning message that shows up when the slot is 0, can't be closed properly and should be fixed (if the form is made popup in the future, the warning should be on the same page as the form e.g., highlight the field and print an instruction to change the # of slot).&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/edit.html.erb''' we added an additional editable &amp;lt;tr&amp;gt; table element which is appended to the table when the add button is clicked in the topics table.&lt;br /&gt;
It submits a ajax request when the 'save topic button is clicked'&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;table class=&amp;quot;table table-striped&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;tr id=&amp;quot;add_topic&amp;quot; style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;%= form_for :topic, :url =&amp;gt; sign_up_sheet_index_path(:id =&amp;gt; @assignment_form.assignment.id),:html =&amp;gt; { :onsubmit =&amp;gt; &amp;quot;return showZeroSlotWarning()&amp;quot;,autocomplete: &amp;quot;off&amp;quot;  }  do |f| %&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_identifier %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.text_field :topic_name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.number_field :max_choosers, min: 0 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&amp;lt;%= f.submit %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    function showZeroSlotWarning(){&lt;br /&gt;
        if ($('#topic_max_choosers').val() == 0){&lt;br /&gt;
            alert(&amp;quot;If you create a topic with 0 slots,  students cannot assign this topic.&amp;quot;);&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
    };&lt;br /&gt;
    function addCreateTopicSection(){&lt;br /&gt;
        $(&amp;quot;#topic_table_header&amp;quot;).after($(&amp;quot;#add_topic&amp;quot;));&lt;br /&gt;
        $(&amp;quot;#add_topic&amp;quot;).toggle();&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_table_header.html.erb''' we added an additional editable &amp;lt;th&amp;gt; table element which adds a add topic button which toggles the editable row for creating topics.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;th width=&amp;quot;3%&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;a id=&amp;quot;myLink&amp;quot; title=&amp;quot;Add&amp;quot;&lt;br /&gt;
         href=&amp;quot;#&amp;quot; style=&amp;quot;color: #00aa00; font-size: 26px;&amp;quot; onclick=&amp;quot;addCreateTopicSection();return false;&amp;quot;&amp;gt;+&amp;lt;/a&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the file '''app/views/assignments/_add_signup_topics.html.erb''' we initialize the new topic with max_choosers as 1.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: black; border:1px;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% @sign_up_topic = SignUpTopic.new %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic = @sign_up_topic %&amp;gt;&lt;br /&gt;
  &amp;lt;% @topic.max_choosers=1 %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Topics table before changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_3.png]]&lt;br /&gt;
&lt;br /&gt;
===== Topics table after changes =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_4.png]]&lt;br /&gt;
&lt;br /&gt;
===== Warning message when max_choosers is set to zero =====&lt;br /&gt;
&lt;br /&gt;
[[File:topic_5.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #926 We need a way to sort topics by topic number in assignment#edit page.  ===&lt;br /&gt;
The task is to sort the Topics according to the topic number. This functionality is added using Tablesorter css, where clicking the topic# will toggle the topics in the ascending/descending order.&lt;br /&gt;
&lt;br /&gt;
To use Tablesorter in app/views/sign_up_sheet/_add_signup_topics.html.erb, we added this script:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  $(function () {&lt;br /&gt;
    /*Function for sorting the table */&lt;br /&gt;
    $(&amp;quot;.sortable&amp;quot;).tablesorter({&lt;br /&gt;
      sortList: [[0,0]] //sort First Column by default when page loads&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And made this change to the current table in html:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;thead&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;	      &lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; '/sign_up_sheet/table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to make Topic to be sortable, we added this in app/views/sign_up_sheet/_table_header.html.erb:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;th class=&amp;quot;sorter-true&amp;quot; width=&amp;quot;5%&amp;quot;&amp;gt;Topic #&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sorting in ascending order''':-&lt;br /&gt;
[[File:Edit_ascending.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sorting in descending order''':-&lt;br /&gt;
[[File:Edit_descending.png]]&lt;br /&gt;
&lt;br /&gt;
=== Issue #718 We should allow instructors to give feedback when accepting or rejecting topic suggestions.  ===&lt;br /&gt;
As it is, one can give feedback on topics suggested by students only when the instructor wants the topic to be revised, not when (s)he is approving or rejecting it. Feedback should be possible in any of these cases.&lt;br /&gt;
&lt;br /&gt;
A possible solution would be to add a column in the views&amp;gt;suggestion&amp;gt;list.html.erb with a textbox in the table and “send” button and handle sending the comments when the send button is pressed in suggestion_controller.rb. Add an extra column called “feedback” in the suggestion table to store instructor’s comments to the suggested topics.&lt;/div&gt;</summary>
		<author><name>Mjain6</name></author>
	</entry>
</feed>