<?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=Vshah</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=Vshah"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Vshah"/>
	<updated>2026-08-09T04:08:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123187</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123187"/>
		<updated>2019-04-04T17:55:50Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* The export and import methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Example.jpg]]__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
# spec/models/questionnaire_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods and ''edit_questionnaires.html.erb''====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Testing the method ''create_quiz_question_choice'' can likewise be done with this command. &lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''rspec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;br /&gt;
&lt;br /&gt;
Also, tests were included for the code movement from the questionnaires controller to the questionnaire model. Checks were being made for database calls in the controller rspec method, the same format was followed while writing tests for the moved methods.&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki2_4_2q&amp;diff=121666</id>
		<title>CSC/ECE 517 Fall 2007/wiki2 4 2q</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki2_4_2q&amp;diff=121666"/>
		<updated>2019-01-10T19:29:31Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Basic use case template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''A Guide to Use Cases on the WEB'''&lt;br /&gt;
&lt;br /&gt;
''Topic :Use cases. There are even more pages on the Web on use cases than on MVC. If someone wants to learn about them, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the use-case sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which teach advanced concepts that are not apparent in perusing most use-case sites? Read at least several dozen pages before deciding how to organize your overview.'' &lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This page tries to review the use-case sites on the Web which can be useful to best understand the concept. Also a few instructive examples are covered paying attention to the basic use case as well as advanced concepts that are not apparent in perusing most use-case sites.&lt;br /&gt;
 &lt;br /&gt;
=What is a Use Case?=&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &amp;quot;'''''Use case''' is a methodology used in software and systems engineering to understand and identify the functional requirements of a system. Use cases describe the interaction between a primary actor, the initiator of the interaction and the system itself, represented as a sequence of simple steps.''&amp;quot;[1][2]&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An actor who can more generally be described as the user of the system, is the external entity and can be a person or another system itself. A use case can be best described as what happens when the actor is using the system to achieve some goal. This goal is nothing but the end result which follows the sequence of events as described in the use cases. &lt;br /&gt;
&lt;br /&gt;
Every use case gives a complete list of events which occur from the time the actor starts interacting with the system till the time the final goal is achieved. A use case also records all the possible scenarios that may occur while trying to reach the desired goal. We can think of it as existence of a main course of events that will occur in normal circumstances, to which the exceptional cases are added. Anything that is not relevant to the actor/user is not a part of the use case.&lt;br /&gt;
&lt;br /&gt;
Listed below are a few links to external websites which further illustrate this concept.&lt;br /&gt;
&lt;br /&gt;
* [https://www.ibm.com/developerworks/library/ws-using-oo/ OO design process: Use cases, an introduction]&lt;br /&gt;
* [http://www.cs.uno.edu/~jaime/Courses/4210/useCaseFundamentals.html Use Case Fundamentals]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams and Use cases==&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &amp;quot;''The Use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as 'actors' and the processes are called &amp;quot;use cases.&amp;quot; The Use case diagram shows which actors interact with each use case.&amp;quot;''[3]&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
They are useful in providing a pictorial view of the interactions between the users (actors) and sets of events (use cases) associated with the system.They also evolve as the projects or system change with time. The standard elements of a use case diagram makes comprehension easy for anyone trying to understand the use case.&lt;br /&gt;
&lt;br /&gt;
Listed below are useful links in understanding how to draw typical use case diagrams.&lt;br /&gt;
&lt;br /&gt;
* [https://www.smartdraw.com/uml-diagram/ An introduction to UML diagrams &amp;amp; Tutorial] &lt;br /&gt;
* [http://www.developer.com/design/article.php/2109801 Elements of a Use Case Diagram]&lt;br /&gt;
&lt;br /&gt;
=Examples using Use Cases=&lt;br /&gt;
In this section, a few instructive examples have been outlined along with their references which illustrate different ways in which use cases can be written. The first example is a basic use-case template.&lt;br /&gt;
&lt;br /&gt;
===Basic use case template===&lt;br /&gt;
Described below are some the characteristics of a typical use case.&lt;br /&gt;
  '''CHARACTERISTIC INFORMATION'''&lt;br /&gt;
  * ''Goal in Context'':   Buyer issues request directly to our company, expects goods shipped and to be billed.&lt;br /&gt;
  * ''Scope'':  Company&lt;br /&gt;
  * ''Preconditions'':  We know Buyer, their address, etc.&lt;br /&gt;
  * ''Success End Condition'':  Buyer has goods, we have money for the goods.&lt;br /&gt;
  * ''Failed End Condition'':  We have not sent the goods, Buyer has not spent the money.&lt;br /&gt;
  * ''Primary Actor'':  Buyer, any agent (or computer) acting for the customer&lt;br /&gt;
  * ''Trigger'':  purchase request comes in.&lt;br /&gt;
  &lt;br /&gt;
  '''MAIN SUCCESS SCENARIO'''&lt;br /&gt;
  1. Buyer calls in with a purchase request.&lt;br /&gt;
  2. Company captures buyer’s name, address, requested goods, etc.&lt;br /&gt;
  3. Company gives buyer information on goods, prices, delivery dates, etc.&lt;br /&gt;
  4. Buyer signs for order.&lt;br /&gt;
  5. Company creates order, ships order to buyer.&lt;br /&gt;
  6. Company ships invoice to buyer.&lt;br /&gt;
  7. Buyers pays invoice.&lt;br /&gt;
  &lt;br /&gt;
  '''EXTENSIONS'''&lt;br /&gt;
  3a. Company is out of one of the ordered items: &lt;br /&gt;
      3a1. Renegotiate order.&lt;br /&gt;
  4a. Buyer pays directly with credit card:&lt;br /&gt;
      4a1. Take payment by credit card (use case 44)&lt;br /&gt;
  7a. Buyer returns goods:&lt;br /&gt;
      7a. Handle returned goods (use case 105)&lt;br /&gt;
The basic steps that can be followed so as to ensure writing an effective use case has been described well in [http://www.gatherspace.com/static/use_case_example.html Writing Effective Use Cases].[4]&lt;br /&gt;
&lt;br /&gt;
===Restaurant===&lt;br /&gt;
This example provides one use case but distinctly provides a step by step analysis of the events that constitute a Use Case. It mentions the actors, pre-conditions, Exceptions and Alternative scenarios.&lt;br /&gt;
&lt;br /&gt;
* [http://www.uml-diagrams.org/restaurant-uml-use-case-diagram-example.html Restaurant]&lt;br /&gt;
&lt;br /&gt;
===Purchase order===&lt;br /&gt;
This example provides a typical use case specification by listing the Activity, Result, Constraints and Extensions involved with a purchase order from a Finance web page.&lt;br /&gt;
&lt;br /&gt;
* [https://creately.com/diagram/example/ifq4uulr/Purchase%20Order Purchase order System]&lt;br /&gt;
&lt;br /&gt;
===ATM system===&lt;br /&gt;
This example is a little more involved in that it provides a number of use cases associated with using an ATM system including cash withdrawal,&lt;br /&gt;
transfers, deposits, balance inquiry, etc.  &lt;br /&gt;
&lt;br /&gt;
* [http://www.cs.fsu.edu/~baker/swe1/restricted/templates/rr631gv1_stuwrk_withdraw_cash_use-case_spec.pdf ATM System]&lt;br /&gt;
&lt;br /&gt;
===A shopping website order Process===&lt;br /&gt;
This is a very good example that describes the scenarios and extensions involved in writing a use case for a online shopping order. It also describes the UML diagram.  &lt;br /&gt;
&lt;br /&gt;
* [http://www.uml-diagrams.org/examples/online-shopping-use-case-diagram-example.html?context=uc-examples Shopping website order]&lt;br /&gt;
&lt;br /&gt;
===Self Service Machine===&lt;br /&gt;
This example provides the typical Use Cases in a self service machine. Some of the aspects of using a self service machine are: buying a product, re-stocking the machine, collecting the money etc. The following link expands on how to do this and also provides the UML diagrams which depict the interaction between the users and system through the use case&lt;br /&gt;
  &lt;br /&gt;
* [http://www.cloudbus.org/~raj/254/Lectures/RajUML2.pdf Self-Service Machine (page-3)]&lt;br /&gt;
&lt;br /&gt;
=How to Write a Use Case?=&lt;br /&gt;
&lt;br /&gt;
==Writing Effective Use Cases==&lt;br /&gt;
&lt;br /&gt;
One of the most difficult problem in software development is capturing precisely what you want to build. Inaccurate requirement will end-up with significant delay, rework or even abandonment of the project. Effective applying use case technique helps your team capturing requirements in user point of view which can be easily understood by both the end-user and your team. Use case driven development support subsequent development activities such as analysis and design and testing.&lt;br /&gt;
&lt;br /&gt;
Listed below are useful links in understanding how to write effective use cases.&lt;br /&gt;
* [https://www.visual-paradigm.com/tutorials/writingeffectiveusecase.jsp Writing Effective Use Cases]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
* [1] Ivar Jacobson (1992). Object-Oriented Software Engineering. Addison Wesley Professional. ISBN 0-201-54435.&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Use_case Wikipidea Page] Basic definition of Use Case&lt;br /&gt;
* [3] [http://www.developer.com/design/article.php/2109801 Use Case Diagrams]&lt;br /&gt;
* [4] [http://www.gatherspace.com/static/use_case_example.html#1 Writing Effective Use Cases]&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
&lt;br /&gt;
* [http://www.cs.uno.edu/~jaime/Courses/4210/useCaseFundamentals.html Use Case Fundamentals]&lt;br /&gt;
* [http://www.developer.com/design/article.php/2109801 Elements of a Use Case Diagram]&lt;br /&gt;
* [https://www.visual-paradigm.com/tutorials/writingeffectiveusecase.jsp Writing effective Use Cases]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki2_4_2q&amp;diff=121665</id>
		<title>CSC/ECE 517 Fall 2007/wiki2 4 2q</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki2_4_2q&amp;diff=121665"/>
		<updated>2019-01-10T19:29:12Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''A Guide to Use Cases on the WEB'''&lt;br /&gt;
