<?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=Apendya</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=Apendya"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Apendya"/>
	<updated>2026-08-06T05:15:24Z</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_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106760</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106760"/>
		<updated>2016-12-11T06:27:50Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Tests Added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
=''' Implementation details''' =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Observer Pattern'''=&lt;br /&gt;
Using Faye and Sync gems, we prevent the client from polling the server. Instead, we publish the messages to the corresponding chat box and using sync config , we make the users, i.e the authors and reviewers subscribe to this particular chat box. This way, the coupling between various different objects is loosened and messages can be sent back and forth between authors and reviewers without modifying any of those objects. These observers are subscribed and unsubscribed at any point in time without causing further ramifications. This way, the chat functionality does not depend upon the implementation of the User class.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains the method is_reviewer(message) which take the message object as input and return whether the message was sent by author or reviewer. Using the output of these methods, various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JavaScript and CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
1. Chats.js file has been added for managing the pop up chat logic.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
=====Tests Added=====&lt;br /&gt;
&lt;br /&gt;
1. Model validations for the chat model: validating the chat so that it has a unique assignment_team_id.&lt;br /&gt;
&lt;br /&gt;
2. Model validations for the message model: validating each message has a user_id, chat_id and a body. Also, checking that  it belongs to both user and chat classes.&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106759</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106759"/>
		<updated>2016-12-11T06:27:00Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
=''' Implementation details''' =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Observer Pattern'''=&lt;br /&gt;
Using Faye and Sync gems, we prevent the client from polling the server. Instead, we publish the messages to the corresponding chat box and using sync config , we make the users, i.e the authors and reviewers subscribe to this particular chat box. This way, the coupling between various different objects is loosened and messages can be sent back and forth between authors and reviewers without modifying any of those objects. These observers are subscribed and unsubscribed at any point in time without causing further ramifications. This way, the chat functionality does not depend upon the implementation of the User class.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains the method is_reviewer(message) which take the message object as input and return whether the message was sent by author or reviewer. Using the output of these methods, various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JavaScript and CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
1. Chats.js file has been added for managing the pop up chat logic.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
=====Tests Added=====&lt;br /&gt;
&lt;br /&gt;
1. Model validations for the chat model: validating the chat so that it has a unique assignment_id.&lt;br /&gt;
&lt;br /&gt;
2. Model validations for the message model: validating each message has a user_id, chat_id and a body. Also, checking that  it belongs to both user and chat classes.&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106758</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106758"/>
		<updated>2016-12-11T06:25:06Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Observer Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Observer Pattern'''=&lt;br /&gt;
Using Faye and Sync gems, we prevent the client from polling the server. Instead, we publish the messages to the corresponding chat box and using sync config , we make the users, i.e the authors and reviewers subscribe to this particular chat box. This way, the coupling between various different objects is loosened and messages can be sent back and forth between authors and reviewers without modifying any of those objects. These observers are subscribed and unsubscribed at any point in time without causing further ramifications. This way, the chat functionality does not depend upon the implementation of the User class.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains the method is_reviewer(message) which take the message object as input and return whether the message was sent by author or reviewer. Using the output of these methods, various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JavaScript and CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
1. Chats.js file has been added for managing the pop up chat logic.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
=====Tests Added=====&lt;br /&gt;
&lt;br /&gt;
1. Model validations for the chat model: validating the chat so that it has a unique assignment_id.&lt;br /&gt;
&lt;br /&gt;
2. Model validations for the message model: validating each message has a user_id, chat_id and a body. Also, checking that  it belongs to both user and chat classes.&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106757</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106757"/>
		<updated>2016-12-11T06:23:50Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Observer Pattern'''=&lt;br /&gt;
Using Faye and Sync gems, we prevent the client from polling the server. Instead , we publish the messages to the corresponding chat box and using sync config , we make the users ,ie the authors and reviewers subscribe to this particular chat box. This way , the coupling between various different objects is loosened and messages can be sent back and forth between authors and reviewers without modifying any of those objects. These observers are subscribed and unsubscribed at any point in time without causing further ramifications. This way , the chat functionality does not depend upon the implementation of the User class.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains the method is_reviewer(message) which take the message object as input and return whether the message was sent by author or reviewer. Using the output of these methods, various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JavaScript and CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
1. Chats.js file has been added for managing the pop up chat logic.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
=====Tests Added=====&lt;br /&gt;
&lt;br /&gt;
1. Model validations for the chat model: validating the chat so that it has a unique assignment_id.&lt;br /&gt;
&lt;br /&gt;
2. Model validations for the message model: validating each message has a user_id, chat_id and a body. Also, checking that  it belongs to both user and chat classes.&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106756</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106756"/>
		<updated>2016-12-11T06:04:29Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Observer Pattern'''=&lt;br /&gt;
Using Faye and Sync gems, we prevent the client from polling the server. Instead , we publish the messages to the corresponding chat box and using sync config , we make the users ,ie the authors and reviewers subscribe to this particular chat box. This way , the coupling between various different objects is loosened and messages can be sent back and forth between authors and reviewers without modifying any of those objects. These observers are subscribed and unsubscribed at any point in time without causing further ramifications. This way , the chat functionality does not depend upon the implementation of the User class.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains the method is_reviewer(message) which take the message object as input and return whether the message was sent by author or reviewer. Using the output of these methods, various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JavaScript and CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
1. Chats.js file has been added for managing the pop up chat logic.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106678</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106678"/>
		<updated>2016-12-08T00:17:56Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Feature Tests */  added tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop-up a chat box where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains 2 methods self_or_other(message) and reviewee_or_reviewer(message) which take the message object as input and return whether the current_user sent the message and whether message was sent by reviewee_or_reviewer. Using the output of these methods, &lt;br /&gt;
various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JS==&lt;br /&gt;
===Added===&lt;br /&gt;
Chats.js file has been added for managing the pop up chat logic.&lt;br /&gt;
&lt;br /&gt;
==CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&lt;br /&gt;
&lt;br /&gt;
Flow of events: &amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to reviewer's account. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Other's Work&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Click on the chat button next to the assignment topic. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: The message has been sent to the author. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author View''' &amp;lt;br&amp;gt;&lt;br /&gt;
Preconditions: There is an assignment team created and a topic assigned to them. Also, a reviewer has selected their topic to review.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flow of events:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Login to author's account &amp;lt;br&amp;gt;&lt;br /&gt;
2. Click on the assignment.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Click on &amp;quot;Messages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
4. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Type the message.&amp;lt;br&amp;gt;&lt;br /&gt;
6. Assert the presence of the message in the window.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Post conditions: Author has received the message and can send messages.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoticons library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106627</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106627"/>
		<updated>2016-12-07T18:21:26Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop a chat up where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat3.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains 2 methods self_or_other(message) and reviewee_or_reviewer(message) which take the message object as input and return whether the current_user sent the message and whether message was sent by reviewee_or_reviewer. Using the output of these methods, &lt;br /&gt;
various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JS==&lt;br /&gt;
===Added===&lt;br /&gt;
Chats.js file has been added for managing the pop up chat logic.&lt;br /&gt;
&lt;br /&gt;
==CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View''' reviewer should be able to open a chat and send messages &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reviewee View''' reviewee should be able to open a chat and send messages&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Future Improvements =&lt;br /&gt;
Currently, a member of the reviewee team can view messages from all of the reviewers in a single pop-up box . Now , each of the reviewees need to keep opening the pop-up box to check if they have any new messages from one of their reviewers.Same is the case for reviewers. In future, a unread messages feature can be developed which shows if the user has any new messages since the last time they have opened the pop-up box.&lt;br /&gt;
Also, one of the most used features in chats are emoticons. If a proper emoji library is added, it can enrich the conversations between the reviewees and their reviewers.&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat3.png&amp;diff=106626</id>
		<title>File:Chat3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat3.png&amp;diff=106626"/>
		<updated>2016-12-07T18:21:03Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106608</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106608"/>
		<updated>2016-12-07T05:19:35Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop a chat up where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat2.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We added the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignmentTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains 2 methods self_or_other(message) and reviewee_or_reviewer(message) which take the message object as input and return whether the current_user sent the message and whether message was sent by reviewee_or_reviewer. Using the output of these methods, &lt;br /&gt;
various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JS==&lt;br /&gt;
===Added===&lt;br /&gt;
Chats.js file has been added for managing the pop up chat logic.&lt;br /&gt;
&lt;br /&gt;
==CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View''' reviewer should be able to open a chat and send messages &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reviewee View''' reviewee should be able to open a chat and send messages&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106607</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=106607"/>
		<updated>2016-12-07T04:30:27Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to AssignmentTeam and has many messages while Message belongs to Chat. Now, the Chat model will contain the assignment_team_id element. Using AssignmentTeam, we can find whether the chat user is a reviewee or the reviewer.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to AssignmentTeam)&lt;br /&gt;
::*id - primary key - int&lt;br /&gt;
::*assignment_team_id - id of the team - int &lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key - int &lt;br /&gt;
::*body - contains the message body - text &lt;br /&gt;
::*user_id - id of the sender. hidden from the UI. - int&lt;br /&gt;
::*chat_id - id of the chat to which this message belongs to. - int&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the begin/edit options of a review. Clicking on this link will pop a chat up.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat1.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send messages to his reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided along with &amp;quot;Your work&amp;quot;. Clicking on this link will pop a chat up where the reviewee can see/send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Chat2.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies used==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we used a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
For the live chat, we need to start the rack server using the command &lt;br /&gt;
&lt;br /&gt;
'''rackup sync.ru -E production'''&lt;br /&gt;
&lt;br /&gt;
===Sync - Realtime Rails Partials===&lt;br /&gt;
Sync helps in updating the partials in the real time. &lt;br /&gt;
    &amp;lt;%= sync partial: &amp;quot;message_row&amp;quot;, collection: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= sync_new partial: &amp;quot;message_row&amp;quot;, resource: Message.new, scope: Message.by_chat(@team.chat) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first tag fetches all the messages that are related to this chat that were previously sent and the second tag fetches new messages in the real time.&lt;br /&gt;