&lt;br /&gt;
''Topic :Use cases. There are even more pages on the Web on use cases than on MVC. If someone wants to learn about them, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the use-case sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which teach advanced concepts that are not apparent in perusing most use-case sites? Read at least several dozen pages before deciding how to organize your overview.'' &lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
This page tries to review the use-case sites on the Web which can be useful to best understand the concept. Also a few instructive examples are covered paying attention to the basic use case as well as advanced concepts that are not apparent in perusing most use-case sites.&lt;br /&gt;
 &lt;br /&gt;
=What is a Use Case?=&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &amp;quot;'''''Use case''' is a methodology used in software and systems engineering to understand and identify the functional requirements of a system. Use cases describe the interaction between a primary actor, the initiator of the interaction and the system itself, represented as a sequence of simple steps.''&amp;quot;[1][2]&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An actor who can more generally be described as the user of the system, is the external entity and can be a person or another system itself. A use case can be best described as what happens when the actor is using the system to achieve some goal. This goal is nothing but the end result which follows the sequence of events as described in the use cases. &lt;br /&gt;
&lt;br /&gt;
Every use case gives a complete list of events which occur from the time the actor starts interacting with the system till the time the final goal is achieved. A use case also records all the possible scenarios that may occur while trying to reach the desired goal. We can think of it as existence of a main course of events that will occur in normal circumstances, to which the exceptional cases are added. Anything that is not relevant to the actor/user is not a part of the use case.&lt;br /&gt;
&lt;br /&gt;
Listed below are a few links to external websites which further illustrate this concept.&lt;br /&gt;
&lt;br /&gt;
* [https://www.ibm.com/developerworks/library/ws-using-oo/ OO design process: Use cases, an introduction]&lt;br /&gt;
* [http://www.cs.uno.edu/~jaime/Courses/4210/useCaseFundamentals.html Use Case Fundamentals]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams and Use cases==&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &amp;quot;''The Use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as 'actors' and the processes are called &amp;quot;use cases.&amp;quot; The Use case diagram shows which actors interact with each use case.&amp;quot;''[3]&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
They are useful in providing a pictorial view of the interactions between the users (actors) and sets of events (use cases) associated with the system.They also evolve as the projects or system change with time. The standard elements of a use case diagram makes comprehension easy for anyone trying to understand the use case.&lt;br /&gt;
&lt;br /&gt;
Listed below are useful links in understanding how to draw typical use case diagrams.&lt;br /&gt;
&lt;br /&gt;
* [https://www.smartdraw.com/uml-diagram/ An introduction to UML diagrams &amp;amp; Tutorial] &lt;br /&gt;
* [http://www.developer.com/design/article.php/2109801 Elements of a Use Case Diagram]&lt;br /&gt;
&lt;br /&gt;
=Examples using Use Cases=&lt;br /&gt;
In this section, a few instructive examples have been outlined along with their references which illustrate different ways in which use cases can be written. The first example is a basic use-case template.&lt;br /&gt;
&lt;br /&gt;
===Basic use case template===&lt;br /&gt;
Described below are some the characteristics of a typical use case.&lt;br /&gt;
  '''CHARACTERISTIC INFORMATION'''&lt;br /&gt;
  * ''Goal in Context'':   Buyer issues request directly to our company, expects goods shipped and to be billed.&lt;br /&gt;
  * ''Scope'':  Company&lt;br /&gt;
  * ''Preconditions'':  We know Buyer, their address, etc.&lt;br /&gt;
  * ''Success End Condition'':  Buyer has goods, we have money for the goods.&lt;br /&gt;
  * ''Failed End Condition'':  We have not sent the goods, Buyer has not spent the money.&lt;br /&gt;
  * ''Primary Actor'':  Buyer, any agent (or computer) acting for the customer&lt;br /&gt;
  * ''Trigger'':  purchase request comes in.&lt;br /&gt;
  &lt;br /&gt;
  '''MAIN SUCCESS SCENARIO'''&lt;br /&gt;
  1. Buyer calls in with a purchase request.&lt;br /&gt;
  2. Company captures buyer’s name, address, requested goods, etc.&lt;br /&gt;
  3. Company gives buyer information on goods, prices, delivery dates, etc.&lt;br /&gt;
  4. Buyer signs for order.&lt;br /&gt;
  5. Company creates order, ships order to buyer.&lt;br /&gt;
  6. Company ships invoice to buyer.&lt;br /&gt;
  7. Buyers pays invoice.&lt;br /&gt;
  &lt;br /&gt;
  '''EXTENSIONS'''&lt;br /&gt;
  3a. Company is out of one of the ordered items: &lt;br /&gt;
      3a1. Renegotiate order.&lt;br /&gt;
  4a. Buyer pays directly with credit card:&lt;br /&gt;
      4a1. Take payment by credit card (use case 44)&lt;br /&gt;
  7a. Buyer returns goods:&lt;br /&gt;
      7a. Handle returned goods (use case 105)&lt;br /&gt;
The basic steps that can be followed so as to ensure writing an effective use case has been described well in [http://www.gatherspace.com/static/use_case_example.html Writing Effective Use Cases].[5]&lt;br /&gt;
&lt;br /&gt;
===Restaurant===&lt;br /&gt;
This example provides one use case but distinctly provides a step by step analysis of the events that constitute a Use Case. It mentions the actors, pre-conditions, Exceptions and Alternative scenarios.&lt;br /&gt;
&lt;br /&gt;
* [http://www.uml-diagrams.org/restaurant-uml-use-case-diagram-example.html Restaurant]&lt;br /&gt;
&lt;br /&gt;
===Purchase order===&lt;br /&gt;
This example provides a typical use case specification by listing the Activity, Result, Constraints and Extensions involved with a purchase order from a Finance web page.&lt;br /&gt;
&lt;br /&gt;
* [https://creately.com/diagram/example/ifq4uulr/Purchase%20Order Purchase order System]&lt;br /&gt;
&lt;br /&gt;
===ATM system===&lt;br /&gt;
This example is a little more involved in that it provides a number of use cases associated with using an ATM system including cash withdrawal,&lt;br /&gt;
transfers, deposits, balance inquiry, etc.  &lt;br /&gt;
&lt;br /&gt;
* [http://www.cs.fsu.edu/~baker/swe1/restricted/templates/rr631gv1_stuwrk_withdraw_cash_use-case_spec.pdf ATM System]&lt;br /&gt;
&lt;br /&gt;
===A shopping website order Process===&lt;br /&gt;
This is a very good example that describes the scenarios and extensions involved in writing a use case for a online shopping order. It also describes the UML diagram.  &lt;br /&gt;
&lt;br /&gt;
* [http://www.uml-diagrams.org/examples/online-shopping-use-case-diagram-example.html?context=uc-examples Shopping website order]&lt;br /&gt;
&lt;br /&gt;
===Self Service Machine===&lt;br /&gt;
This example provides the typical Use Cases in a self service machine. Some of the aspects of using a self service machine are: buying a product, re-stocking the machine, collecting the money etc. The following link expands on how to do this and also provides the UML diagrams which depict the interaction between the users and system through the use case&lt;br /&gt;
  &lt;br /&gt;
* [http://www.cloudbus.org/~raj/254/Lectures/RajUML2.pdf Self-Service Machine (page-3)]&lt;br /&gt;
&lt;br /&gt;
=How to Write a Use Case?=&lt;br /&gt;
&lt;br /&gt;
==Writing Effective Use Cases==&lt;br /&gt;
&lt;br /&gt;
One of the most difficult problem in software development is capturing precisely what you want to build. Inaccurate requirement will end-up with significant delay, rework or even abandonment of the project. Effective applying use case technique helps your team capturing requirements in user point of view which can be easily understood by both the end-user and your team. Use case driven development support subsequent development activities such as analysis and design and testing.&lt;br /&gt;
&lt;br /&gt;
Listed below are useful links in understanding how to write effective use cases.&lt;br /&gt;
* [https://www.visual-paradigm.com/tutorials/writingeffectiveusecase.jsp Writing Effective Use Cases]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
* [1] Ivar Jacobson (1992). Object-Oriented Software Engineering. Addison Wesley Professional. ISBN 0-201-54435.&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Use_case Wikipidea Page] Basic definition of Use Case&lt;br /&gt;
* [3] [http://www.developer.com/design/article.php/2109801 Use Case Diagrams]&lt;br /&gt;
* [4] [http://www.gatherspace.com/static/use_case_example.html#1 Writing Effective Use Cases]&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
&lt;br /&gt;
* [http://www.cs.uno.edu/~jaime/Courses/4210/useCaseFundamentals.html Use Case Fundamentals]&lt;br /&gt;
* [http://www.developer.com/design/article.php/2109801 Elements of a Use Case Diagram]&lt;br /&gt;
* [https://www.visual-paradigm.com/tutorials/writingeffectiveusecase.jsp Writing effective Use Cases]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119123</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119123"/>
		<updated>2018-11-09T22:16:50Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video of running output is available here: [https://youtu.be/R_lMT5bXHEk] -- As you can see in the later part of the video, HTML tags have been rendered correctly.&lt;br /&gt;
&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Test Case 3 ====&lt;br /&gt;
&lt;br /&gt;
1. Edit any text field and enter a supported UTF8 character.&lt;br /&gt;
2. Save.&lt;br /&gt;
3. Try to edit it again and try to save. Earlier, this step was failing as it tried entering UTF8 character to the versions table which did not support UTF8.&lt;br /&gt;
&lt;br /&gt;
After the fix, editing it works as seen here: [https://youtu.be/PMe-jgLZw3w]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive. The video is available here: [https://youtu.be/cT9Tju-_fY4]&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/PMe-jgLZw3w]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119122</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119122"/>
		<updated>2018-11-09T22:16:38Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Test Case 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video of running output is available here: [https://youtu.be/R_lMT5bXHEk] -- As you can see in the later part of the video, HTML tags have been rendered correctly.&lt;br /&gt;
&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Test Case 3 ====&lt;br /&gt;
&lt;br /&gt;
1. Edit any text field and enter a supported UTF8 character.&lt;br /&gt;
2. Save.&lt;br /&gt;
3. Try to edit it again and try to save. Earlier, this step was failing as it tried entering UTF8 character to the versions table which did not support UTF8.&lt;br /&gt;
&lt;br /&gt;
After the fix, editing it works as seen here: [https://youtu.be/PMe-jgLZw3w]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive. The video is available here: [https://youtu.be/cT9Tju-_fY4]&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119120</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119120"/>
		<updated>2018-11-09T22:09:24Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Test Case 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video of running output is available here: [https://youtu.be/R_lMT5bXHEk] -- As you can see in the later part of the video, HTML tags have been rendered correctly.&lt;br /&gt;
&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive. The video is available here: [https://youtu.be/cT9Tju-_fY4]&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119119</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119119"/>
		<updated>2018-11-09T22:08:44Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Test Case 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video of running output is available here: [https://youtu.be/R_lMT5bXHEk]&lt;br /&gt;
&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive. The video is available here: [https://youtu.be/cT9Tju-_fY4]&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119118</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119118"/>
		<updated>2018-11-09T22:07:54Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Automated Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video attached with the submission shows this case&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive. The video is available here: [https://youtu.be/cT9Tju-_fY4]&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119117</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119117"/>
		<updated>2018-11-09T22:07:03Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video attached with the submission shows this case&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Video Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Video Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;br /&gt;
# Video Issue 2: Rendering HTML : [https://youtu.be/R_lMT5bXHEk]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119089</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=119089"/>
		<updated>2018-11-09T21:43:32Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
As part of the project we were given task to fix following two issues.&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/issues/927 Issue 1]: In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/issues/962 Issue 2]: The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
These are important issues from usability point of view and need to be fixed.&lt;br /&gt;
&lt;br /&gt;
== Problem as experienced by the user ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1=== &lt;br /&gt;
While trying to save utf8 chars the application was throwing up error as following &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1_error.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2=== &lt;br /&gt;
If a user looks at the review score table, he/she can see html tags along with the review comments. There are other instances such as the  self review page where the problem is repeated. &lt;br /&gt;
&lt;br /&gt;
[[File:Html_tags_error.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution : Approach and Fix ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Issue 1 ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus we see that after lot of exploration and careful debugging we were able to zero down on the root cause. This approach is the best possible outcome as it is not a point fix and solves the root cause. Fix also avoids any duplication of code / point fixes.&lt;br /&gt;
&lt;br /&gt;
=== Issue 2 ===&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby , which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize() function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
[https://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize sanitize]&lt;br /&gt;
&lt;br /&gt;
We had to carefully test all flows where the html tags were getting rendered. We discovered about more than 2 places where this could be done.&lt;br /&gt;
&lt;br /&gt;
However there were additional screens such as tooltip in grade scores which too were showing html tags. Therefore we added code to strip tags in html. &lt;br /&gt;
 &lt;br /&gt;
For tooltip changes, sanitize does not work, therefore we escaped all html form the text.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td class=&amp;quot;&amp;lt;%= score.color_code %&amp;gt;&amp;quot; align=&amp;quot;center&amp;quot; data-toggle=&amp;quot;tooltip&amp;quot; title=&amp;quot;&amp;lt;%= strip_tags(score.comment).html_safe%&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
5. Changed app/views/grades/view_team.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. Changed db/schema.rb &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
To check if our fix for rendering html tags works we relied on manual setup and verification. We reran the steps that were causing the issue in first place and checked if it is fixed by inspection.  &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test Case 1 ====&lt;br /&gt;
Steps for verification : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Log in as instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
2. Create a copy of “Final Project (and design doc)”&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change all due dates to today’s dates. Enable “Use signup deadline” as well and set that date to day’s date&amp;lt;br&amp;gt;&lt;br /&gt;
4. Save&amp;lt;br&amp;gt;&lt;br /&gt;
5. Click on add participants, then import all participants from course (The following steps assume student7488 and student7489 were added to the course during this step. Double-check to make sure they were added, or use some other students that were added)&amp;lt;br&amp;gt;&lt;br /&gt;
6. Login as student7488 – sign up for the first topic.&amp;lt;br&amp;gt;&lt;br /&gt;
7. Login as student7489 – sign up for second topic.&amp;lt;br&amp;gt;&lt;br /&gt;
8. Login as instructor6 – set signup date to yesterday’s date (so we are now past the sign up deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
9. Login as student7488, submit any example hyperlink for this assignment. Perform a self review under “Your scores” (Add bold, italics, lists etc.. in this review as well)&amp;lt;br&amp;gt;&lt;br /&gt;
10. Do the same as student7489&amp;lt;br&amp;gt;&lt;br /&gt;
11. Login as instructor6 – set submission date to yesterday’s date (so we are now past the submission deadline)&amp;lt;br&amp;gt;&lt;br /&gt;
12. Login as student7488 – go to “Other’s work” and click “Request new submission for review”. Perform review.&amp;lt;br&amp;gt;&lt;br /&gt;
13. Do the same as student7489.&amp;lt;br&amp;gt;&lt;br /&gt;
14. Login as instructor6 – set review1 date to yesterday’s date&amp;lt;br&amp;gt;&lt;br /&gt;
15. Navigate back to “Manage -&amp;gt; Assignments”. Click on “View review report”. On the top-left dropdown, select “Self-review report”. Click on “View”. Click on student7488 in the “Self Review” column. You will not see HTML tags if you had entered them in step 9 instead appropriate html will be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video attached with the submission shows this case&lt;br /&gt;
==== Test Case 2 ====&lt;br /&gt;
&lt;br /&gt;
1. Repeat 1-8, create assignments and add reviewers&amp;lt;br&amp;gt;&lt;br /&gt;
2. Login as student2 and give review that contains html tags, logout&amp;lt;br&amp;gt;&lt;br /&gt;
3. Login as student1 and check reviews &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix ( refer to section 3.2 ) &amp;lt;br&amp;gt;&lt;br /&gt;
Following is the output with html escaped. &lt;br /&gt;
[[File:Issue2 resolved.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
&lt;br /&gt;
We have added Rspec tests to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# GitHub pull request: [https://github.com/expertiza/expertiza/pull/1225]&lt;br /&gt;
# Issue 1: Non-UTF8 character removal test + Rspec runs: [https://youtu.be/cT9Tju-_fY4]  &lt;br /&gt;
# Issue 1: UTF-8 character support : [https://youtu.be/fDBx1OcKYlA]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118813</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118813"/>
		<updated>2018-11-08T02:03:24Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Solution Approach ==&lt;br /&gt;
&lt;br /&gt;
=== Files Created or Refactored ===&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118812</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118812"/>
		<updated>2018-11-08T02:03:12Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Files Created or Refactored */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Solution Approach ==&lt;br /&gt;
&lt;br /&gt;
=== Files Created or Refactored ===&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118811</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118811"/>
		<updated>2018-11-08T02:03:00Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Solution Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Solution Approach ==&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118810</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118810"/>
		<updated>2018-11-08T02:02:43Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Files Created or Refactored */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118809</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118809"/>
		<updated>2018-11-08T02:01:27Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Files Created or Refactored */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&amp;lt;br&amp;gt;&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118808</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118808"/>
		<updated>2018-11-08T02:01:12Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Files Refactored */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Created or Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. Refactored application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Refactored self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
4. Created Rspec file application_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118807</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118807"/>
		<updated>2018-11-08T01:59:35Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &amp;lt;br&amp;gt;&lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118806</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118806"/>
		<updated>2018-11-08T01:59:13Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. &lt;br /&gt;
We have implemented RSPEC test to test that the given non-UTF8 character is removed and a valid UTF-8 character is not removed. This ensures that the functionality is exhaustive.&lt;br /&gt;
&lt;br /&gt;
Both the Rspec tests pass: &lt;br /&gt;
&lt;br /&gt;
[[File:vRspec.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:VRspec.png&amp;diff=118805</id>
		<title>File:VRspec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:VRspec.png&amp;diff=118805"/>
		<updated>2018-11-08T01:58:30Z</updated>

		<summary type="html">&lt;p&gt;Vshah: Rspec testing works image.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rspec testing works image.&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118697</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118697"/>
		<updated>2018-11-06T02:33:59Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Solution Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. An alternative approach will be removing the problematic characters within individual functions, but this leads to repetitive code and a violation of DRY principle.&lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not evaluate strings. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. We are yet to implement an RSPEC test to test that the given non-utf8 character is not saved in the database.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118693</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118693"/>
		<updated>2018-11-05T23:38:28Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Testing Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. &lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not render string text. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The HTML tags issue is tested by simply checking the output is properly formatted and appropriate. We are yet to implement an RSPEC test to test that the given non-utf8 character is not saved in the database.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118679</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118679"/>
		<updated>2018-11-05T02:28:07Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Solution Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. &lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mysql&amp;gt; ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Output of show create table now is &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 | Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                         &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=utf8 |&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This solved the problem. Therefore, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
 rails g migration VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
 def change&lt;br /&gt;
  execute &amp;quot;ALTER TABLE versions CONVERT TO CHARACTER SET utf8&amp;quot;&lt;br /&gt;
 end &lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HTML template issue was caused due to a security feature of Ruby, which by default does not render string text. &lt;br /&gt;
To resolve the HTML template issue, we used the sanitize function. This strips all the tags that aren't whitelisted, thus ruby now renders the standard HTML tags. We have sanitized required pages.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
We have manually tested the fix. &lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
We found no existing test cases for the above two problem statements. So we are to define test cases which generate the list of unwanted Chinese non-UTF8 characters and also HTML tags in the views and then refactor our code so that it automatically removes them without any failing of functionalities. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118666</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118666"/>
		<updated>2018-11-04T00:04:37Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Solution Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
One of the solutions proposed was filtering out the non-UTF8 characters before saving the input in the database. Since the non-UTF8 input can come from any view, we implemented a ''filter_non_UTF8'' method in application controller to do just that and adhere to DRY principle. &lt;br /&gt;
&lt;br /&gt;
However, while experimenting with the fix, we found out that not all tables support UTF8 formatting. For E.g., the versions table which has the latin charset. &lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; show create table versions;&lt;br /&gt;
 &lt;br /&gt;
 | Table    | Create Table |   &lt;br /&gt;
  &lt;br /&gt;
 | versions | CREATE TABLE `versions` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `item_type` varchar(255) NOT NULL,&lt;br /&gt;
  `item_id` int(11) NOT NULL,&lt;br /&gt;
  `event` varchar(255) NOT NULL,&lt;br /&gt;
  `whodunnit` varchar(255) DEFAULT NULL,&lt;br /&gt;
  `object` mediumtext,&lt;br /&gt;
  `created_at` datetime DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `index_versions_on_item_type_and_item_id` (`item_type`,`item_id`)&lt;br /&gt;
 ) ENGINE=InnoDB AUTO_INCREMENT=142423 DEFAULT CHARSET=latin1 |&lt;br /&gt;
&lt;br /&gt;
 1 row in set (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
We changed the charset with the command: &amp;lt;br&amp;gt;&lt;br /&gt;
 ALTER TABLE versions CONVERT TO CHARACTER SET utf8;&lt;br /&gt;
&lt;br /&gt;
Which solved the problem. Thus, we created the migration VersionTableSupportUTF8 to change version's characterset.&lt;br /&gt;
&lt;br /&gt;
If we want to fix this in all tables, we can do following for each database via script or add migration for each table.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') FROM information_schema.TABLES WHERE &lt;br /&gt;
 TABLE_SCHEMA = 'expertiza_development';&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
We found no existing test cases for the above two problem statements. So we are to define test cases which generate the list of unwanted Chinese non-UTF8 characters and also HTML tags in the views and then refactor our code so that it automatically removes them without any failing of functionalities. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118314</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118314"/>
		<updated>2018-11-02T23:13:12Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Files Refactored */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Created a new migration - VersionTableSupportUTF8&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the app/controllers/application_controller.rb file:-  &lt;br /&gt;
&lt;br /&gt;
1.We defined the following before_action: filter_ascii &lt;br /&gt;
2. The following methods were defined by us&amp;lt;br&amp;gt;&lt;br /&gt;
   i.  filter_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method makes a recursive call to the remove_ascii method. &lt;br /&gt;
&lt;br /&gt;
   ii. remove_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method is a recursive hashing function that checks the input params and then removes the Chinese non-UTF-8 comma or any  such characters and then saves this value.  &lt;br /&gt;
&lt;br /&gt;
   iii. self.verify&amp;lt;br&amp;gt;&lt;br /&gt;
   This function is just as its name suggests to verify the valid input. &lt;br /&gt;
&lt;br /&gt;
3. The above changes were also made to make the code follow ruby style and guidelines.&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the apps/views/popup/self_review_popup.html.erb file:-  &lt;br /&gt;
&lt;br /&gt;
1.Adding the functionality of ‘sanitize’ to specific html popups such as answer, comments and additional_comment which strips them of the html tags and thus ensures in the solution of our 2nd problem.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
We found no existing test cases for the above two problem statements. So we are to define test cases which generate the list of unwanted Chinese non-UTF8 characters and also HTML tags in the views and then refactor our code so that it automatically removes them without any failing of functionalities. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118293</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118293"/>
		<updated>2018-11-02T22:53:06Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/nowiki&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the app/controllers/application_controller.rb file:-  &lt;br /&gt;
&lt;br /&gt;
1.We defined the following before_action: filter_ascii &lt;br /&gt;
2. The following methods were defined by us&amp;lt;br&amp;gt;&lt;br /&gt;
   i.  filter_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method makes a recursive call to the remove_ascii method. &lt;br /&gt;
&lt;br /&gt;
   ii. remove_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method is a recursive hashing function that checks the input params and then removes the Chinese non-UTF-8 comma or any  such characters and then saves this value.  &lt;br /&gt;
&lt;br /&gt;
   iii. self.verify&amp;lt;br&amp;gt;&lt;br /&gt;
   This function is just as its name suggests to verify the valid input. &lt;br /&gt;
&lt;br /&gt;
3. The above changes were also made to make the code follow ruby style and guidelines.&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the apps/views/popup/self_review_popup.html.erb file:-  &lt;br /&gt;
&lt;br /&gt;
1.Adding the functionality of ‘sanitize’ to specific html popups such as answer, comments and additional_comment which strips them of the html tags and thus ensures in the solution of our 2nd problem.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
We found no existing test cases for the above two problem statements. So we are to define test cases which generate the list of unwanted Chinese non-UTF8 characters and also HTML tags in the views and then refactor our code so that it automatically removes them without any failing of functionalities. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118290</id>
		<title>CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1846._OSS_Project_Navy:_Character_Issues&amp;diff=118290"/>
		<updated>2018-11-02T22:51:55Z</updated>

		<summary type="html">&lt;p&gt;Vshah: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1846. OSS Project Navy: Character Issues Fall 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. In the existing Expertiza setup, the database supports only UTF-8 characters. Hence, if a user enters a non UTF-8 character, the database throws an error. This further leads to loss of data while refreshing or going back to the input page as data wasn't saved in database, effectively leading to loss of entire review if there's even a single non UTF-8 character. We need to solve the problem by removing such unsupported characters.&lt;br /&gt;
&lt;br /&gt;
2. The existing expertiza stores the HTML formatting tags (Like &amp;lt;b&amp;gt; for bold) as a string. However, while rendering the string these tags are not escaped, resulting in no formatting. We need to solve the issue and display proper formatting.&lt;br /&gt;
&lt;br /&gt;
== Files Refactored ==&lt;br /&gt;
&lt;br /&gt;
The following files were modified for this project namely:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. application_controller &amp;lt;br/&amp;gt;&lt;br /&gt;
2. self_review_popup &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Solution Approach ===&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the app/controllers/application_controller.rb file:-  &lt;br /&gt;
&lt;br /&gt;
1.We defined the following before_action: filter_ascii &lt;br /&gt;
2. The following methods were defined by us&amp;lt;br&amp;gt;&lt;br /&gt;
   i.  filter_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method makes a recursive call to the remove_ascii method. &lt;br /&gt;
&lt;br /&gt;
   ii. remove_ascii&amp;lt;br&amp;gt;&lt;br /&gt;
   This method is a recursive hashing function that checks the input params and then removes the Chinese non-UTF-8 comma or any  such characters and then saves this value.  &lt;br /&gt;
&lt;br /&gt;
   iii. self.verify&amp;lt;br&amp;gt;&lt;br /&gt;
   This function is just as its name suggests to verify the valid input. &lt;br /&gt;
&lt;br /&gt;
3. The above changes were also made to make the code follow ruby style and guidelines.&lt;br /&gt;
&lt;br /&gt;
The following changes were made in the apps/views/popup/self_review_popup.html.erb file:-  &lt;br /&gt;
&lt;br /&gt;
1.Adding the functionality of ‘sanitize’ to specific html popups such as answer, comments and additional_comment which strips them of the html tags and thus ensures in the solution of our 2nd problem.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
We found no existing test cases for the above two problem statements. So we are to define test cases which generate the list of unwanted Chinese non-UTF8 characters and also HTML tags in the views and then refactor our code so that it automatically removes them without any failing of functionalities. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
# Link to the videos to see the steps followed for testing and resolving the problems: [https://drive.google.com/drive/folders/1vA2xm1vo45hHANJ_cv9bwePt-TswgmTM?usp=sharing]&lt;/div&gt;</summary>
		<author><name>Vshah</name></author>
	</entry>
</feed>