Message.bychat function helps us in scoping so that only the messages related to this chat are fetched.&lt;br /&gt;
&lt;br /&gt;
='''Files Added/Modified'''=&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
Two new models chat.rb and message.rb have been added. The dependency between them is a one-to-many relationship , i.e a Chat has many messages and Message belongs to Chat. The message model also has a many-to-one relation with User while Chat has a one-to-one relationship with AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
===Modified===&lt;br /&gt;
We add the relationship corresponding to chats and messages in existing models User and AssignmentTeam. We also added a oncreate method in Assignmentteam for creating a new chat whenever a AssignemntTeam is created.&lt;br /&gt;
&lt;br /&gt;
==Controllers==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new controller messages_controller.rb was added. The major functionality this controller provides is that via sync gem, it syncs a new message to the corresponding chat as soon as the new message has been saved which facilitates the real time chat.&lt;br /&gt;
===Modified===&lt;br /&gt;
The student_task_controller.rb has been modified to add a chat_mappings instance variable in the view method which makes the chat objects associated with the reviee team available for the view.&lt;br /&gt;
&lt;br /&gt;
==Helper==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
A new helper module messages_helper.rb has been added. It contains 2 methods self_or_other(message) and reviewee_or_reviewer(message) which take the message object as input and return whether the current_user sent the message and whether message was sent by reviewee_or_reviewer. Using the output of these methods, &lt;br /&gt;
various css classes are added to the message div to provide UI enhancements.&lt;br /&gt;
&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===Added===&lt;br /&gt;
The _message_row.html.erb has been added. It is the partial in which messages are rendered row wise in a chat box.&lt;br /&gt;
===Modified===&lt;br /&gt;
The _responses.html.erb partial in student_review view has been modified to provide the Chat option for the reviewer. The reviewer has to click on the Chat link to send or view messages to or from the reviewee team. The view.html.erb in student_task view has been modified to provide a Your messages link for the reviewee team. When the reviewee clicks on this link , a side bar pops up and the reviewee will be able to see all the available chats and respond to the queries of the reviewers.&lt;br /&gt;
&lt;br /&gt;
==JS==&lt;br /&gt;
===Added===&lt;br /&gt;
Chats.js file has been added for managing the pop up chat logic.&lt;br /&gt;
&lt;br /&gt;
==CSS==&lt;br /&gt;
===Added===&lt;br /&gt;
chats.css file has been added for managing the styles related to the chat popup.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Reviewer View''' reviewer should be able to open a chat and send messages &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reviewee View''' reviewee should be able to open a chat and send messages&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[https://www.youtube.com/watch?v=TVdb2aV-Rvo/  Project Demo]&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;br /&gt;
*[https://github.com/abhinand-lingareddy/pocmultichat Group chat POC]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat2.png&amp;diff=106606</id>
		<title>File:Chat2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat2.png&amp;diff=106606"/>
		<updated>2016-12-07T04:29:34Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat1.png&amp;diff=106605</id>
		<title>File:Chat1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat1.png&amp;diff=106605"/>
		<updated>2016-12-07T04:28:26Z</updated>

		<summary type="html">&lt;p&gt;Apendya: uploaded a new version of &amp;amp;quot;File:Chat1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat1.png&amp;diff=106604</id>
		<title>File:Chat1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Chat1.png&amp;diff=106604"/>
		<updated>2016-12-07T04:26:01Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105590</id>
		<title>File:Usecase chat.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105590"/>
		<updated>2016-11-14T07:12:29Z</updated>

		<summary type="html">&lt;p&gt;Apendya: uploaded a new version of &amp;amp;quot;File:Usecase chat.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105589</id>
		<title>File:Usecase chat.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105589"/>
		<updated>2016-11-14T07:08:23Z</updated>

		<summary type="html">&lt;p&gt;Apendya: uploaded a new version of &amp;amp;quot;File:Usecase chat.png&amp;amp;quot;: Reverted to version as of 06:50, 14 November 2016&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105588</id>
		<title>File:Usecase chat.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105588"/>
		<updated>2016-11-14T07:06:55Z</updated>

		<summary type="html">&lt;p&gt;Apendya: uploaded a new version of &amp;amp;quot;File:Usecase chat.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105587</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105587"/>
		<updated>2016-11-14T06:51:19Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now, the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*response_map_id - id of the response_map&lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase_chat.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
==='''New views'''===&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies proposed==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Team Online Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. All team members are online and as soon as a message is sent, it should appear in all the members participating in the chat.&lt;br /&gt;
&lt;br /&gt;
'''Team Offline Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. Some of the team mates are offline and should be able to see these messages when they login, and send messages.&lt;br /&gt;
&lt;br /&gt;
'''Parallel Chat''' A person can sententiously chat in different chats in a single assignment. He can be a reviewer chatting with two teams in two independent chats and he can be also a author talking to two reviewers in two chats. All these chats should be independent, message sent in one chat should only appear in that chat.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
Testing the newly added controllers - ChatsController,MessagesController&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105586</id>
		<title>File:Usecase chat.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Usecase_chat.png&amp;diff=105586"/>
		<updated>2016-11-14T06:50:52Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105585</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105585"/>
		<updated>2016-11-14T06:48:04Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Use case diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now, the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*response_map_id - id of the response_map&lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
==='''New views'''===&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies proposed==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Team Online Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. All team members are online and as soon as a message is sent, it should appear in all the members participating in the chat.&lt;br /&gt;
&lt;br /&gt;
'''Team Offline Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. Some of the team mates are offline and should be able to see these messages when they login, and send messages.&lt;br /&gt;
&lt;br /&gt;
'''Parallel Chat''' A person can sententiously chat in different chats in a single assignment. He can be a reviewer chatting with two teams in two independent chats and he can be also a author talking to two reviewers in two chats. All these chats should be independent, message sent in one chat should only appear in that chat.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
Testing the newly added controllers - ChatsController,MessagesController&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105584</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105584"/>
		<updated>2016-11-14T06:45:53Z</updated>

		<summary type="html">&lt;p&gt;Apendya: added usecase diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a real-time chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
= Implementation details =&lt;br /&gt;
=='''Database Design'''==&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now, the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (belongs to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*response_map_id - id of the response_map&lt;br /&gt;
&lt;br /&gt;
*Message (belongs to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
=== Use case diagram ===&lt;br /&gt;
[[File:Usecase.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Modifications in UI'''==&lt;br /&gt;
===Changes in existing views===&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
==='''New views'''===&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
==Technologies proposed==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes idle.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use a ruby gem Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
=Test=&lt;br /&gt;
== Feature Tests ==&lt;br /&gt;
'''Team Online Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. All team members are online and as soon as a message is sent, it should appear in all the members participating in the chat.&lt;br /&gt;
&lt;br /&gt;
'''Team Offline Chat''' Reviewer starts the chat and all the team members should be able to see messages/send messages to review. Some of the team mates are offline and should be able to see these messages when they login, and send messages.&lt;br /&gt;
&lt;br /&gt;
'''Parallel Chat''' A person can sententiously chat in different chats in a single assignment. He can be a reviewer chatting with two teams in two independent chats and he can be also a author talking to two reviewers in two chats. All these chats should be independent, message sent in one chat should only appear in that chat.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
Testing the newly added controllers - ChatsController,MessagesController&lt;br /&gt;
&lt;br /&gt;
Testing the newly added Models - Chat,Message&lt;br /&gt;
&lt;br /&gt;
= Reference links =&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Apendya&amp;diff=105315</id>
		<title>User:Apendya</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Apendya&amp;diff=105315"/>
		<updated>2016-11-10T04:32:00Z</updated>

		<summary type="html">&lt;p&gt;Apendya: Created page with &amp;quot;Ajay Chandra Pendyala unity ID: apendya&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ajay Chandra Pendyala&lt;br /&gt;
unity ID: apendya&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105307</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105307"/>
		<updated>2016-11-10T04:24:36Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
&lt;br /&gt;
='''Database Design'''=&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now, the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (related to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
&lt;br /&gt;
*Message (related to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
='''Modifications in UI'''=&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
='''New Views to be added for anonymous chat'''=&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes ideal.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
== Reference links ==&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105306</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105306"/>
		<updated>2016-11-10T04:23:15Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
&lt;br /&gt;
='''Database Design'''=&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now ,the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (related to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
&lt;br /&gt;
*Message (related to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
='''Modifications in UI'''=&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
='''New Views to be added for anonymous chat'''=&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes ideal.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use Faye which is a messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
== Reference links ==&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105304</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105304"/>
		<updated>2016-11-10T04:21:49Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers can end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion platform for each submission so that reviewers and authors can ask/answer questions in the form of a chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
&lt;br /&gt;
='''Database Design'''=&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now ,the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (related to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
&lt;br /&gt;
*Message (related to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
='''Modifications in UI'''=&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
='''New Views to be added for anonymous chat'''=&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes ideal.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use Faye which  messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
== Reference links ==&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105303</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105303"/>
		<updated>2016-11-10T04:20:36Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many a time, reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers sometimes end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion board for each submission so that reviewers and authors can ask/answer questions in the form of a chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
&lt;br /&gt;
='''Database Design'''=&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses, assignment_id, group id and reviewer id . Now ,the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (related to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
&lt;br /&gt;
*Message (related to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
='''Modifications in UI'''=&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
='''New Views to be added for anonymous chat'''=&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes ideal.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use Faye which  messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;br /&gt;
&lt;br /&gt;
== Reference links ==&lt;br /&gt;
*[http://www.chrismccord.com/blog/2013/04/21/sync-realtime-rails-partials/  Sync - Realtime Rails Partials]&lt;br /&gt;
*[http://bamboolab.eu/blog/implement-a-chat-app-in-rails-4  Sample chat implementation]&lt;br /&gt;
*[https://faye.jcoglan.com/  Faye]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105299</id>
		<title>CSC/ECE 517 Fall 2016 E1689: Anonymous Chat Between Author and Reviewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1689:_Anonymous_Chat_Between_Author_and_Reviewer&amp;diff=105299"/>
		<updated>2016-11-10T04:15:59Z</updated>

		<summary type="html">&lt;p&gt;Apendya: semantic and grammatical fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Introduction to Expertiza'''=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
='''Problem Statement'''=&lt;br /&gt;
During reviews, many times reviewers may have questions about the submitted material or the authors may want to give some instructions to the reviewers. It may sometimes block the reviewers from progressing with the review. Reviewers sometimes end up submitting empty review forms with all 0s if they cannot figure something out. The aim of this project is to provide a mini-discussion board for each submission so that reviewers and authors can ask/answer questions in the form of a chat window. For example, if the server on which the application is deployed is down, then the reviewer can send a message that the server is down to the authors and then the authors can get the server up and running and send a message to the reviewer informing the same rather than receiving low grade on that review.&lt;br /&gt;
&lt;br /&gt;
='''Database Design'''=&lt;br /&gt;
To implement the chat feature , we are creating 2 new models i.e Chat and Message. The associations for these models are Chat belongs to ReviewResponseMap and has many messages while Message belongs to Chat. The already existing ReviewResponseMap model contains the review responses,assignment_id,group id and reviewer id . Now ,the Chat model will contain the response_map_id element. Using this element , the values of assignment_id, group_id and reviewer_id can be filled in the Chat database.&lt;br /&gt;
&lt;br /&gt;
=== Tables and Schema ===&lt;br /&gt;
&lt;br /&gt;
*Chat (related to ReviewResponseMap)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
&lt;br /&gt;
*Message (related to Chat)&lt;br /&gt;
::*id - primary key&lt;br /&gt;
::*body - contains the message body&lt;br /&gt;
::*sender_id - userid of the sender. hidden from the UI.&lt;br /&gt;
&lt;br /&gt;
='''Modifications in UI'''=&lt;br /&gt;
1)Scenario 1: When the reviewer has a doubt and wants to send a message to the reviewee group.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for chat will be provided along with the view and edit options of a review.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc.png]]&lt;br /&gt;
&lt;br /&gt;
2)Scenario 2: When the reviewee group wants to view their messages or send a message to one of the reviewers.&amp;lt;br&amp;gt;&lt;br /&gt;
A new link for messages will be provided beside &amp;quot;Your work&amp;quot; where the group can view their chats and can send messages.&lt;br /&gt;
&lt;br /&gt;
[[File:Designdoc2.png]]&lt;br /&gt;
&lt;br /&gt;
='''New Views to be added for anonymous chat'''=&lt;br /&gt;
The plan is to add views which facilitate the chat between author and reviewer as shown below:&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewee clicks on Messages link, all of his/her conversations are shown. When a particular conversation is clicked , the message log pops up in the lower right corner similar to a facebook/gmail chat application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the reviewer clicks on chat link, the message log for that particular reviewee group pops up in a similar fashion as mentioned above.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:conv.png]] When clicked on test,the next view pops up.                                                                                                          [[File:chat.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
Most of the web uses Http which uses TCP/IP transports. This means that the connection is initialed by client, server responds to the request and becomes ideal.&lt;br /&gt;
For implementing a chat feature using the above technique requires the client to keep on poling so that it receives the latest messages from the server. &lt;br /&gt;
Apart from this, there are ways that server initiates the communication with the client when there is data which is called push or comet. Both these techniques involve overhead of http and isn't a very good way for low latency applications. &lt;br /&gt;
&lt;br /&gt;
For a better way, we will use web sockets into place which provides persistent connections between a server and a client, which enables both to send data at any time.&lt;br /&gt;
&lt;br /&gt;
To implement this we are planning to use Faye which  messaging system with publish-subscribe. It works on Bayeux protocol.&lt;br /&gt;
&lt;br /&gt;
We will have the messages of the chat displayed in a partial which is updated using Sync - Realtime Rails Partials.&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104309</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104309"/>
		<updated>2016-11-04T03:50:02Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Code_refactoring '''Refactoring'''] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
=== Instructions for testing Rspecs ===&lt;br /&gt;
&lt;br /&gt;
1. git clone https://github.com/bhaskarsinha1311/expertiza.git&lt;br /&gt;
&lt;br /&gt;
2. Change to the expertiza directory and then perform &amp;quot;bundle install&amp;quot; and rake db:migrate.&lt;br /&gt;
&lt;br /&gt;
3. Start the rails server&lt;br /&gt;
&lt;br /&gt;
4. In a new terminal and in the expertiza directory, perform the following commands:&lt;br /&gt;
    i.  rspec spec/controllers/teams_controller_spec.rb&lt;br /&gt;
    ii. rspec spec/features/inherit_teams_display_spec.rb&lt;br /&gt;
    iii. rspec spec/features/list_teams_spec.rb&lt;br /&gt;
&lt;br /&gt;
The results to the above commands can be found [https://www.youtube.com/watch?v=CcSruLHQoeU/ here].&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we log in as instructor got to list page and click on Create Team Link. On this page, we test that it should contain the string 'Inherit Teams From Course'. &lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to assignments page for any course. There the user can click on 'Create Teams' icon and will be redirected to the Create teams page for an assignment, there the user can check for the 'inherit teams' button in the view, ideally, it should be there.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps in the previous case but finally, we test that the page does NOT contain 'Inherit Teams from Course'.&lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to courses page. There the user can click on 'Create Teams' icon and will be redirected to 'create team' page, ideally, the 'Inherit Teams' button should not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object defined as an assignment with the course set to nil.&lt;br /&gt;
This can not be tested manually because assignment cannot be created without a course parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
This test cannot be performed manually as it is testing the count of a database table.&lt;br /&gt;
But, the user can check this functionality online by logging in as an instructor, going to the assignment page of any course and clicking on 'create teams' icon. Following up with entering the required details and clicking on 'create team'.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test an be applied to create a course team as well.&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1. &lt;br /&gt;
The user can check this test manually by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon. &lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
Same Delete test has been applied to the course team&lt;br /&gt;
The manual check can also be performed in a similar way by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
To do this test manually user can log into the system as an instructor and click on any course, the course teams will be displayed. Also, the user can click on any team node to view information about that team.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bhaskarsinha1311/expertiza/ Github] link to the project.&lt;br /&gt;
* [https://docs.google.com/document/d/1TFC0G3zW-xkJYuloh_BmvWnj3dGZB23GOIYuikNRf_I/edit Link] to the project description.&lt;br /&gt;
* [https://www.youtube.com/watch?v=CcSruLHQoeU/ Youtube video of tests]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104308</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104308"/>
		<updated>2016-11-04T03:48:42Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Instructions for testing Rspecs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Code_refactoring '''Refactoring'''] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
=== Instructions for testing Rspecs ===&lt;br /&gt;
&lt;br /&gt;
1. git clone https://github.com/bhaskarsinha1311/expertiza.git&lt;br /&gt;
&lt;br /&gt;
2. Change to the expertiza directory and then perform &amp;quot;bundle install&amp;quot; and rake db:migrate.&lt;br /&gt;
&lt;br /&gt;
3. Start the rails server&lt;br /&gt;
&lt;br /&gt;
4. In a new terminal and in the expertiza directory, perform the following commands:&lt;br /&gt;
    i.  rspec spec/controllers/teams_controller_spec.rb&lt;br /&gt;
    ii. rspec spec/features/inherit_teams_display_spec.rb&lt;br /&gt;
    iii. rspec spec/features/list_teams_spec.rb&lt;br /&gt;
&lt;br /&gt;
The results to the above commands can be found [https://www.youtube.com/watch?v=CcSruLHQoeU/ here].&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we log in as instructor got to list page and click on Create Team Link. On this page, we test that it should contain the string 'Inherit Teams From Course'. &lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to assignments page for any course. There the user can click on 'Create Teams' icon and will be redirected to the Create teams page for an assignment, there the user can check for the 'inherit teams' button in the view, ideally, it should be there.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps in the previous case but finally, we test that the page does NOT contain 'Inherit Teams from Course'.&lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to courses page. There the user can click on 'Create Teams' icon and will be redirected to 'create team' page, ideally, the 'Inherit Teams' button should not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object defined as an assignment with the course set to nil.&lt;br /&gt;
This can not be tested manually because assignment cannot be created without a course parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
This test cannot be performed manually as it is testing the count of a database table.&lt;br /&gt;
But, the user can check this functionality online by logging in as an instructor, going to the assignment page of any course and clicking on 'create teams' icon. Following up with entering the required details and clicking on 'create team'.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test an be applied to create a course team as well.&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1. &lt;br /&gt;
The user can check this test manually by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon. &lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
Same Delete test has been applied to the course team&lt;br /&gt;
The manual check can also be performed in a similar way by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
To do this test manually user can log into the system as an instructor and click on any course, the course teams will be displayed. Also, the user can click on any team node to view information about that team.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bhaskarsinha1311/expertiza/ Github] link to the project.&lt;br /&gt;
* [https://docs.google.com/document/d/1TFC0G3zW-xkJYuloh_BmvWnj3dGZB23GOIYuikNRf_I/edit Link] to the project description.&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104307</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104307"/>
		<updated>2016-11-04T03:48:23Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Manual Instructions for testing Rspecs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Code_refactoring '''Refactoring'''] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
=== Instructions for testing Rspecs ===&lt;br /&gt;
&lt;br /&gt;
1. git clone https://github.com/bhaskarsinha1311/expertiza.git&lt;br /&gt;
2. Change to the expertiza directory and then perform &amp;quot;bundle install&amp;quot; and rake db:migrate.&lt;br /&gt;
3. Start the rails server&lt;br /&gt;
4. In a new terminal and in the expertiza directory, perform the following commands:&lt;br /&gt;
    i.  rspec spec/controllers/teams_controller_spec.rb&lt;br /&gt;
    ii. rspec spec/features/inherit_teams_display_spec.rb&lt;br /&gt;
    iii. rspec spec/features/list_teams_spec.rb&lt;br /&gt;
&lt;br /&gt;
The results to the above commands can be found [https://www.youtube.com/watch?v=CcSruLHQoeU/ here].&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we log in as instructor got to list page and click on Create Team Link. On this page, we test that it should contain the string 'Inherit Teams From Course'. &lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to assignments page for any course. There the user can click on 'Create Teams' icon and will be redirected to the Create teams page for an assignment, there the user can check for the 'inherit teams' button in the view, ideally, it should be there.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps in the previous case but finally, we test that the page does NOT contain 'Inherit Teams from Course'.&lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to courses page. There the user can click on 'Create Teams' icon and will be redirected to 'create team' page, ideally, the 'Inherit Teams' button should not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object defined as an assignment with the course set to nil.&lt;br /&gt;
This can not be tested manually because assignment cannot be created without a course parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
This test cannot be performed manually as it is testing the count of a database table.&lt;br /&gt;
But, the user can check this functionality online by logging in as an instructor, going to the assignment page of any course and clicking on 'create teams' icon. Following up with entering the required details and clicking on 'create team'.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test an be applied to create a course team as well.&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1. &lt;br /&gt;
The user can check this test manually by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon. &lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
Same Delete test has been applied to the course team&lt;br /&gt;
The manual check can also be performed in a similar way by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
To do this test manually user can log into the system as an instructor and click on any course, the course teams will be displayed. Also, the user can click on any team node to view information about that team.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bhaskarsinha1311/expertiza/ Github] link to the project.&lt;br /&gt;
* [https://docs.google.com/document/d/1TFC0G3zW-xkJYuloh_BmvWnj3dGZB23GOIYuikNRf_I/edit Link] to the project description.&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104306</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104306"/>
		<updated>2016-11-04T03:47:58Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Instructions for manually testing Rspecs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Code_refactoring '''Refactoring'''] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Instructions for testing Rspecs ===&lt;br /&gt;
&lt;br /&gt;
1. git clone https://github.com/bhaskarsinha1311/expertiza.git&lt;br /&gt;
2. Change to the expertiza directory and then perform &amp;quot;bundle install&amp;quot; and rake db:migrate.&lt;br /&gt;
3. Start the rails server&lt;br /&gt;
4. In a new terminal and in the expertiza directory, perform the following commands:&lt;br /&gt;
    i.  rspec spec/controllers/teams_controller_spec.rb&lt;br /&gt;
    ii. rspec spec/features/inherit_teams_display_spec.rb&lt;br /&gt;
    iii. rspec spec/features/list_teams_spec.rb&lt;br /&gt;
&lt;br /&gt;
The results to the above commands can be found [https://www.youtube.com/watch?v=CcSruLHQoeU/ here].&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we log in as instructor got to list page and click on Create Team Link. On this page, we test that it should contain the string 'Inherit Teams From Course'. &lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to assignments page for any course. There the user can click on 'Create Teams' icon and will be redirected to the Create teams page for an assignment, there the user can check for the 'inherit teams' button in the view, ideally, it should be there.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps in the previous case but finally, we test that the page does NOT contain 'Inherit Teams from Course'.&lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to courses page. There the user can click on 'Create Teams' icon and will be redirected to 'create team' page, ideally, the 'Inherit Teams' button should not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object defined as an assignment with the course set to nil.&lt;br /&gt;
This can not be tested manually because assignment cannot be created without a course parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
This test cannot be performed manually as it is testing the count of a database table.&lt;br /&gt;
But, the user can check this functionality online by logging in as an instructor, going to the assignment page of any course and clicking on 'create teams' icon. Following up with entering the required details and clicking on 'create team'.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test an be applied to create a course team as well.&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1. &lt;br /&gt;
The user can check this test manually by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon. &lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
Same Delete test has been applied to the course team&lt;br /&gt;
The manual check can also be performed in a similar way by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
To do this test manually user can log into the system as an instructor and click on any course, the course teams will be displayed. Also, the user can click on any team node to view information about that team.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bhaskarsinha1311/expertiza/ Github] link to the project.&lt;br /&gt;
* [https://docs.google.com/document/d/1TFC0G3zW-xkJYuloh_BmvWnj3dGZB23GOIYuikNRf_I/edit Link] to the project description.&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104305</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=104305"/>
		<updated>2016-11-04T03:47:01Z</updated>

		<summary type="html">&lt;p&gt;Apendya: rspec testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Code_refactoring '''Refactoring'''] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Instructions for testing Rspecs ===&lt;br /&gt;
&lt;br /&gt;
1. git clone https://github.com/bhaskarsinha1311/expertiza.git&lt;br /&gt;
2. Change to the expertiza directory and then perform &amp;quot;bundle install&amp;quot; and rake db:migrate.&lt;br /&gt;
3. Start the rails server&lt;br /&gt;
4. In a new terminal and in the expertiza directory, perform the following commands:&lt;br /&gt;
    i.  rspec spec/controllers/teams_controller_spec.rb&lt;br /&gt;
    ii. rspec spec/features/inherit_teams_display_spec.rb&lt;br /&gt;
    iii. rspec spec/features/list_teams_spec.rb&lt;br /&gt;
&lt;br /&gt;
The results to the above commands can be found [https://www.youtube.com/watch?v=CcSruLHQoeU /here].&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we log in as instructor got to list page and click on Create Team Link. On this page, we test that it should contain the string 'Inherit Teams From Course'. &lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to assignments page for any course. There the user can click on 'Create Teams' icon and will be redirected to the Create teams page for an assignment, there the user can check for the 'inherit teams' button in the view, ideally, it should be there.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps in the previous case but finally, we test that the page does NOT contain 'Inherit Teams from Course'.&lt;br /&gt;
To do this test manually, user need lo log in as an Instructor and navigate to courses page. There the user can click on 'Create Teams' icon and will be redirected to 'create team' page, ideally, the 'Inherit Teams' button should not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object defined as an assignment with the course set to nil.&lt;br /&gt;
This can not be tested manually because assignment cannot be created without a course parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
This test cannot be performed manually as it is testing the count of a database table.&lt;br /&gt;
But, the user can check this functionality online by logging in as an instructor, going to the assignment page of any course and clicking on 'create teams' icon. Following up with entering the required details and clicking on 'create team'.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test an be applied to create a course team as well.&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1. &lt;br /&gt;
The user can check this test manually by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon. &lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
Same Delete test has been applied to the course team&lt;br /&gt;
The manual check can also be performed in a similar way by logging in as an instructor navigating to the page of any team for an assignment and clicking on 'Delete Team' icon.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
To do this test manually user can log into the system as an instructor and click on any course, the course teams will be displayed. Also, the user can click on any team node to view information about that team.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bhaskarsinha1311/expertiza/ Github] link to the project.&lt;br /&gt;
* [https://docs.google.com/document/d/1TFC0G3zW-xkJYuloh_BmvWnj3dGZB23GOIYuikNRf_I/edit Link] to the project description.&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103867</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103867"/>
		<updated>2016-10-29T04:09:03Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''[[https://en.wikipedia.org/wiki/Code_refactoring]] is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, to improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we login as instructor got to list page and click on Create Team Link. On this page we test that it should contain the string 'Inherit Teams From Course'.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps as previous case but finally we test that the page does NOT contain 'Inherit Teams from Course'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object for that defined an assignment with course set to nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test for a course team as well&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1.&lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1. [[https://github.com/bhaskarsinha1311/expertiza/ Github link to project ]]&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103859</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103859"/>
		<updated>2016-10-29T04:03:01Z</updated>

		<summary type="html">&lt;p&gt;Apendya: added descriptions for delete and list tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644: Refactor and Test 'Teams_Controller' Controller'''&amp;lt;ref&amp;gt;Project Description document https://google.com&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''&amp;lt;ref&amp;gt;Refactoring https://en.wikipedia.org/wiki/Code_refactoring&amp;lt;/ref&amp;gt; is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, tp improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to View == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
To test that while creating an assignment team, the inherit teams section should be displayed, we login as instructor got to list page and click on Create Team Link. On this page we test that it should contain the string 'Inherit Teams From Course'.&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To test that while creating a course team, the inherit teams section should not be displayed, we do same steps as previous case but finally we test that the page does NOT contain 'Inherit Teams from Course'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Similarly, for creating a team for an assignment without a course, we test that the page does not contain 'Inherit Teams From Course'. For this particular test case, we added a new factory object for that defined an assignment with course set to nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
This test checks that after creating an assignment team the count in the teams table increase by 1.&lt;br /&gt;
&lt;br /&gt;
    describe &amp;quot;POST #create&amp;quot; do&lt;br /&gt;
    context &amp;quot;with an assignment team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases count by 1&amp;quot; do	&lt;br /&gt;
        expect{create :assignment_team, assignment: @assignment}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
     it &amp;quot;redirects to the list page&amp;quot; do&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The same test for a course team as well&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;with a course team&amp;quot; do&lt;br /&gt;
      it &amp;quot;increases the count by 1&amp;quot; do&lt;br /&gt;
        expect{create :course_team, course: @course}.to change(Team,:count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
    &lt;br /&gt;
The delete method should work for deleting both assignment and course teams. We check this functionality by deleting the respective team and then check if the count of Teams goes down by 1.&lt;br /&gt;
&lt;br /&gt;
   context &amp;quot;with an assignment team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes an assignment team&amp;quot; do&lt;br /&gt;
        @assignment = create(:assignment)&lt;br /&gt;
        @a_team = create(:assignment_team)&lt;br /&gt;
        expect{ @a_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    context &amp;quot;with a course team &amp;quot; do&lt;br /&gt;
      it &amp;quot;deletes a course team&amp;quot; do&lt;br /&gt;
        @course = create(:course)&lt;br /&gt;
        @c_team = create(:course_team)&lt;br /&gt;
        expect{ @c_team.delete }.to change(Team, :count).by(-1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
The list method lists all the team nodes. This test that we have written, checks whether the instructor is able to view the team nodes in the list view.&lt;br /&gt;
&lt;br /&gt;
 describe 'List Team' do&lt;br /&gt;
 &lt;br /&gt;
   it 'should list all team nodes' do&lt;br /&gt;
     create(:assignment)&lt;br /&gt;
     create(:assignment_node)&lt;br /&gt;
     assignment_team = create(:assignment_team)&lt;br /&gt;
    team_user = create(:team_user)&lt;br /&gt;
     login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
     visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
     page.all('#theTable tr').each do |tr|&lt;br /&gt;
       expect(tr).to have_content?(assignment_team.name)&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;ref&amp;gt; Github link to project https://github.com/bhaskarsinha1311/expertiza&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103731</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103731"/>
		<updated>2016-10-29T02:56:56Z</updated>

		<summary type="html">&lt;p&gt;Apendya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644. Refactor and Test 'Teams_Controller' Controller'''&amp;lt;ref&amp;gt;Project Description document https://google.com&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''&amp;lt;ref&amp;gt;Refactoring https://en.wikipedia.org/wiki/Code_refactoring&amp;lt;/ref&amp;gt; is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, tp improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to GUI == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103726</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103726"/>
		<updated>2016-10-29T02:55:49Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Changes to GUI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644. Refactor and Test 'Teams_Controller' Controller'''&amp;lt;ref&amp;gt;Project Description document https://google.com&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''&amp;lt;ref&amp;gt;Refactoring https://en.wikipedia.org/wiki/Code_refactoring&amp;lt;/ref&amp;gt; is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, tp improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to GUI == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
  Inherit Teams From Course&lt;br /&gt;
  Use the teams that are currently defined for the course.&lt;br /&gt;
 &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
   &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
   &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which was changed to:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;% if not @parent.instance_of?(Course) and not @parent.course.nil? %&amp;gt;&lt;br /&gt;
    Inherit Teams From Course &lt;br /&gt;
    Use the teams that are currently defined for the course.&lt;br /&gt;
   &amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
     &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the view, in the ''new.html.erb'' file of teams, we enclose the inherit teams section in an ''if condition'' that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103707</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103707"/>
		<updated>2016-10-29T02:47:13Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Changes to GUI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644. Refactor and Test 'Teams_Controller' Controller'''&amp;lt;ref&amp;gt;Project Description document https://google.com&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''&amp;lt;ref&amp;gt;Refactoring https://en.wikipedia.org/wiki/Code_refactoring&amp;lt;/ref&amp;gt; is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, tp improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to GUI == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
 {{&amp;lt;H2&amp;gt; Inherit Teams From Course &amp;lt;/H2&amp;gt;&lt;br /&gt;
 -&amp;lt;p&amp;gt; Use the teams that are currently defined for the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
 -&amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
 -  &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 -&lt;br /&gt;
 -  &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changes in UI, to fix view for inherit team&lt;br /&gt;
In the new.html.erb file of teams, we enclose the inherit teams section in an if condition that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103704</id>
		<title>CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/E1644._Refactor_and_test_Teams_Controller&amp;diff=103704"/>
		<updated>2016-10-29T02:45:56Z</updated>

		<summary type="html">&lt;p&gt;Apendya: /* Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''E1644. Refactor and Test 'Teams_Controller' Controller'''&amp;lt;ref&amp;gt;Project Description document https://google.com&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides a brief description of the '''Expertiza''' project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in [https://en.wikipedia.org/wiki/RSpec RSpec] to verify the methods it possesses. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction to Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. &lt;br /&gt;
Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
'''Teams_Controller''' primarily handles the team creation, deletion and other behaviours. Most of those are called from the instructor’s view. When manual testing is done, most of the methods can be called by clicking the “Create teams” icon from both assignments and courses. &lt;br /&gt;
The following tasks have been performed as per the requirements.&lt;br /&gt;
&lt;br /&gt;
As a part of the project, some GUI's changes had to be made because they did not work the way they should have, some minor issues in the code were fixed and tests were written in '''RSpec''' for the methods delete, create, create teams, list and inherit.&lt;br /&gt;
&lt;br /&gt;
===Create Method===&lt;br /&gt;
The method '''Create''' is called when an instructor tries to create a team manually. This works for both, creating ''assignment teams'' and ''course teams''. Assignment teams are teams made to do a particular assignment together and ''Course Teams'' are teams which are made for the whole course.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to create assignment teams.&lt;br /&gt;
&lt;br /&gt;
===Delete Method===&lt;br /&gt;
The method '''Delete''' is called when an instructor tries to delete a team manually. This works for both, deleting ''assignment teams'' and ''course teams''.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete course teams.&lt;br /&gt;
&lt;br /&gt;
* To verify that the Instructor is able to delete assignment teams.&lt;br /&gt;
&lt;br /&gt;
===List Method===&lt;br /&gt;
The method '''List''' lists all the team nodes and the instructor is able to expand each team node to see the user nodes as well.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that all teams are being listed in the view.&lt;br /&gt;
&lt;br /&gt;
===Inherit Method===&lt;br /&gt;
The method '''Inherit''' inherits teams from course to assignments, but the “Inherit Teams From Course” option should not display when either 1) we are editing a course object or 2) the current assignment object does not have a course associated with it.&lt;br /&gt;
&lt;br /&gt;
Following Test Cases were written and executed in RSpec to test this method:&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is displayed while creating an assignment team.&lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating a course team. &lt;br /&gt;
&lt;br /&gt;
* To check that ''inherit teams'' is not displayed while creating teams for an assignment without a course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Refactoring ==&lt;br /&gt;
'''Refactoring'''&amp;lt;ref&amp;gt;Refactoring https://en.wikipedia.org/wiki/Code_refactoring&amp;lt;/ref&amp;gt; is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities.&lt;br /&gt;
Some common techniques to refactor are:&lt;br /&gt;
&lt;br /&gt;
* Moving methods to appropriate modules&lt;br /&gt;
* Breaking methods into more meaningful functionality&lt;br /&gt;
* Creating more generalized code.&lt;br /&gt;
* Renaming methods and variable.&lt;br /&gt;
* Inheritance&lt;br /&gt;
&lt;br /&gt;
As the part of the project, the variable ''@signUps'' in the delete method in the teams_controller was changed to snake case, tp improve readability of code.&lt;br /&gt;
&lt;br /&gt;
== Changes to GUI == &lt;br /&gt;
To fix the view for ''inherit teams'' functionality, changes to the view were made.&lt;br /&gt;
&lt;br /&gt;
Initially, the code was:&lt;br /&gt;
&lt;br /&gt;
-&amp;lt;H2&amp;gt; Inherit Teams From Course &amp;lt;/H2&amp;gt;&lt;br /&gt;
 -&amp;lt;p&amp;gt; Use the teams that are currently defined for the course.&amp;lt;/p&amp;gt;&lt;br /&gt;
 -&amp;lt;%= form_tag :action =&amp;gt; 'inherit' do %&amp;gt;&lt;br /&gt;
 -  &amp;lt;%= hidden_field_tag 'id', @parent.id %&amp;gt;&lt;br /&gt;
 -&lt;br /&gt;
 -  &amp;lt;%= submit_tag &amp;quot;Inherit&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changes in UI, to fix view for inherit team&lt;br /&gt;
In the new.html.erb file of teams, we enclose the inherit teams section in an if condition that checks that the parent of the team is not a Course and it is not an Assignment whose course is nil.&lt;br /&gt;
&lt;br /&gt;
== Testing the Teams_Controller ==&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should display inherit teams while creating an assignment team' do&lt;br /&gt;
    create(:assignment)&lt;br /&gt;
    create(:assignment_node)&lt;br /&gt;
    create(:assignment_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating a course team' do&lt;br /&gt;
    create(:course)&lt;br /&gt;
    create(:course_node)&lt;br /&gt;
    create(:course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Course'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  it 'should not display inherit teams while creating team for an assignment without a course' do&lt;br /&gt;
    create(:assignment_without_course)&lt;br /&gt;
    create(:assignment_without_course_node)&lt;br /&gt;
    create(:assignment_without_course_team)&lt;br /&gt;
    login_as(&amp;quot;instructor6&amp;quot;)    &lt;br /&gt;
    visit '/teams/list?id=1&amp;amp;type=Assignment'&lt;br /&gt;
    click_link 'Create Team'&lt;br /&gt;
    expect(page).to have_no_content('Inherit Teams From Course')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===Testing Create Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Delete Method===&lt;br /&gt;
&lt;br /&gt;
===Testing Inherit Method===&lt;br /&gt;
&lt;br /&gt;
===Testing List Method===&lt;/div&gt;</summary>
		<author><name>Apendya</name></author>
	</entry>
</feed>