<?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=Vhegde</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=Vhegde"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Vhegde"/>
	<updated>2026-06-04T04:05:57Z</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_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108902</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108902"/>
		<updated>2017-05-03T16:35:57Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Final Edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintenance like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as&lt;br /&gt;
&lt;br /&gt;
This is essential in both new assignment or editing assignment page.&lt;br /&gt;
&lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Though mentioned a mandatory no special characters, it was not properly implemented. System is accepting the special characters.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Vaidatinguser.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram'''&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow of events leading to validations.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation uses ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:Newassgn_RJS.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Code change details====&lt;br /&gt;
We created a new React class 'NewAssignmentForm' which dynamically creates and displays the form for New assignment. This class has the following methods:&lt;br /&gt;
     getInitialState function(){}      -  Initial method to identify the form parameters that will be sent to the database when a new assignment is created.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
      directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
      nameValidate: function(e){}  - this method validates that a valid project name is entered&lt;br /&gt;
&lt;br /&gt;
      handleCreateAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
      handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
      render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we changed the create method to:&lt;br /&gt;
&lt;br /&gt;
    @assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    @assignment_form.assignment.instructor_id = current_user.id  --  We now pass current instructor to the assignment form.&lt;br /&gt;
      if @assignment_form.save&lt;br /&gt;
        @assignment_form.create_assignment_node&lt;br /&gt;
        flash[:success] = &amp;quot;Assignment Successfully created&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;Failed to Create Assignment&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      end&lt;br /&gt;
     end   &lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we added new method get_courses_node_ng. This method returns the course list array of hashes based on the instructor chosen. This logic is similar to the helper method course_options:&lt;br /&gt;
&lt;br /&gt;
    def get_courses_node_ng&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      courses = []&lt;br /&gt;
        if session[:user].role.name == 'Teaching Assistant'&lt;br /&gt;
          ta = Ta.find(session[:user].id)&lt;br /&gt;
          ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          # If a TA created some courses before, s/he can still add new assignments to these courses.&lt;br /&gt;
          courses &amp;lt;&amp;lt; Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          courses.flatten!&lt;br /&gt;
        # Administrator and Super-Administrator can see all courses&lt;br /&gt;
        elsif session[:user].role.name == 'Administrator' or session[:user].role.name == 'Super-Administrator'&lt;br /&gt;
          courses = Course.all&lt;br /&gt;
        elsif session[:user].role.name == 'Instructor'&lt;br /&gt;
          courses = Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          # instructor can see courses his/her TAs created&lt;br /&gt;
          ta_ids = []&lt;br /&gt;
          ta_ids &amp;lt;&amp;lt; Instructor.get_my_tas(session[:user].id)&lt;br /&gt;
          ta_ids.flatten!&lt;br /&gt;
          ta_ids.each do |ta_id|&lt;br /&gt;
            ta = Ta.find(ta_id)&lt;br /&gt;
            ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        format.html { render json:courses}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
However, the edit form is a multilevel form with different tabs. We managed to implement only the general view as React JS form, hence we added a new action item &amp;quot;Quick Edit&amp;quot; which renders the ReactJS form and the &amp;quot;Edit&amp;quot; action item works as before.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:New editassignment.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
==== Code change details ====&lt;br /&gt;
In tree_display.jsx we created a new React class EditAssignmentForm which dynamically creates and displays the form for Editing assignment. This class has the following methods:&lt;br /&gt;
     componentWillReceiveProps(nextProps)  - To handle edit&lt;br /&gt;
     getInitialState function(){}      -  Here we identify the form parameters.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
     directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
     nameValidate: function(e){}  - this method validates that a valid project name isentered&lt;br /&gt;
&lt;br /&gt;
     handleEditAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
     handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
     render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also added the following in the class RowAction to display the form fields when clicked on Quick Edit.&lt;br /&gt;
    if (this.props.dataType === 'assignment') {&lt;br /&gt;
      moreContent.push(&lt;br /&gt;
      &amp;lt;span&amp;gt;&lt;br /&gt;
      &amp;lt;a title=&amp;quot;Quick Edit&amp;quot; onClick ={this.onClick} &amp;gt;&amp;lt;img src=&amp;quot;/assets/tree_view/edit-icon-24.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;{this.state.showForm ? &amp;lt;EditAssignmentForm &lt;br /&gt;
      assignmentId={this.props.id} name={this.props.parent_name} directory_path={this.props.directory} spec_location={this.props.spec_location} course_id=&lt;br /&gt;
      {this.props.course_id} require_quiz={this.props.require_quiz} is_available={this.props.availability} max_team_size={this.props.max_team_size} &lt;br /&gt;
      staggered_deadline={this.props.staggered_deadline} microtask={this.props.microtask} review_visible={this.props.review_visible} calibration=&lt;br /&gt;
      {this.props.calibration} reputation={this.props.reputation} quiz_questions={this.props.quiz_questions} teammate_review={this.props.teammate_review} /&amp;gt; &lt;br /&gt;
      :null}&lt;br /&gt;
      &amp;lt;/span&amp;gt;) &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we edited update method:&lt;br /&gt;
&lt;br /&gt;
    if @assignment_form.update_attributes(assignment_form_params, current_user)&lt;br /&gt;
      flash[:note] = 'The assignment was successfully saved.'&lt;br /&gt;
      render 'tree_display/list'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;Failed to save the assignment: #{@assignment_form.errors}&amp;quot;&lt;br /&gt;
      render 'tree_display/list'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we edited assignments_method to fetch all the parameters we need to display fields with appropriate values when Quick edit is clicked:&lt;br /&gt;
&lt;br /&gt;
    def assignments_method(node, tmp_object)&lt;br /&gt;
    tmp_object.merge!(&lt;br /&gt;
      &amp;quot;course_id&amp;quot; =&amp;gt; node.get_course_id,&lt;br /&gt;
      &amp;quot;max_team_size&amp;quot; =&amp;gt; node.get_max_team_size,&lt;br /&gt;
      &amp;quot;is_intelligent&amp;quot; =&amp;gt; node.get_is_intelligent,&lt;br /&gt;
      &amp;quot;require_quiz&amp;quot; =&amp;gt; node.get_require_quiz,&lt;br /&gt;
      &amp;quot;quiz_questions&amp;quot; =&amp;gt; node.get_quiz_questions,&lt;br /&gt;
      &amp;quot;allow_suggestions&amp;quot; =&amp;gt; node.get_allow_suggestions,&lt;br /&gt;
      &amp;quot;spec_location&amp;quot; =&amp;gt; node.get_spec_location,&lt;br /&gt;
      &amp;quot;staggered_deadline&amp;quot; =&amp;gt;node.get_staggered_deadline,&lt;br /&gt;
      &amp;quot;microtask&amp;quot; =&amp;gt; node.get_microtask,&lt;br /&gt;
      &amp;quot;review_visible&amp;quot; =&amp;gt; node.get_review_visible,&lt;br /&gt;
      &amp;quot;calibration&amp;quot; =&amp;gt; node.get_calibration,&lt;br /&gt;
      &amp;quot;reputation&amp;quot; =&amp;gt; node.get_reputation_algorithm,&lt;br /&gt;
      &amp;quot;teammate_review&amp;quot; =&amp;gt; node.get_teammate_review,&lt;br /&gt;
      &amp;quot;availability&amp;quot; =&amp;gt; node.get_availability,&lt;br /&gt;
      &amp;quot;has_topic&amp;quot; =&amp;gt; SignUpTopic.where(['assignment_id = ?', node.node_object_id]).first ? true : false&lt;br /&gt;
     )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Adding/Editing of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
====Code change details====&lt;br /&gt;
Tried to add topics using react js code in the file * app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
Modified files code:&lt;br /&gt;
&lt;br /&gt;
[[File:T1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T2.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T3.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T4.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks are implemented for sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
* Below is how output will look like&lt;br /&gt;
&lt;br /&gt;
====Code change details====&lt;br /&gt;
Below are the files modified.&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Signup_topics.PNG]]&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Table_header.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Js.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:css.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Correcting the code in edit assignment page too.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
Here is the display of the implementation:&lt;br /&gt;
[[File:Validate_create.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Validate_edit.JPG]]&lt;br /&gt;
&lt;br /&gt;
==== Files modified ====&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
==== Code change details ====&lt;br /&gt;
These methods are added inside Create/Edit ReactJS class and called whenever Create/Update buttons are clicked:&lt;br /&gt;
    nameValidate: function(e){&lt;br /&gt;
      var regex_valid = /^[a-zA-Z0-9]*$/;&lt;br /&gt;
      var regex=/^(?=\s*\S).*$/;&lt;br /&gt;
      if(regex.test(e) &amp;amp;&amp;amp; regex_valid.test(e))&lt;br /&gt;
          return true;&lt;br /&gt;
      else{&lt;br /&gt;
          document.getElementById(&amp;quot;name_span&amp;quot;).innerHTML = &amp;quot; &amp;amp;#x2716 Name cannot be empty! and no special characters are allowed. Please check the format&amp;quot;;&lt;br /&gt;
          return false;&lt;br /&gt;
           }&lt;br /&gt;
     },&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     directoryValidate: function(e){&lt;br /&gt;
       var regex=/^[a-zA-Z0-9]*$/;&lt;br /&gt;
       var regex_empty=/^(?=\s*\S).*$/;&lt;br /&gt;
       if(regex.test(e) &amp;amp;&amp;amp; regex_empty.test(e))&lt;br /&gt;
         return true;&lt;br /&gt;
       else {     &lt;br /&gt;
          document.getElementById(&amp;quot;directory_span&amp;quot;).innerHTML = &amp;quot;&amp;amp;#x2716 Submission Directory cannot have special characters or spaces. It cannot be empty!&amp;quot;;&lt;br /&gt;
          return false;&lt;br /&gt;
        }&lt;br /&gt;
      },&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we have increased the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
Another way to check is from editing page too.&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit icon page.&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment which is updated with special characters is shown in the table.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
*Covert the multi-level edit assignment form to ReactJS&lt;br /&gt;
*Convert add/edit topics to ReactJS&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Validate_edit.JPG&amp;diff=108901</id>
		<title>File:Validate edit.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Validate_edit.JPG&amp;diff=108901"/>
		<updated>2017-05-03T16:28:52Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Validate_create.JPG&amp;diff=108900</id>
		<title>File:Validate create.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Validate_create.JPG&amp;diff=108900"/>
		<updated>2017-05-03T16:28:09Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108899</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108899"/>
		<updated>2017-05-03T16:16:20Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: added code for new implementation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintenance like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as&lt;br /&gt;
&lt;br /&gt;
This is essential in both new assignment or editing assignment page.&lt;br /&gt;
&lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Though mentioned a mandatory no special characters, it was not properly implemented. System is accepting the special characters.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Vaidatinguser.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram'''&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow of events leading to validations.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
Here is the main code for the regular expression check in Name of assignment and sub directory fields. Now, each time when a create button is clicked, the page is not checked with the model constraints but the reactjs component only. So, without reloading each time the checks are shown on the page as shown in the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Validate.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Making topics table sortable on columns ====&lt;br /&gt;
&lt;br /&gt;
Below are the files modified.&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Signup_topics.PNG]]&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Table_header.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Js.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:css.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Adding topics ====&lt;br /&gt;
&lt;br /&gt;
Tried to add topics using react js code in the file * app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
Modified files code:&lt;br /&gt;
&lt;br /&gt;
[[File:T1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T2.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T3.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T4.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation uses ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:Newassgn_RJS.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Code change details====&lt;br /&gt;
We created a new React class 'NewAssignmentForm' which dynamically creates and displays the form for New assignment. This class has the following methods:&lt;br /&gt;
     getInitialState function(){}      -  Initial method to identify the form parameters that will be sent to the database when a new assignment is created.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
      directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
      nameValidate: function(e){}  - this method validates that a valid project name is entered&lt;br /&gt;
&lt;br /&gt;
      handleCreateAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
      handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
      render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we changed the create method to:&lt;br /&gt;
&lt;br /&gt;
    @assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    @assignment_form.assignment.instructor_id = current_user.id  --  We now pass current instructor to the assignment form.&lt;br /&gt;
      if @assignment_form.save&lt;br /&gt;
        @assignment_form.create_assignment_node&lt;br /&gt;
        flash[:success] = &amp;quot;Assignment Successfully created&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;Failed to Create Assignment&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      end&lt;br /&gt;
     end   &lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we added new method get_courses_node_ng. This method returns the course list array of hashes based on the instructor chosen. This logic is similar to the helper method course_options:&lt;br /&gt;
&lt;br /&gt;
    def get_courses_node_ng&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      courses = []&lt;br /&gt;
        if session[:user].role.name == 'Teaching Assistant'&lt;br /&gt;
          ta = Ta.find(session[:user].id)&lt;br /&gt;
          ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          # If a TA created some courses before, s/he can still add new assignments to these courses.&lt;br /&gt;
          courses &amp;lt;&amp;lt; Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          courses.flatten!&lt;br /&gt;
        # Administrator and Super-Administrator can see all courses&lt;br /&gt;
        elsif session[:user].role.name == 'Administrator' or session[:user].role.name == 'Super-Administrator'&lt;br /&gt;
          courses = Course.all&lt;br /&gt;
        elsif session[:user].role.name == 'Instructor'&lt;br /&gt;
          courses = Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          # instructor can see courses his/her TAs created&lt;br /&gt;
          ta_ids = []&lt;br /&gt;
          ta_ids &amp;lt;&amp;lt; Instructor.get_my_tas(session[:user].id)&lt;br /&gt;
          ta_ids.flatten!&lt;br /&gt;
          ta_ids.each do |ta_id|&lt;br /&gt;
            ta = Ta.find(ta_id)&lt;br /&gt;
            ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        format.html { render json:courses}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
However, the edit form is a multilevel form with different tabs. We managed to implement only the general view as React JS form, hence we added a new action item &amp;quot;Quick Edit&amp;quot; which renders the ReactJS form and the &amp;quot;Edit&amp;quot; action item works as before.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:New editassignment.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files modified ====&lt;br /&gt;
*apps/assest/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
==== Code change details ====&lt;br /&gt;
=====Details=====&lt;br /&gt;
In tree_display.jsx we created a new React class EditAssignmentForm which dynamically creates and displays the form for Editing assignment. This class has the following methods:&lt;br /&gt;
     componentWillReceiveProps(nextProps)  - To handle edit&lt;br /&gt;
     getInitialState function(){}      -  Here we identify the form parameters.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
     directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
     nameValidate: function(e){}  - this method validates that a valid project name isentered&lt;br /&gt;
&lt;br /&gt;
     handleEditAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
     handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
     render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also added the following in the class RowAction to display the form fields when clicked on Quick Edit.&lt;br /&gt;
    if (this.props.dataType === 'assignment') {&lt;br /&gt;
      moreContent.push(&lt;br /&gt;
      &amp;lt;span&amp;gt;&lt;br /&gt;
      &amp;lt;a title=&amp;quot;Quick Edit&amp;quot; onClick ={this.onClick} &amp;gt;&amp;lt;img src=&amp;quot;/assets/tree_view/edit-icon-24.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;{this.state.showForm ? &amp;lt;EditAssignmentForm &lt;br /&gt;
      assignmentId={this.props.id} name={this.props.parent_name} directory_path={this.props.directory} spec_location={this.props.spec_location} course_id=&lt;br /&gt;
      {this.props.course_id} require_quiz={this.props.require_quiz} is_available={this.props.availability} max_team_size={this.props.max_team_size} &lt;br /&gt;
      staggered_deadline={this.props.staggered_deadline} microtask={this.props.microtask} review_visible={this.props.review_visible} calibration=&lt;br /&gt;
      {this.props.calibration} reputation={this.props.reputation} quiz_questions={this.props.quiz_questions} teammate_review={this.props.teammate_review} /&amp;gt; &lt;br /&gt;
      :null}&lt;br /&gt;
      &amp;lt;/span&amp;gt;) &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we edited update method:&lt;br /&gt;
&lt;br /&gt;
    if @assignment_form.update_attributes(assignment_form_params, current_user)&lt;br /&gt;
      flash[:note] = 'The assignment was successfully saved.'&lt;br /&gt;
      render 'tree_display/list'&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;Failed to save the assignment: #{@assignment_form.errors}&amp;quot;&lt;br /&gt;
      render 'tree_display/list'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we edited assignments_method to fetch all the parameters we need to display fields with appropriate values when Quick edit is clicked:&lt;br /&gt;
&lt;br /&gt;
    def assignments_method(node, tmp_object)&lt;br /&gt;
    tmp_object.merge!(&lt;br /&gt;
      &amp;quot;course_id&amp;quot; =&amp;gt; node.get_course_id,&lt;br /&gt;
      &amp;quot;max_team_size&amp;quot; =&amp;gt; node.get_max_team_size,&lt;br /&gt;
      &amp;quot;is_intelligent&amp;quot; =&amp;gt; node.get_is_intelligent,&lt;br /&gt;
      &amp;quot;require_quiz&amp;quot; =&amp;gt; node.get_require_quiz,&lt;br /&gt;
      &amp;quot;quiz_questions&amp;quot; =&amp;gt; node.get_quiz_questions,&lt;br /&gt;
      &amp;quot;allow_suggestions&amp;quot; =&amp;gt; node.get_allow_suggestions,&lt;br /&gt;
      &amp;quot;spec_location&amp;quot; =&amp;gt; node.get_spec_location,&lt;br /&gt;
      &amp;quot;staggered_deadline&amp;quot; =&amp;gt;node.get_staggered_deadline,&lt;br /&gt;
      &amp;quot;microtask&amp;quot; =&amp;gt; node.get_microtask,&lt;br /&gt;
      &amp;quot;review_visible&amp;quot; =&amp;gt; node.get_review_visible,&lt;br /&gt;
      &amp;quot;calibration&amp;quot; =&amp;gt; node.get_calibration,&lt;br /&gt;
      &amp;quot;reputation&amp;quot; =&amp;gt; node.get_reputation_algorithm,&lt;br /&gt;
      &amp;quot;teammate_review&amp;quot; =&amp;gt; node.get_teammate_review,&lt;br /&gt;
      &amp;quot;availability&amp;quot; =&amp;gt; node.get_availability,&lt;br /&gt;
      &amp;quot;has_topic&amp;quot; =&amp;gt; SignUpTopic.where(['assignment_id = ?', node.node_object_id]).first ? true : false&lt;br /&gt;
     )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
* Below is how output will look like&lt;br /&gt;
[[File:Topics_new.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Correcting the code in edit assignment page too.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
Another way to check is from editing page too.&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit icon page.&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment which is updated with special characters is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_editassignment.png&amp;diff=108898</id>
		<title>File:New editassignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_editassignment.png&amp;diff=108898"/>
		<updated>2017-05-03T16:14:51Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108897</id>
		<title>File:Edit-new imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108897"/>
		<updated>2017-05-03T16:14:40Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Edit-new imp.png&amp;amp;quot;: Reverted to version as of 01:32, 13 April 2017&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;new implementation for edit form&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108896</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108896"/>
		<updated>2017-05-03T15:55:34Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: /* Code change details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintenance like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as&lt;br /&gt;
&lt;br /&gt;
This is essential in both new assignment or editing assignment page.&lt;br /&gt;
&lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Though mentioned a mandatory no special characters, it was not properly implemented. System is accepting the special characters.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Vaidatinguser.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram'''&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow of events leading to validations.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
Here is the main code for the regular expression check in Name of assignment and sub directory fields. Now, each time when a create button is clicked, the page is not checked with the model constraints but the reactjs component only. So, without reloading each time the checks are shown on the page as shown in the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Validate.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Making topics table sortable on columns ====&lt;br /&gt;
&lt;br /&gt;
Below are the files modified.&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Signup_topics.PNG]]&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Table_header.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Js.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:css.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Adding topics ====&lt;br /&gt;
&lt;br /&gt;
Tried to add topics using react js code in the file * app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
Modified files code:&lt;br /&gt;
&lt;br /&gt;
[[File:T1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T2.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T3.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T4.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation uses ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:Newassgn_RJS.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
====Code change details====&lt;br /&gt;
We created a new React class 'NewAssignmentForm' which dynamically creates and displays the form for New assignment. This class has the following methods:&lt;br /&gt;
     getInitialState function(){}      -  Initial method to identify the form parameters that will be sent to the database when a new assignment is created.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
      directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
      nameValidate: function(e){}  - this method validates that a valid project name is entered&lt;br /&gt;
&lt;br /&gt;
      handleCreateAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
      handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
      render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we changed the create method to:&lt;br /&gt;
&lt;br /&gt;
    @assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    @assignment_form.assignment.instructor_id = current_user.id  --  We now pass current instructor to the assignment form.&lt;br /&gt;
      if @assignment_form.save&lt;br /&gt;
        @assignment_form.create_assignment_node&lt;br /&gt;
        flash[:success] = &amp;quot;Assignment Successfully created&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;Failed to Create Assignment&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      end&lt;br /&gt;
     end   &lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we added new method get_courses_node_ng. This method returns the course list array of hashes based on the instructor chosen. This logic is similar to the helper method course_options:&lt;br /&gt;
&lt;br /&gt;
    def get_courses_node_ng&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      courses = []&lt;br /&gt;
        if session[:user].role.name == 'Teaching Assistant'&lt;br /&gt;
          ta = Ta.find(session[:user].id)&lt;br /&gt;
          ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          # If a TA created some courses before, s/he can still add new assignments to these courses.&lt;br /&gt;
          courses &amp;lt;&amp;lt; Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          courses.flatten!&lt;br /&gt;
        # Administrator and Super-Administrator can see all courses&lt;br /&gt;
        elsif session[:user].role.name == 'Administrator' or session[:user].role.name == 'Super-Administrator'&lt;br /&gt;
          courses = Course.all&lt;br /&gt;
        elsif session[:user].role.name == 'Instructor'&lt;br /&gt;
          courses = Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          # instructor can see courses his/her TAs created&lt;br /&gt;
          ta_ids = []&lt;br /&gt;
          ta_ids &amp;lt;&amp;lt; Instructor.get_my_tas(session[:user].id)&lt;br /&gt;
          ta_ids.flatten!&lt;br /&gt;
          ta_ids.each do |ta_id|&lt;br /&gt;
            ta = Ta.find(ta_id)&lt;br /&gt;
            ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        format.html { render json:courses}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
* Below is how output will look like&lt;br /&gt;
[[File:Topics_new.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Correcting the code in edit assignment page too.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
Another way to check is from editing page too.&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit icon page.&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment which is updated with special characters is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108895</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108895"/>
		<updated>2017-05-03T15:54:34Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: new image uploaded&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintenance like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as&lt;br /&gt;
&lt;br /&gt;
This is essential in both new assignment or editing assignment page.&lt;br /&gt;
&lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Though mentioned a mandatory no special characters, it was not properly implemented. System is accepting the special characters.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Vaidatinguser.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram'''&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow of events leading to validations.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
Here is the main code for the regular expression check in Name of assignment and sub directory fields. Now, each time when a create button is clicked, the page is not checked with the model constraints but the reactjs component only. So, without reloading each time the checks are shown on the page as shown in the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Validate.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Making topics table sortable on columns ====&lt;br /&gt;
&lt;br /&gt;
Below are the files modified.&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Signup_topics.PNG]]&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Table_header.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Js.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:css.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Adding topics ====&lt;br /&gt;
&lt;br /&gt;
Tried to add topics using react js code in the file * app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
Modified files code:&lt;br /&gt;
&lt;br /&gt;
[[File:T1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T2.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T3.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T4.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation uses ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:Newassgn_RJS.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Code change details===&lt;br /&gt;
We created a new React class 'NewAssignmentForm' which dynamically creates and displays the form for New assignment. This class has the following methods:&lt;br /&gt;
     getInitialState function(){}      -  Initial method to identify the form parameters that will be sent to the database when a new assignment is created.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
      directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
      nameValidate: function(e){}  - this method validates that a valid project name is entered&lt;br /&gt;
&lt;br /&gt;
      handleCreateAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
      handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
      render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we changed the create method to:&lt;br /&gt;
&lt;br /&gt;
    @assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    @assignment_form.assignment.instructor_id = current_user.id  --  We now pass current instructor to the assignment form.&lt;br /&gt;
      if @assignment_form.save&lt;br /&gt;
        @assignment_form.create_assignment_node&lt;br /&gt;
        flash[:success] = &amp;quot;Assignment Successfully created&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;Failed to Create Assignment&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      end&lt;br /&gt;
     end   &lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we added new method get_courses_node_ng. This method returns the course list array of hashes based on the instructor chosen. This logic is similar to the helper method course_options:&lt;br /&gt;
&lt;br /&gt;
    def get_courses_node_ng&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      courses = []&lt;br /&gt;
        if session[:user].role.name == 'Teaching Assistant'&lt;br /&gt;
          ta = Ta.find(session[:user].id)&lt;br /&gt;
          ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          # If a TA created some courses before, s/he can still add new assignments to these courses.&lt;br /&gt;
          courses &amp;lt;&amp;lt; Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          courses.flatten!&lt;br /&gt;
        # Administrator and Super-Administrator can see all courses&lt;br /&gt;
        elsif session[:user].role.name == 'Administrator' or session[:user].role.name == 'Super-Administrator'&lt;br /&gt;
          courses = Course.all&lt;br /&gt;
        elsif session[:user].role.name == 'Instructor'&lt;br /&gt;
          courses = Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          # instructor can see courses his/her TAs created&lt;br /&gt;
          ta_ids = []&lt;br /&gt;
          ta_ids &amp;lt;&amp;lt; Instructor.get_my_tas(session[:user].id)&lt;br /&gt;
          ta_ids.flatten!&lt;br /&gt;
          ta_ids.each do |ta_id|&lt;br /&gt;
            ta = Ta.find(ta_id)&lt;br /&gt;
            ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        format.html { render json:courses}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
* Below is how output will look like&lt;br /&gt;
[[File:Topics_new.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Correcting the code in edit assignment page too.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
Another way to check is from editing page too.&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit icon page.&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment which is updated with special characters is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Newassgn_RJS.png&amp;diff=108894</id>
		<title>File:Newassgn RJS.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Newassgn_RJS.png&amp;diff=108894"/>
		<updated>2017-05-03T15:52:46Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108893</id>
		<title>File:New imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108893"/>
		<updated>2017-05-03T15:52:23Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:New imp.png&amp;amp;quot;: Reverted to version as of 01:00, 13 April 2017&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New implementation for create&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108892</id>
		<title>File:New imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108892"/>
		<updated>2017-05-03T15:51:24Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:New imp.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New implementation for create&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108891</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108891"/>
		<updated>2017-05-03T15:48:29Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: adding new implementation details for Create assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintenance like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as&lt;br /&gt;
&lt;br /&gt;
This is essential in both new assignment or editing assignment page.&lt;br /&gt;
&lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Though mentioned a mandatory no special characters, it was not properly implemented. System is accepting the special characters.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Vaidatinguser.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''UML Diagram'''&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow of events leading to validations.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
Here is the main code for the regular expression check in Name of assignment and sub directory fields. Now, each time when a create button is clicked, the page is not checked with the model constraints but the reactjs component only. So, without reloading each time the checks are shown on the page as shown in the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Validate.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Making topics table sortable on columns ====&lt;br /&gt;
&lt;br /&gt;
Below are the files modified.&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_add_signup_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Signup_topics.PNG]]&lt;br /&gt;
&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
&lt;br /&gt;
[[File:Table_header.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Js.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:css.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Adding topics ====&lt;br /&gt;
&lt;br /&gt;
Tried to add topics using react js code in the file * app/views/sign_up_sheet/_add_topics.html.erb&lt;br /&gt;
&lt;br /&gt;
Modified files code:&lt;br /&gt;
&lt;br /&gt;
[[File:T1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T2.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T3.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:T4.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation uses ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the view of the new implementation:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Code change details===&lt;br /&gt;
We created a new React class 'NewAssignmentForm' which dynamically creates and displays the form for New assignment. This class has the following methods:&lt;br /&gt;
     getInitialState function(){}      -  Initial method to identify the form parameters that will be sent to the database when a new assignment is created.&lt;br /&gt;
     handleNameChange function(e){}    -  The following methods get triggered on change of the form fields and capture/update the state variables  &lt;br /&gt;
     handleCourseChange: function(e){}  -//-&lt;br /&gt;
     handleSubChange: function(e){}  -//-&lt;br /&gt;
     handleDescChange: function(e){}   -//-&lt;br /&gt;
     handleTeamChange: function(e){}   -//-&lt;br /&gt;
     handleQuizChange: function(e){}   -//-&lt;br /&gt;
     handleDeadlineChange: function(e){}  -//-&lt;br /&gt;
     handleReviewsChange: function(e){}   -//-&lt;br /&gt;
     handleCalibrationChange: function(e){}   -//-&lt;br /&gt;
     handleAvailabilityChange: function(e){}  -//-&lt;br /&gt;
     handleReputationChange: function(e){}   -//-&lt;br /&gt;
&lt;br /&gt;
      directoryValidate: function(e){}  - this method validates that there is valid directory entered&lt;br /&gt;
      nameValidate: function(e){}  - this method validates that a valid project name is entered&lt;br /&gt;
&lt;br /&gt;
      handleCreateAssignment: function(e) {}  - this method sends ajax request with the parameters from the filled form.&lt;br /&gt;
&lt;br /&gt;
      handleGetCourses: function() {}  - this method is triggered when a course selection drop down is clicked. It sends a jQuery request and gets all the courses based on the instructor role &lt;br /&gt;
&lt;br /&gt;
      render: function(){}  - this method renders the form components&lt;br /&gt;
&lt;br /&gt;
In assignment_controller.rb we changed the create method to:&lt;br /&gt;
&lt;br /&gt;
    @assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    @assignment_form.assignment.instructor_id = current_user.id  --  We now pass current instructor to the assignment form.&lt;br /&gt;
      if @assignment_form.save&lt;br /&gt;
        @assignment_form.create_assignment_node&lt;br /&gt;
        flash[:success] = &amp;quot;Assignment Successfully created&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;Failed to Create Assignment&amp;quot;&lt;br /&gt;
        render 'tree_display/list'&lt;br /&gt;
      end&lt;br /&gt;
     end   &lt;br /&gt;
&lt;br /&gt;
In tree_display_controller.rb we added new method get_courses_node_ng. This method returns the course list array of hashes based on the instructor chosen. This logic is similar to the helper method course_options:&lt;br /&gt;
&lt;br /&gt;
    def get_courses_node_ng&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      courses = []&lt;br /&gt;
        if session[:user].role.name == 'Teaching Assistant'&lt;br /&gt;
          ta = Ta.find(session[:user].id)&lt;br /&gt;
          ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          # If a TA created some courses before, s/he can still add new assignments to these courses.&lt;br /&gt;
          courses &amp;lt;&amp;lt; Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          courses.flatten!&lt;br /&gt;
        # Administrator and Super-Administrator can see all courses&lt;br /&gt;
        elsif session[:user].role.name == 'Administrator' or session[:user].role.name == 'Super-Administrator'&lt;br /&gt;
          courses = Course.all&lt;br /&gt;
        elsif session[:user].role.name == 'Instructor'&lt;br /&gt;
          courses = Course.where(instructor_id: session[:user].id)&lt;br /&gt;
          # instructor can see courses his/her TAs created&lt;br /&gt;
          ta_ids = []&lt;br /&gt;
          ta_ids &amp;lt;&amp;lt; Instructor.get_my_tas(session[:user].id)&lt;br /&gt;
          ta_ids.flatten!&lt;br /&gt;
          ta_ids.each do |ta_id|&lt;br /&gt;
            ta = Ta.find(ta_id)&lt;br /&gt;
            ta.ta_mappings.each {|mapping| courses &amp;lt;&amp;lt; Course.find(mapping.course_id) }&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
        format.html { render json:courses}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
* Below is how output will look like&lt;br /&gt;
[[File:Topics_new.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Correcting the code in edit assignment page too.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
Another way to check is from editing page too.&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit icon page.&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment which is updated with special characters is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108890</id>
		<title>File:Edit-new imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108890"/>
		<updated>2017-05-03T15:33:35Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Edit-new imp.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;new implementation for edit form&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108889</id>
		<title>File:New imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108889"/>
		<updated>2017-05-03T15:32:33Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:New imp.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New implementation for create&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108475</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108475"/>
		<updated>2017-04-13T01:44:27Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: formatting change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the mock view of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108473</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108473"/>
		<updated>2017-04-13T01:41:39Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: add fixing tooltips to proposed solution&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips - Needed to increase the proximity of the tool tips in the assignments tab.&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the mock view of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
=== Fixing Tooltips ===&lt;br /&gt;
On exploring, it was noticed that all the existing tooltips work. However, we intend to increase the proximity of the tooltips in the assignment tab by increasing the size of the images.&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108465</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108465"/>
		<updated>2017-04-13T01:33:15Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: add image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the mock view of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
Below is the mock display of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit-new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108464</id>
		<title>File:Edit-new imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit-new_imp.png&amp;diff=108464"/>
		<updated>2017-04-13T01:32:17Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: new implementation for edit form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;new implementation for edit form&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108453</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108453"/>
		<updated>2017-04-13T01:18:58Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: /* Assignment Creation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the mock view of what our implementation is going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108451</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108451"/>
		<updated>2017-04-13T01:18:04Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: /* Assignment Creation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
Below is the mock view of what our implementation going to look like:&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108437</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108437"/>
		<updated>2017-04-13T01:10:25Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: /* Assignment Creation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
[[File:new_imp.png]]&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108433</id>
		<title>File:New imp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_imp.png&amp;diff=108433"/>
		<updated>2017-04-13T01:00:36Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: New implementation for create&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New implementation for create&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New.png&amp;diff=108432</id>
		<title>File:New.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New.png&amp;diff=108432"/>
		<updated>2017-04-13T00:59:58Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:New.png&amp;amp;quot;: Reverted to version as of 02:27, 23 February 2010&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New.png&amp;diff=108431</id>
		<title>File:New.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New.png&amp;diff=108431"/>
		<updated>2017-04-13T00:58:53Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:New.png&amp;amp;quot;: new implementation for create&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108430</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108430"/>
		<updated>2017-04-13T00:41:18Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Upon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive ReactJS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
=== Assignment Creation ===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
=== Assignment Edition ===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
=== Make the table in topics tab sortable by its header ===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
=== Validating user entries ===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
==== Files to be modified ====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108429</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108429"/>
		<updated>2017-04-13T00:36:50Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: formatting change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReactJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Opon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive React JS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108428</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108428"/>
		<updated>2017-04-13T00:36:07Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: external link for reactjs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
[https://en.wikipedia.org/wiki/React_(JavaScript_library) ReatJS] is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Opon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive React JS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108426</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108426"/>
		<updated>2017-04-13T00:31:03Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: formatting change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Opon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive React JS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108418</id>
		<title>File:Create1.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108418"/>
		<updated>2017-04-13T00:20:20Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Create1.JPG&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image of creating assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108416</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108416"/>
		<updated>2017-04-13T00:18:51Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: image alignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. Also, edit page is reloaded whenever a topic is added. The task is to convert this pages into ReactJS components.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit topics in Assignment ===&lt;br /&gt;
In current implementation whenever a topic is added to the assignment, a request is sent to the server and user is redirected to a form in another page. Opon creation of topic user is rendered back to edit assignment page. This process involves lot of redirection. Now, the task is to avoid this redirection of pages and create a interactive React JS form for adding and editing topic.&lt;br /&gt;
&lt;br /&gt;
Currently this logic is implemented in new method in sign_up_controller.rb file and is invoked in the _add_topics.rb ruby injection file. With this action new.html.erb page is rendered. This should be avoided.&lt;br /&gt;
&lt;br /&gt;
'''Add topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Add_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
Similar is the case for editing a topic. For editing a topic user is rendered to a form in edit page and again redirected to edit assignment page.&lt;br /&gt;
&lt;br /&gt;
'''Edit Topic:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Edit_topic_form.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab_assignment.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* Neglecting check boxes may lead to confusion with deadlines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Userentries.png]]&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Addition of topics ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_add_topics.html.erb'' when New Topic link is clicked. This should show a form in that page to create topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/new.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle creation of topic and saving it to database.&lt;br /&gt;
&lt;br /&gt;
=== Editing topic ===&lt;br /&gt;
* An interactive React JS component should be created and should be called by the ruby injection page ''sign_up_sheet/_all_actions.html.erb'' when edit action is clicked. This should show a form in that page to edit topic.&lt;br /&gt;
* Delete/avoid usage of ''sign_up_sheet/edit.html.erb'' page.&lt;br /&gt;
* Implement an React JS functional component to handle editing  of topic and updating it to database.&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The following tasks are to be implemented to achieve users validation,&lt;br /&gt;
* Add the regular expression validation to avoid special characters in the names of assignment or directories.&lt;br /&gt;
* Create alert messages to notify user if any important check boxes are missed.&lt;br /&gt;
* Create validation for edge cases like giving empty values.&lt;br /&gt;
&lt;br /&gt;
The following diagram depicts the flow for future.&lt;br /&gt;
&lt;br /&gt;
[[File:Uml for validation.png]]&lt;br /&gt;
&lt;br /&gt;
===Files to be modified===&lt;br /&gt;
As, the project needs to be implemented in reactJS, which helps in reducing the complexing binding in MVC framework, only changing the javascript file can help to achieve this without changing model,&lt;br /&gt;
* app/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
Rails development is the Test Driven development, which helps in ensuring the implementation of all proposed implementations. We will be writing all the implementations proposed as tests that will eventually be red in rspec and try to make them green by adding to the development part.&lt;br /&gt;
&lt;br /&gt;
For now the manual testing of these current implementations can help in testing the functionality from UI.&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
&lt;br /&gt;
====Topic Creation/Editing====&lt;br /&gt;
* Login as an instructor ''(instructor6/password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Click 'New Topic' link or 'edit' action in topics table for a particular topic&lt;br /&gt;
* A pop window or form should be displayed in the same page&lt;br /&gt;
* Add topic details in that window/ form&lt;br /&gt;
* Save it&lt;br /&gt;
* Created or modified topic should be seen in topics table&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Login as an instructor ''(instructor6/password)''&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
====Validating user entries====&lt;br /&gt;
*Log in as an instructor ''(user-name:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Try adding the assignment using the weird names, with special symbols, ignoring check boxes&lt;br /&gt;
*Verify if the assignment is shown in the table.&lt;br /&gt;
&lt;br /&gt;
===Automation testing===&lt;br /&gt;
The above tests all will be automated using rspec. Rspec Mock-ups will be created for checking the navigation flow of newly created React JS components.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
&lt;br /&gt;
We will try to convert edit assignment page in to React JS. Design pages more clearly.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;br /&gt;
#''https://github.com/expertiza/expertiza/pull/855&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit2.jpg&amp;diff=108414</id>
		<title>File:Edit2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit2.jpg&amp;diff=108414"/>
		<updated>2017-04-13T00:13:29Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: image for opening edit form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image for opening edit form&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit.jpg&amp;diff=108412</id>
		<title>File:Edit.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit.jpg&amp;diff=108412"/>
		<updated>2017-04-13T00:11:02Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Edit.jpg&amp;amp;quot;: reduced size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image for editing assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create2.JPG&amp;diff=108410</id>
		<title>File:Create2.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create2.JPG&amp;diff=108410"/>
		<updated>2017-04-13T00:10:27Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Create2.JPG&amp;amp;quot;: Reduced size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;another image for creating assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108408</id>
		<title>File:Create1.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108408"/>
		<updated>2017-04-13T00:09:45Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: uploaded a new version of &amp;amp;quot;File:Create1.JPG&amp;amp;quot;: reduced size image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image of creating assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108005</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108005"/>
		<updated>2017-04-07T05:18:04Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: adding images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale &lt;br /&gt;
&lt;br /&gt;
===Pros===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. The task is to convert this form into ReactJS component.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
[[File:Create1.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create2.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* User can add sub directories in similar way as assignment name.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(username:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(username:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
We will automate the tests following the same steps described above using rspec.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit.jpg&amp;diff=108004</id>
		<title>File:Edit.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit.jpg&amp;diff=108004"/>
		<updated>2017-04-07T04:54:05Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: image for editing assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image for editing assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create2.JPG&amp;diff=108003</id>
		<title>File:Create2.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create2.JPG&amp;diff=108003"/>
		<updated>2017-04-07T04:53:04Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: another image for creating assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;another image for creating assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108002</id>
		<title>File:Create1.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create1.JPG&amp;diff=108002"/>
		<updated>2017-04-07T04:52:01Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: image of creating assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image of creating assignment&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108001</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=108001"/>
		<updated>2017-04-07T04:50:17Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: proposed solution and test plan added for creating and editing assignments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale &lt;br /&gt;
&lt;br /&gt;
===Pros===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. The task is to convert this form into ReactJS component.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Currently after creating an assignment, we can add topics related to the assignment. The &amp;quot;Topics&amp;quot; tab in the edit assignment form shows the list of topics that are added to the assignment. The picture below shows the current page for displaying the list of topics of an assignment. The list is not sortable. The task is to make it sortable using ReactJS by topic id, topic name, Num. of slots, Available slots, Num. on waitlist columns as sorting on remaining columns doesn't give any meaningful display.&lt;br /&gt;
&lt;br /&gt;
[[File:topics_tab.png]]&lt;br /&gt;
&lt;br /&gt;
===Validating user entries===&lt;br /&gt;
The entries for the assignment creation are not according to any restrictions, that can add problem to database maintainence like sorting the entries, comparing them, retrieving. There are many such problem causing situations in the new assignment form, such as &lt;br /&gt;
* User can add the number as new assignment name or he can give only special characters for it like &amp;quot;$$$$&amp;quot;.&lt;br /&gt;
* User can add sub directories in similar way as assignment name.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The new implementation will use ReactJS to generate a drop-down window on clicking on the New Assignment button (private/public) , providing same features as before. Database entry is made on submitting the form and the form is closed.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/assets/javascripts/tree_display.jsx.erb&lt;br /&gt;
*apps/controllers/assignments_controller.rb&lt;br /&gt;
*apps/controllers/tree_display_controller.rb&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation, in the new implementation, using ReactJS, when the edit assignment button is clicked, instead of making a server request and rendering a new view, a drop down window appears and saving the details will make the database entry.Since all the processing is done on the client side there will be decrease in the number of server requests.&lt;br /&gt;
&lt;br /&gt;
====Files to be modified====&lt;br /&gt;
*apps/views/tree_display/list.html.erb&lt;br /&gt;
*apps/views/assignments/edit.html.erb&lt;br /&gt;
*apps/views/assignments/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
===Make the table in topics tab sortable by its header===&lt;br /&gt;
Following sub-tasks identified to implement sortable feature for topics table.&lt;br /&gt;
* Modify sign_up_sheet/_table_header.html.erb partial to change the table header fields to sortable type.&lt;br /&gt;
* Add sort functionality using ReactJS for each column that is meaningful to be sorted.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
===Manual Testing===&lt;br /&gt;
Steps to manually test the feature are as follows: &lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(username:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the 'New public assignment' or 'New private assignment' button&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make valid entries for the available fields and click on 'create'.&lt;br /&gt;
*Verify if new assignment is successfully created.&lt;br /&gt;
&lt;br /&gt;
====Assignment Creation====&lt;br /&gt;
*Log in as an instructor ''(username:instructor6 password:password)''&lt;br /&gt;
*Go to Manage-&amp;gt;Assignments and click on the Assignments tab.&lt;br /&gt;
*Click on the Edit button for any of the available assignment.&lt;br /&gt;
*Verify if drop-down window is displayed.&lt;br /&gt;
*Make changes and click on 'save'.&lt;br /&gt;
*Verify if the changes made are successfully updated.&lt;br /&gt;
 &lt;br /&gt;
====Make the table in topics tab sortable by its header====&lt;br /&gt;
* Create an assignment&lt;br /&gt;
* Add 2 topics to the assignment&lt;br /&gt;
* Click sort on Topic ID and check if they are sorted&lt;br /&gt;
* Click sort on Topic title and check if they are sorted&lt;br /&gt;
* Similarly test using other columns&lt;br /&gt;
&lt;br /&gt;
We will automate the tests following the same steps described above using rspec.&lt;br /&gt;
&lt;br /&gt;
==Future Work==&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#''http://railscasts.com/episodes/228-sortable-table-columns sortable-columns''&lt;br /&gt;
#''https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers adding-reactjs''&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107989</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107989"/>
		<updated>2017-04-07T02:29:09Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Current implementation for assignment creation &amp;amp; edition added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale &lt;br /&gt;
&lt;br /&gt;
===Pros===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. The task is to convert this form into ReactJS component.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
===Assignment Creation===&lt;br /&gt;
The assignment creation form consists of multiple inputs and requires interactions from the user. The current implementation is mostly in HTML with data validations being done by JQuery. When a user wants to create a new assignment by clicking the new assignment button, a server request is generated and new view is rendered. Again, another server request to make database entry is generated once the user fills in the data and clicks on 'save' button and again a new view is rendered. This kind of implementation doesn't support dynamic view rendering hence lacks the fluidity in overall user experience that one would expect.&lt;br /&gt;
&lt;br /&gt;
===Assignment Edition===&lt;br /&gt;
Similar to assignment creation page, edit page lacks the dynamic view rendering which makes the user experience cumbersome. Every time user wants to make changes to the assignment, a server request is generated and new view is rendered. The save button hit on completion will again generate another server request and render a new view.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
==Test Plan==&lt;br /&gt;
==Future Work==&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107986</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107986"/>
		<updated>2017-04-07T02:14:49Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Problem statement updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale &lt;br /&gt;
&lt;br /&gt;
===Pros===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The Assignment Create and Edit Form are multi level forms. It consists of multiple inputs  and user interactions. Many input types have dependency on interactions by the user. For example, on check for a particular checkbox, remaining form is displayed. The task is to convert this form into ReactJS component.&lt;br /&gt;
&lt;br /&gt;
'''Tasks to be done'''&lt;br /&gt;
*Organize the form layout, create several mockups and validate them to your users&lt;br /&gt;
*Make the table in topics tab sortable by its header&lt;br /&gt;
*Allow users to edit / add topics in the table instead of loading a new page&lt;br /&gt;
*Implement the new layout and convert the javascript to a ReactJS component&lt;br /&gt;
*Validate user entries&lt;br /&gt;
*Fix tooltips that don’t work&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
==Test Plan==&lt;br /&gt;
==Future Work==&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107985</id>
		<title>CSC/ECE 517 Spring 2017/Convert Assignment Creation Form to ReactJS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017/Convert_Assignment_Creation_Form_to_ReactJS&amp;diff=107985"/>
		<updated>2017-04-07T02:09:08Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Introduction to expertiza added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a part of CSC/ECE 517 Final Project for Spring 2017 to describe the changes made by us to the open source software project Expertiza. We are converting the assignment creation form to ReactJS. Following contains a brief introduction to Expertiza, ReactJS followed by the problems we are tackling, our strategy for the implementation and the test plan.&lt;br /&gt;
   &lt;br /&gt;
==Expertiza==&lt;br /&gt;
Expertiza is a Ruby on Rails based web application where students can submit and peer review learning objects such as codes, articles, websites etc., It is an open source software project funded by National Science Foundation(NSF). The instructor has the capability to create assignments with varied specifications such as topics, courses, team size, level of reviews etc., later review the submitted work and provide feedback. Students can enter their submissions and also review others' work. &lt;br /&gt;
&lt;br /&gt;
==ReactJS==&lt;br /&gt;
ReactJS is the javascript framework developed by Facebook to solve the specific problem, ''UI rendering''. It is developed to solve the problem with complex binding in MVC framework using only one-way data binding. It is used for dynamic reloading of the page. It helps in reloading only the particular component required using Virtual DOM, which makes it fast by temporarily storing DOM&lt;br /&gt;
&lt;br /&gt;
'''Reasons for using ReactJS'''&lt;br /&gt;
* It has every functionality that an user interface required&lt;br /&gt;
* Easy data binding.&lt;br /&gt;
* Only single component changes are stored/changed without reloading the complete page.&lt;br /&gt;
* Fast and efficient&lt;br /&gt;
* Easy to scale &lt;br /&gt;
&lt;br /&gt;
===Pros===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
==Test Plan==&lt;br /&gt;
==Future Work==&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107305</id>
		<title>CSC/CSC 517 Spring 2017/oss E1718</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107305"/>
		<updated>2017-03-23T23:05:51Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: formatting change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1718 was the project code for an Expertiza OSS assignment. It largely dealt with the handling of how peer reviews are assigned to students.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a collaborative open source project that allows courses to create assignments for students. One of the main functions of Expertiza is to allow students to peer review the submitted assignments by their fellow classmates. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== E1718 ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
This page covers the E1718 project. E1718 covers the system behind assigning peer reviews to students. The main focus of this topic is the thresholds that guide which submissions a student can review as well as how many they need to review, and can review. A review can either be assigned to a student by the instructor, or it can be requested directly by the student. When the student handles it they can choose to be assigned a random submission, or they can choose the topic which they wish to review. Assignments can be set up so that each student must review a minimum number of submissions, with the choice of extra credit for completing up to a maximum number of reviews. When review topics are chosen, Expertiza sets it up so that the student can only choose a topic that has a low enough number of other reviews. At times this can constrain the choices a student has, so to fix this the instructor can set the threshold to allow for more choices. The threshold itself is the acceptable range for the number of reviews a topic has compared to the least reviewed topic. For instance, lets say there are three topics: Blue, Red and Green. Blue has had 1 review, Red has had 2 reviews, and Green has had 3 reviews. If the threshold is set to 0, then the only topic that can be chosen for review is Blue. If the threshold is 1, then both Blue and Red can be chosen. If it is 3, then all 3 topics can be chosen.&lt;br /&gt;
&lt;br /&gt;
By solving the issues raised by E1718 this system will be improved in several ways. As currently set up, if a student has already reviewed all assignments within the minimum threshold, they will be unable to request another review. To solve this, when a student has reviewed all submissions within threshold k, the system should increase the threshold by m so that the student can review all submissions within threshold k+m. The current version of Expertiza also fails to show a student what the minimum number of reviews they must complete is, as well as the upper limit of reviews allowed. This will be fixed in this project so that an instructor can set the minimum and maximum number of reviews from the Review Strategy tab, and those limits show up on the student's end when viewing Others' Work. A previous issue that has since been solved was that a student was allowed to review their own submission. While this did not need further work, it did need automated testing to be written for it. Those tests were completed, as well as tests for the issues described above.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Issues ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''228:''' Increase the threshold for a student who has already completed reviews for all submissions with the minimum number.&lt;br /&gt;
&lt;br /&gt;
'''402:''' Write automated tests to check if a student can review a topic only they have submitted on.&lt;br /&gt;
&lt;br /&gt;
'''417:''' Implement a num_reviews_required (and num_reviews_allowed) field in the assignments table to say how many reviews per reviewer are required, and how many are allowed (default should be # allowed = # req’d.).  Make it settable from the Review Strategy tab (see Issue 417) and viewable when a student clicks on “Others’ work”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Solutions ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Project Files (new or changed)'''&lt;br /&gt;
&lt;br /&gt;
*expertiza/spec/features/review_assignment.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074046_add_num_metareviews_required_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074238_add_num_metareviews_allowed_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/schema.rb&lt;br /&gt;
*expertiza/app/models/assignment_form.rb&lt;br /&gt;
*expertiza/app/models/review_assignment.rb&lt;br /&gt;
*expertiza/app/views/assignments/edit/_review_strategy.html.erb&lt;br /&gt;
*expertiza/app/views/student_review/list.html.erb&lt;br /&gt;
*expertiza/spec/features/review_assignement_spec.rb&lt;br /&gt;
&lt;br /&gt;
'''Issue 228'''&lt;br /&gt;
&lt;br /&gt;
According to this issue, the reviewers, having reviewed the submission with the fewest outstanding reviews, can't review any other submission until the submission they've just reviewed catches up to other submissions in number of reviews. Reviewers who have already reviewed the submission with the fewest reviews should be able to review the submission with the next fewest reviews, regardless of what the threshold is. Solution to this would be, every time a student requests for review, setup a proper filtering process with appropriate thresholds. &lt;br /&gt;
&lt;br /&gt;
If topic x and topic y has two reviews each and topic z has no reviews, the reviewer is allowed to review topic z, as it has the least number of reviews. He is not allowed anymore reviews until topic z catches up with x and y. To rectify this, changes were made to review_assignment.rb file where when review is requested, initially the responses with no entries, self submitted topic are filtered out from the review pool. Then, if the reviewer has done any other reviews before, such reviews are filtered out. Then the review pool is combed for submissions with least reviews and the minimum reviews count is obtained. This, added to review_topic_threshold becomes the benchmarch against which number of reviews for a topic is measured, and if it’s less than the benchmark, the review is assigned to the requestee. This way, the reviewer is provided with more flexible review policy than before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def filter_least_reviewed(contributor_set)&lt;br /&gt;
      contributor = contributor_set.min_by {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count }&lt;br /&gt;
      minimum_reviews = contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count rescue 0&lt;br /&gt;
      allowed_reviews = minimum_reviews + review_topic_threshold&lt;br /&gt;
      contributor_set.reject! {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count &amp;gt; allowed_reviews }&lt;br /&gt;
&lt;br /&gt;
      contributor_set&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 402'''&lt;br /&gt;
&lt;br /&gt;
This solution required the creation of the review_assignment_spec.rb file. It conducts tests to ensure that a student may not review a topic in which their submission is the only one. This tests the review_assignment.rb module, which is heavily used by assignment.rb and review_mapping_controller.rb.&lt;br /&gt;
&lt;br /&gt;
The specific tests that examined this potential error are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;is not able to be assigned to review a topic only they have submitted on&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;is not able to select topic for review only they have submitted to&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    expect(page).to have_content 'Reviews for &amp;quot;TestAssignment&amp;quot;'&lt;br /&gt;
    expect(page).not_to have_button(&amp;quot;topic_id_#{SignUpTopic.find_by_topic_name(&amp;quot;TestTopic&amp;quot;).id}&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first test checks to see if a student can be assigned their own submission if they request a review via the &amp;quot;I don't care&amp;quot; checkbox, which allows them to be assigned a submission from any topic. Doing so correctly triggered the warning message &amp;quot;No topics are available to review at this time. Please try later.&amp;quot; This was further backed up by a test in which another student submitted an assignment and the same path was followed. This case did not trigger a warning and the student was correctly assigned the submission. This shows the check is working as intended.&lt;br /&gt;
&lt;br /&gt;
The second test checks to see if a student can choose a topic in which their assignment is the only submission. This was the main focus of issue 402. When choosing a topic the student must select a radio button for that topic and then request a review. This was no longer possible after the 402 fix as the student was unable to select the radio button for the topic if they were the only one who had submitted to it. Consequentially, this prevented the student from reaching the error message described in issue 402 &amp;quot;There are no more submissions to review on that topic.&amp;quot; This test passed as expected showing the issue had been resolved. It was also tested whether they could select a topic in which they weren't the only submission, and this test passed as expected as well.&lt;br /&gt;
&lt;br /&gt;
'''Issue 417'''&lt;br /&gt;
&lt;br /&gt;
The 4 variables - num_reviews, num_reviews_required, num_metareviews_required and num_metareviews_allowed - are added to the assignment table using rails migration. The default of these variables are set to 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class AddNumReviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_reviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumReviewsToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      change_column :assignments, :num_reviews, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsAllowedToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_allowed, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These variables are viewable at &amp;quot;others&amp;quot; page for each assignment in students account, and settable at &amp;quot;edit assignment&amp;quot; page, &amp;quot;review_strategy&amp;quot; tab in instructor's account. The instructor are allowed to choose whether they want upper bound on number of reviews (num_reviews &amp;amp;&amp;amp; num_metareviews_allowed) by clicking check box. By this way, the instructor can allow students to review as many submission as possible but grading only required number of reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Validations are done by checking whether the number of reviews required is less than number of reviews allowed. i.e.) num_reviews_required &amp;lt;= num_reviews_allowed. Similarly for condition follows for meta reviews. These validation are done in assignment.rb file and are executed before an update is saved into database. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   class Assignment &amp;lt; ActiveRecord::Base&lt;br /&gt;
      validate :valid_num_review&lt;br /&gt;
      def valid_num_review&lt;br /&gt;
        if(self.num_reviews &amp;amp;&amp;amp; self.num_reviews != -1 &amp;amp;&amp;amp; self.num_reviews &amp;lt; self.num_reviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Num of reviews required cannot be greater than number of reviews allowed&amp;quot;)&lt;br /&gt;
         elsif(self.num_metareviews_allowed &amp;amp;&amp;amp; self.num_metareviews_allowed != -1 &amp;amp;&amp;amp; self.num_metareviews_allowed &amp;lt; self.num_metareviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Number of Meta-Reviews required cannot be greater than number of meta-reviews allowed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here num_reviews and num_metareviews_allowed are negative when the upper bound for reivews are infinity.&lt;br /&gt;
&lt;br /&gt;
The corresponding tests are written in assignment_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Review&amp;quot; do&lt;br /&gt;
    @assignment.num_reviews = 1&lt;br /&gt;
    @assignment.num_reviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Meta-Review&amp;quot; do&lt;br /&gt;
    @assignment.num_metareviews_allowed = 1&lt;br /&gt;
    @assignment.num_metareviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first test checks whether num_reviews accepts values less than num_reviews_required for which the validation should fail.&lt;br /&gt;
The Second test checks whether num_metareviews_allowed accepts values less than num_metareviews_required for which the validation should fail too.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Manual Testing ==&lt;br /&gt;
'''&lt;br /&gt;
*Please follow these instructions for testing these solutions manually.&lt;br /&gt;
&lt;br /&gt;
'''228'''&lt;br /&gt;
* Log in as instructor(user:instructor6) and create a new assignment and add four students to the assignment(user:student360,student361,student362,student364). &lt;br /&gt;
* Log in as student, submit an artifact. (e.g:a test link)&lt;br /&gt;
* Log in as second student and submit an artifact.&lt;br /&gt;
* Log in as first student and review an artifact, since there is only one other submission at this point, second student's submission is up for review.&lt;br /&gt;
* Log in as second student and review an artifact.&lt;br /&gt;
* Now, log in as third student, submit an artifact and also do two reviews, naturally you would be reviewing first and second student's submissions.&lt;br /&gt;
* At this point, first and second students' submission has two reviews and third student's submission has zero review. &lt;br /&gt;
* Now, log in as the fourth student and review, you should be allowed to review all three artifacts instead of just the one with least reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''402'''&lt;br /&gt;
*Log in with an instructor.&lt;br /&gt;
*Create an assignment with topics to choose from.&lt;br /&gt;
*Log in with a student.&lt;br /&gt;
*Sign up for one of the topics from the previously created assignment.&lt;br /&gt;
*Submit an assignment for that topic.&lt;br /&gt;
*Go to the Others' Work tab.&lt;br /&gt;
*Attempt to select that topic for review -OR- Check the box for &amp;quot;I Don't Care&amp;quot;&lt;br /&gt;
*Attempt to request review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''417'''&lt;br /&gt;
*Log in as an instructor&lt;br /&gt;
*go to edit page of an assignment and navigate to Review Strategy tab.&lt;br /&gt;
*Change the allowed and required field of reviews and meta-reviews.&lt;br /&gt;
*Try giving greater value for required field than allowed field. It should throw an error stating the relevant message.&lt;br /&gt;
*Give the correct value and save it.&lt;br /&gt;
*Sign in as a student who has enrolled for that particular assignment.&lt;br /&gt;
*go to &amp;quot;others&amp;quot; page.&lt;br /&gt;
*The allowed and required field are displayed saying that the assignment requires atleast k reviews.&lt;br /&gt;
*If meta-review is enabled for that topic then the meta-review information is also displayed. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Website]&lt;br /&gt;
#[https://github.com/crajase/expertiza Expertiza GitHub Fork]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/228 Issue 228]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/402 Issue 402]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/417 Issue 417]&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107304</id>
		<title>CSC/CSC 517 Spring 2017/oss E1718</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107304"/>
		<updated>2017-03-23T23:05:16Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Manual testing for 228&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1718 was the project code for an Expertiza OSS assignment. It largely dealt with the handling of how peer reviews are assigned to students.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a collaborative open source project that allows courses to create assignments for students. One of the main functions of Expertiza is to allow students to peer review the submitted assignments by their fellow classmates. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== E1718 ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
This page covers the E1718 project. E1718 covers the system behind assigning peer reviews to students. The main focus of this topic is the thresholds that guide which submissions a student can review as well as how many they need to review, and can review. A review can either be assigned to a student by the instructor, or it can be requested directly by the student. When the student handles it they can choose to be assigned a random submission, or they can choose the topic which they wish to review. Assignments can be set up so that each student must review a minimum number of submissions, with the choice of extra credit for completing up to a maximum number of reviews. When review topics are chosen, Expertiza sets it up so that the student can only choose a topic that has a low enough number of other reviews. At times this can constrain the choices a student has, so to fix this the instructor can set the threshold to allow for more choices. The threshold itself is the acceptable range for the number of reviews a topic has compared to the least reviewed topic. For instance, lets say there are three topics: Blue, Red and Green. Blue has had 1 review, Red has had 2 reviews, and Green has had 3 reviews. If the threshold is set to 0, then the only topic that can be chosen for review is Blue. If the threshold is 1, then both Blue and Red can be chosen. If it is 3, then all 3 topics can be chosen.&lt;br /&gt;
&lt;br /&gt;
By solving the issues raised by E1718 this system will be improved in several ways. As currently set up, if a student has already reviewed all assignments within the minimum threshold, they will be unable to request another review. To solve this, when a student has reviewed all submissions within threshold k, the system should increase the threshold by m so that the student can review all submissions within threshold k+m. The current version of Expertiza also fails to show a student what the minimum number of reviews they must complete is, as well as the upper limit of reviews allowed. This will be fixed in this project so that an instructor can set the minimum and maximum number of reviews from the Review Strategy tab, and those limits show up on the student's end when viewing Others' Work. A previous issue that has since been solved was that a student was allowed to review their own submission. While this did not need further work, it did need automated testing to be written for it. Those tests were completed, as well as tests for the issues described above.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Issues ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''228:''' Increase the threshold for a student who has already completed reviews for all submissions with the minimum number.&lt;br /&gt;
&lt;br /&gt;
'''402:''' Write automated tests to check if a student can review a topic only they have submitted on.&lt;br /&gt;
&lt;br /&gt;
'''417:''' Implement a num_reviews_required (and num_reviews_allowed) field in the assignments table to say how many reviews per reviewer are required, and how many are allowed (default should be # allowed = # req’d.).  Make it settable from the Review Strategy tab (see Issue 417) and viewable when a student clicks on “Others’ work”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Solutions ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Project Files (new or changed)'''&lt;br /&gt;
&lt;br /&gt;
*expertiza/spec/features/review_assignment.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074046_add_num_metareviews_required_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074238_add_num_metareviews_allowed_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/schema.rb&lt;br /&gt;
*expertiza/app/models/assignment_form.rb&lt;br /&gt;
*expertiza/app/models/review_assignment.rb&lt;br /&gt;
*expertiza/app/views/assignments/edit/_review_strategy.html.erb&lt;br /&gt;
*expertiza/app/views/student_review/list.html.erb&lt;br /&gt;
*expertiza/spec/features/review_assignement_spec.rb&lt;br /&gt;
&lt;br /&gt;
'''Issue 228'''&lt;br /&gt;
&lt;br /&gt;
According to this issue, the reviewers, having reviewed the submission with the fewest outstanding reviews, can't review any other submission until the submission they've just reviewed catches up to other submissions in number of reviews. Reviewers who have already reviewed the submission with the fewest reviews should be able to review the submission with the next fewest reviews, regardless of what the threshold is. Solution to this would be, every time a student requests for review, setup a proper filtering process with appropriate thresholds. &lt;br /&gt;
&lt;br /&gt;
If topic x and topic y has two reviews each and topic z has no reviews, the reviewer is allowed to review topic z, as it has the least number of reviews. He is not allowed anymore reviews until topic z catches up with x and y. To rectify this, changes were made to review_assignment.rb file where when review is requested, initially the responses with no entries, self submitted topic are filtered out from the review pool. Then, if the reviewer has done any other reviews before, such reviews are filtered out. Then the review pool is combed for submissions with least reviews and the minimum reviews count is obtained. This, added to review_topic_threshold becomes the benchmarch against which number of reviews for a topic is measured, and if it’s less than the benchmark, the review is assigned to the requestee. This way, the reviewer is provided with more flexible review policy than before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def filter_least_reviewed(contributor_set)&lt;br /&gt;
      contributor = contributor_set.min_by {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count }&lt;br /&gt;
      minimum_reviews = contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count rescue 0&lt;br /&gt;
      allowed_reviews = minimum_reviews + review_topic_threshold&lt;br /&gt;
      contributor_set.reject! {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count &amp;gt; allowed_reviews }&lt;br /&gt;
&lt;br /&gt;
      contributor_set&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 402'''&lt;br /&gt;
&lt;br /&gt;
This solution required the creation of the review_assignment_spec.rb file. It conducts tests to ensure that a student may not review a topic in which their submission is the only one. This tests the review_assignment.rb module, which is heavily used by assignment.rb and review_mapping_controller.rb.&lt;br /&gt;
&lt;br /&gt;
The specific tests that examined this potential error are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;is not able to be assigned to review a topic only they have submitted on&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;is not able to select topic for review only they have submitted to&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    expect(page).to have_content 'Reviews for &amp;quot;TestAssignment&amp;quot;'&lt;br /&gt;
    expect(page).not_to have_button(&amp;quot;topic_id_#{SignUpTopic.find_by_topic_name(&amp;quot;TestTopic&amp;quot;).id}&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first test checks to see if a student can be assigned their own submission if they request a review via the &amp;quot;I don't care&amp;quot; checkbox, which allows them to be assigned a submission from any topic. Doing so correctly triggered the warning message &amp;quot;No topics are available to review at this time. Please try later.&amp;quot; This was further backed up by a test in which another student submitted an assignment and the same path was followed. This case did not trigger a warning and the student was correctly assigned the submission. This shows the check is working as intended.&lt;br /&gt;
&lt;br /&gt;
The second test checks to see if a student can choose a topic in which their assignment is the only submission. This was the main focus of issue 402. When choosing a topic the student must select a radio button for that topic and then request a review. This was no longer possible after the 402 fix as the student was unable to select the radio button for the topic if they were the only one who had submitted to it. Consequentially, this prevented the student from reaching the error message described in issue 402 &amp;quot;There are no more submissions to review on that topic.&amp;quot; This test passed as expected showing the issue had been resolved. It was also tested whether they could select a topic in which they weren't the only submission, and this test passed as expected as well.&lt;br /&gt;
&lt;br /&gt;
'''Issue 417'''&lt;br /&gt;
&lt;br /&gt;
The 4 variables - num_reviews, num_reviews_required, num_metareviews_required and num_metareviews_allowed - are added to the assignment table using rails migration. The default of these variables are set to 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class AddNumReviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_reviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumReviewsToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      change_column :assignments, :num_reviews, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsAllowedToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_allowed, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These variables are viewable at &amp;quot;others&amp;quot; page for each assignment in students account, and settable at &amp;quot;edit assignment&amp;quot; page, &amp;quot;review_strategy&amp;quot; tab in instructor's account. The instructor are allowed to choose whether they want upper bound on number of reviews (num_reviews &amp;amp;&amp;amp; num_metareviews_allowed) by clicking check box. By this way, the instructor can allow students to review as many submission as possible but grading only required number of reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Validations are done by checking whether the number of reviews required is less than number of reviews allowed. i.e.) num_reviews_required &amp;lt;= num_reviews_allowed. Similarly for condition follows for meta reviews. These validation are done in assignment.rb file and are executed before an update is saved into database. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   class Assignment &amp;lt; ActiveRecord::Base&lt;br /&gt;
      validate :valid_num_review&lt;br /&gt;
      def valid_num_review&lt;br /&gt;
        if(self.num_reviews &amp;amp;&amp;amp; self.num_reviews != -1 &amp;amp;&amp;amp; self.num_reviews &amp;lt; self.num_reviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Num of reviews required cannot be greater than number of reviews allowed&amp;quot;)&lt;br /&gt;
         elsif(self.num_metareviews_allowed &amp;amp;&amp;amp; self.num_metareviews_allowed != -1 &amp;amp;&amp;amp; self.num_metareviews_allowed &amp;lt; self.num_metareviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Number of Meta-Reviews required cannot be greater than number of meta-reviews allowed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here num_reviews and num_metareviews_allowed are negative when the upper bound for reivews are infinity.&lt;br /&gt;
&lt;br /&gt;
The corresponding tests are written in assignment_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Review&amp;quot; do&lt;br /&gt;
    @assignment.num_reviews = 1&lt;br /&gt;
    @assignment.num_reviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Meta-Review&amp;quot; do&lt;br /&gt;
    @assignment.num_metareviews_allowed = 1&lt;br /&gt;
    @assignment.num_metareviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first test checks whether num_reviews accepts values less than num_reviews_required for which the validation should fail.&lt;br /&gt;
The Second test checks whether num_metareviews_allowed accepts values less than num_metareviews_required for which the validation should fail too.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Manual Testing ==&lt;br /&gt;
'''&lt;br /&gt;
*Please follow these instructions for testing these solutions manually.&lt;br /&gt;
&lt;br /&gt;
'''228'''&lt;br /&gt;
* Log in as instructor(user:instructor6) and create a new assignment and add four students to the assignment(user:student360,student361,student362,student364). &lt;br /&gt;
* Log in as student, submit an artifact. (e.g:a test link)&lt;br /&gt;
* Log in as second student and submit an artifact.&lt;br /&gt;
* Log in as first student and review an artifact, since there is only one other submission at this point, second student's submission is up for review.&lt;br /&gt;
* Log in as second student and review an artifact.&lt;br /&gt;
* Now, log in as third student, submit an artifact and also do two reviews, naturally you would be reviewing first and second student's submissions.&lt;br /&gt;
* At this point, first and second students' submission has two reviews and third student's submission has zero review. &lt;br /&gt;
* Now, log in as the fourth student and review, you should be allowed to review all three artifacts instead of just the one with least reviews.&lt;br /&gt;
&lt;br /&gt;
'''402'''&lt;br /&gt;
*Log in with an instructor.&lt;br /&gt;
*Create an assignment with topics to choose from.&lt;br /&gt;
*Log in with a student.&lt;br /&gt;
*Sign up for one of the topics from the previously created assignment.&lt;br /&gt;
*Submit an assignment for that topic.&lt;br /&gt;
*Go to the Others' Work tab.&lt;br /&gt;
*Attempt to select that topic for review -OR- Check the box for &amp;quot;I Don't Care&amp;quot;&lt;br /&gt;
*Attempt to request review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''417'''&lt;br /&gt;
*Log in as an instructor&lt;br /&gt;
*go to edit page of an assignment and navigate to Review Strategy tab.&lt;br /&gt;
*Change the allowed and required field of reviews and meta-reviews.&lt;br /&gt;
*Try giving greater value for required field than allowed field. It should throw an error stating the relevant message.&lt;br /&gt;
*Give the correct value and save it.&lt;br /&gt;
*Sign in as a student who has enrolled for that particular assignment.&lt;br /&gt;
*go to &amp;quot;others&amp;quot; page.&lt;br /&gt;
*The allowed and required field are displayed saying that the assignment requires atleast k reviews.&lt;br /&gt;
*If meta-review is enabled for that topic then the meta-review information is also displayed. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Website]&lt;br /&gt;
#[https://github.com/crajase/expertiza Expertiza GitHub Fork]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/228 Issue 228]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/402 Issue 402]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/417 Issue 417]&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107303</id>
		<title>CSC/CSC 517 Spring 2017/oss E1718</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107303"/>
		<updated>2017-03-23T22:59:27Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: formatting change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1718 was the project code for an Expertiza OSS assignment. It largely dealt with the handling of how peer reviews are assigned to students.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a collaborative open source project that allows courses to create assignments for students. One of the main functions of Expertiza is to allow students to peer review the submitted assignments by their fellow classmates. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== E1718 ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
This page covers the E1718 project. E1718 covers the system behind assigning peer reviews to students. The main focus of this topic is the thresholds that guide which submissions a student can review as well as how many they need to review, and can review. A review can either be assigned to a student by the instructor, or it can be requested directly by the student. When the student handles it they can choose to be assigned a random submission, or they can choose the topic which they wish to review. Assignments can be set up so that each student must review a minimum number of submissions, with the choice of extra credit for completing up to a maximum number of reviews. When review topics are chosen, Expertiza sets it up so that the student can only choose a topic that has a low enough number of other reviews. At times this can constrain the choices a student has, so to fix this the instructor can set the threshold to allow for more choices. The threshold itself is the acceptable range for the number of reviews a topic has compared to the least reviewed topic. For instance, lets say there are three topics: Blue, Red and Green. Blue has had 1 review, Red has had 2 reviews, and Green has had 3 reviews. If the threshold is set to 0, then the only topic that can be chosen for review is Blue. If the threshold is 1, then both Blue and Red can be chosen. If it is 3, then all 3 topics can be chosen.&lt;br /&gt;
&lt;br /&gt;
By solving the issues raised by E1718 this system will be improved in several ways. As currently set up, if a student has already reviewed all assignments within the minimum threshold, they will be unable to request another review. To solve this, when a student has reviewed all submissions within threshold k, the system should increase the threshold by m so that the student can review all submissions within threshold k+m. The current version of Expertiza also fails to show a student what the minimum number of reviews they must complete is, as well as the upper limit of reviews allowed. This will be fixed in this project so that an instructor can set the minimum and maximum number of reviews from the Review Strategy tab, and those limits show up on the student's end when viewing Others' Work. A previous issue that has since been solved was that a student was allowed to review their own submission. While this did not need further work, it did need automated testing to be written for it. Those tests were completed, as well as tests for the issues described above.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Issues ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''228:''' Increase the threshold for a student who has already completed reviews for all submissions with the minimum number.&lt;br /&gt;
&lt;br /&gt;
'''402:''' Write automated tests to check if a student can review a topic only they have submitted on.&lt;br /&gt;
&lt;br /&gt;
'''417:''' Implement a num_reviews_required (and num_reviews_allowed) field in the assignments table to say how many reviews per reviewer are required, and how many are allowed (default should be # allowed = # req’d.).  Make it settable from the Review Strategy tab (see Issue 417) and viewable when a student clicks on “Others’ work”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Solutions ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Project Files (new or changed)'''&lt;br /&gt;
&lt;br /&gt;
*expertiza/spec/features/review_assignment.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074046_add_num_metareviews_required_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074238_add_num_metareviews_allowed_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/schema.rb&lt;br /&gt;
*expertiza/app/models/assignment_form.rb&lt;br /&gt;
*expertiza/app/models/review_assignment.rb&lt;br /&gt;
*expertiza/app/views/assignments/edit/_review_strategy.html.erb&lt;br /&gt;
*expertiza/app/views/student_review/list.html.erb&lt;br /&gt;
*expertiza/spec/features/review_assignement_spec.rb&lt;br /&gt;
&lt;br /&gt;
'''Issue 228'''&lt;br /&gt;
&lt;br /&gt;
According to this issue, the reviewers, having reviewed the submission with the fewest outstanding reviews, can't review any other submission until the submission they've just reviewed catches up to other submissions in number of reviews. Reviewers who have already reviewed the submission with the fewest reviews should be able to review the submission with the next fewest reviews, regardless of what the threshold is. Solution to this would be, every time a student requests for review, setup a proper filtering process with appropriate thresholds. &lt;br /&gt;
&lt;br /&gt;
If topic x and topic y has two reviews each and topic z has no reviews, the reviewer is allowed to review topic z, as it has the least number of reviews. He is not allowed anymore reviews until topic z catches up with x and y. To rectify this, changes were made to review_assignment.rb file where when review is requested, initially the responses with no entries, self submitted topic are filtered out from the review pool. Then, if the reviewer has done any other reviews before, such reviews are filtered out. Then the review pool is combed for submissions with least reviews and the minimum reviews count is obtained. This, added to review_topic_threshold becomes the benchmarch against which number of reviews for a topic is measured, and if it’s less than the benchmark, the review is assigned to the requestee. This way, the reviewer is provided with more flexible review policy than before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def filter_least_reviewed(contributor_set)&lt;br /&gt;
      contributor = contributor_set.min_by {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count }&lt;br /&gt;
      minimum_reviews = contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count rescue 0&lt;br /&gt;
      allowed_reviews = minimum_reviews + review_topic_threshold&lt;br /&gt;
      contributor_set.reject! {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count &amp;gt; allowed_reviews }&lt;br /&gt;
&lt;br /&gt;
      contributor_set&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 402'''&lt;br /&gt;
&lt;br /&gt;
This solution required the creation of the review_assignment_spec.rb file. It conducts tests to ensure that a student may not review a topic in which their submission is the only one. This tests the review_assignment.rb module, which is heavily used by assignment.rb and review_mapping_controller.rb.&lt;br /&gt;
&lt;br /&gt;
The specific tests that examined this potential error are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;is not able to be assigned to review a topic only they have submitted on&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;is not able to select topic for review only they have submitted to&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    expect(page).to have_content 'Reviews for &amp;quot;TestAssignment&amp;quot;'&lt;br /&gt;
    expect(page).not_to have_button(&amp;quot;topic_id_#{SignUpTopic.find_by_topic_name(&amp;quot;TestTopic&amp;quot;).id}&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first test checks to see if a student can be assigned their own submission if they request a review via the &amp;quot;I don't care&amp;quot; checkbox, which allows them to be assigned a submission from any topic. Doing so correctly triggered the warning message &amp;quot;No topics are available to review at this time. Please try later.&amp;quot; This was further backed up by a test in which another student submitted an assignment and the same path was followed. This case did not trigger a warning and the student was correctly assigned the submission. This shows the check is working as intended.&lt;br /&gt;
&lt;br /&gt;
The second test checks to see if a student can choose a topic in which their assignment is the only submission. This was the main focus of issue 402. When choosing a topic the student must select a radio button for that topic and then request a review. This was no longer possible after the 402 fix as the student was unable to select the radio button for the topic if they were the only one who had submitted to it. Consequentially, this prevented the student from reaching the error message described in issue 402 &amp;quot;There are no more submissions to review on that topic.&amp;quot; This test passed as expected showing the issue had been resolved. It was also tested whether they could select a topic in which they weren't the only submission, and this test passed as expected as well.&lt;br /&gt;
&lt;br /&gt;
'''Issue 417'''&lt;br /&gt;
&lt;br /&gt;
The 4 variables - num_reviews, num_reviews_required, num_metareviews_required and num_metareviews_allowed - are added to the assignment table using rails migration. The default of these variables are set to 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class AddNumReviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_reviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumReviewsToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      change_column :assignments, :num_reviews, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsAllowedToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_allowed, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These variables are viewable at &amp;quot;others&amp;quot; page for each assignment in students account, and settable at &amp;quot;edit assignment&amp;quot; page, &amp;quot;review_strategy&amp;quot; tab in instructor's account. The instructor are allowed to choose whether they want upper bound on number of reviews (num_reviews &amp;amp;&amp;amp; num_metareviews_allowed) by clicking check box. By this way, the instructor can allow students to review as many submission as possible but grading only required number of reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Validations are done by checking whether the number of reviews required is less than number of reviews allowed. i.e.) num_reviews_required &amp;lt;= num_reviews_allowed. Similarly for condition follows for meta reviews. These validation are done in assignment.rb file and are executed before an update is saved into database. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   class Assignment &amp;lt; ActiveRecord::Base&lt;br /&gt;
      validate :valid_num_review&lt;br /&gt;
      def valid_num_review&lt;br /&gt;
        if(self.num_reviews &amp;amp;&amp;amp; self.num_reviews != -1 &amp;amp;&amp;amp; self.num_reviews &amp;lt; self.num_reviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Num of reviews required cannot be greater than number of reviews allowed&amp;quot;)&lt;br /&gt;
         elsif(self.num_metareviews_allowed &amp;amp;&amp;amp; self.num_metareviews_allowed != -1 &amp;amp;&amp;amp; self.num_metareviews_allowed &amp;lt; self.num_metareviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Number of Meta-Reviews required cannot be greater than number of meta-reviews allowed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here num_reviews and num_metareviews_allowed are negative when the upper bound for reivews are infinity.&lt;br /&gt;
&lt;br /&gt;
The corresponding tests are written in assignment_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Review&amp;quot; do&lt;br /&gt;
    @assignment.num_reviews = 1&lt;br /&gt;
    @assignment.num_reviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Meta-Review&amp;quot; do&lt;br /&gt;
    @assignment.num_metareviews_allowed = 1&lt;br /&gt;
    @assignment.num_metareviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first test checks whether num_reviews accepts values less than num_reviews_required for which the validation should fail.&lt;br /&gt;
The Second test checks whether num_metareviews_allowed accepts values less than num_metareviews_required for which the validation should fail too.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Manual Testing ==&lt;br /&gt;
'''&lt;br /&gt;
*Please follow these instructions for testing these solutions manually.&lt;br /&gt;
&lt;br /&gt;
'''228'''&lt;br /&gt;
&lt;br /&gt;
'''402'''&lt;br /&gt;
*Log in with an instructor.&lt;br /&gt;
*Create an assignment with topics to choose from.&lt;br /&gt;
*Log in with a student.&lt;br /&gt;
*Sign up for one of the topics from the previously created assignment.&lt;br /&gt;
*Submit an assignment for that topic.&lt;br /&gt;
*Go to the Others' Work tab.&lt;br /&gt;
*Attempt to select that topic for review -OR- Check the box for &amp;quot;I Don't Care&amp;quot;&lt;br /&gt;
*Attempt to request review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''417'''&lt;br /&gt;
*Log in as an instructor&lt;br /&gt;
*go to edit page of an assignment and navigate to Review Strategy tab.&lt;br /&gt;
*Change the allowed and required field of reviews and meta-reviews.&lt;br /&gt;
*Try giving greater value for required field than allowed field. It should throw an error stating the relevant message.&lt;br /&gt;
*Give the correct value and save it.&lt;br /&gt;
*Sign in as a student who has enrolled for that particular assignment.&lt;br /&gt;
*go to &amp;quot;others&amp;quot; page.&lt;br /&gt;
*The allowed and required field are displayed saying that the assignment requires atleast k reviews.&lt;br /&gt;
*If meta-review is enabled for that topic then the meta-review information is also displayed. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Website]&lt;br /&gt;
#[https://github.com/crajase/expertiza Expertiza GitHub Fork]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/228 Issue 228]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/402 Issue 402]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/417 Issue 417]&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107302</id>
		<title>CSC/CSC 517 Spring 2017/oss E1718</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/CSC_517_Spring_2017/oss_E1718&amp;diff=107302"/>
		<updated>2017-03-23T22:58:52Z</updated>

		<summary type="html">&lt;p&gt;Vhegde: Editing for issue 228&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1718 was the project code for an Expertiza OSS assignment. It largely dealt with the handling of how peer reviews are assigned to students.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== About Expertiza ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a collaborative open source project that allows courses to create assignments for students. One of the main functions of Expertiza is to allow students to peer review the submitted assignments by their fellow classmates. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== E1718 ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
This page covers the E1718 project. E1718 covers the system behind assigning peer reviews to students. The main focus of this topic is the thresholds that guide which submissions a student can review as well as how many they need to review, and can review. A review can either be assigned to a student by the instructor, or it can be requested directly by the student. When the student handles it they can choose to be assigned a random submission, or they can choose the topic which they wish to review. Assignments can be set up so that each student must review a minimum number of submissions, with the choice of extra credit for completing up to a maximum number of reviews. When review topics are chosen, Expertiza sets it up so that the student can only choose a topic that has a low enough number of other reviews. At times this can constrain the choices a student has, so to fix this the instructor can set the threshold to allow for more choices. The threshold itself is the acceptable range for the number of reviews a topic has compared to the least reviewed topic. For instance, lets say there are three topics: Blue, Red and Green. Blue has had 1 review, Red has had 2 reviews, and Green has had 3 reviews. If the threshold is set to 0, then the only topic that can be chosen for review is Blue. If the threshold is 1, then both Blue and Red can be chosen. If it is 3, then all 3 topics can be chosen.&lt;br /&gt;
&lt;br /&gt;
By solving the issues raised by E1718 this system will be improved in several ways. As currently set up, if a student has already reviewed all assignments within the minimum threshold, they will be unable to request another review. To solve this, when a student has reviewed all submissions within threshold k, the system should increase the threshold by m so that the student can review all submissions within threshold k+m. The current version of Expertiza also fails to show a student what the minimum number of reviews they must complete is, as well as the upper limit of reviews allowed. This will be fixed in this project so that an instructor can set the minimum and maximum number of reviews from the Review Strategy tab, and those limits show up on the student's end when viewing Others' Work. A previous issue that has since been solved was that a student was allowed to review their own submission. While this did not need further work, it did need automated testing to be written for it. Those tests were completed, as well as tests for the issues described above.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Issues ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''228:''' Increase the threshold for a student who has already completed reviews for all submissions with the minimum number.&lt;br /&gt;
&lt;br /&gt;
'''402:''' Write automated tests to check if a student can review a topic only they have submitted on.&lt;br /&gt;
&lt;br /&gt;
'''417:''' Implement a num_reviews_required (and num_reviews_allowed) field in the assignments table to say how many reviews per reviewer are required, and how many are allowed (default should be # allowed = # req’d.).  Make it settable from the Review Strategy tab (see Issue 417) and viewable when a student clicks on “Others’ work”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
== Solutions ==&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Project Files (new or changed)'''&lt;br /&gt;
&lt;br /&gt;
*expertiza/spec/features/review_assignment.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074046_add_num_metareviews_required_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/20170322074238_add_num_metareviews_allowed_to_assignments.rb&lt;br /&gt;
*expertiza/db/migrate/schema.rb&lt;br /&gt;
*expertiza/app/models/assignment_form.rb&lt;br /&gt;
*expertiza/app/models/review_assignment.rb&lt;br /&gt;
*expertiza/app/views/assignments/edit/_review_strategy.html.erb&lt;br /&gt;
*expertiza/app/views/student_review/list.html.erb&lt;br /&gt;
*expertiza/spec/features/review_assignement_spec.rb&lt;br /&gt;
&lt;br /&gt;
'''Issue 228'''&lt;br /&gt;
According to this issue, the reviewers, having reviewed the submission with the fewest outstanding reviews, can't review any other submission until the submission they've just reviewed catches up to other submissions in number of reviews. Reviewers who have already reviewed the submission with the fewest reviews should be able to review the submission with the next fewest reviews, regardless of what the threshold is. Solution to this would be, every time a student requests for review, setup a proper filtering process with appropriate thresholds. &lt;br /&gt;
&lt;br /&gt;
If topic x and topic y has two reviews each and topic z has no reviews, the reviewer is allowed to review topic z, as it has the least number of reviews. He is not allowed anymore reviews until topic z catches up with x and y. To rectify this, changes were made to review_assignment.rb file where when review is requested, initially the responses with no entries, self submitted topic are filtered out from the review pool. Then, if the reviewer has done any other reviews before, such reviews are filtered out. Then the review pool is combed for submissions with least reviews and the minimum reviews count is obtained. This, added to review_topic_threshold becomes the benchmarch against which number of reviews for a topic is measured, and if it’s less than the benchmark, the review is assigned to the requestee. This way, the reviewer is provided with more flexible review policy than before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def filter_least_reviewed(contributor_set)&lt;br /&gt;
      contributor = contributor_set.min_by {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count }&lt;br /&gt;
      minimum_reviews = contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count rescue 0&lt;br /&gt;
      allowed_reviews = minimum_reviews + review_topic_threshold&lt;br /&gt;
      contributor_set.reject! {|contributor| contributor.review_mappings.reject {|review_mapping| review_mapping.response.nil? }.count &amp;gt; allowed_reviews }&lt;br /&gt;
&lt;br /&gt;
      contributor_set&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 402'''&lt;br /&gt;
&lt;br /&gt;
This solution required the creation of the review_assignment_spec.rb file. It conducts tests to ensure that a student may not review a topic in which their submission is the only one. This tests the review_assignment.rb module, which is heavily used by assignment.rb and review_mapping_controller.rb.&lt;br /&gt;
&lt;br /&gt;
The specific tests that examined this potential error are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;is not able to be assigned to review a topic only they have submitted on&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    find(:css, &amp;quot;#i_dont_care&amp;quot;).set(true)&lt;br /&gt;
    click_button &amp;quot;Request a new submission to review&amp;quot;&lt;br /&gt;
    expect(page).to have_content &amp;quot;No topics are available to review at this time. Please try later.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;is not able to select topic for review only they have submitted to&amp;quot; do&lt;br /&gt;
    submit_to_topic&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link &amp;quot;TestAssignment&amp;quot;&lt;br /&gt;
    click_link &amp;quot;Others' work&amp;quot;&lt;br /&gt;
    expect(page).to have_content 'Reviews for &amp;quot;TestAssignment&amp;quot;'&lt;br /&gt;
    expect(page).not_to have_button(&amp;quot;topic_id_#{SignUpTopic.find_by_topic_name(&amp;quot;TestTopic&amp;quot;).id}&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first test checks to see if a student can be assigned their own submission if they request a review via the &amp;quot;I don't care&amp;quot; checkbox, which allows them to be assigned a submission from any topic. Doing so correctly triggered the warning message &amp;quot;No topics are available to review at this time. Please try later.&amp;quot; This was further backed up by a test in which another student submitted an assignment and the same path was followed. This case did not trigger a warning and the student was correctly assigned the submission. This shows the check is working as intended.&lt;br /&gt;
&lt;br /&gt;
The second test checks to see if a student can choose a topic in which their assignment is the only submission. This was the main focus of issue 402. When choosing a topic the student must select a radio button for that topic and then request a review. This was no longer possible after the 402 fix as the student was unable to select the radio button for the topic if they were the only one who had submitted to it. Consequentially, this prevented the student from reaching the error message described in issue 402 &amp;quot;There are no more submissions to review on that topic.&amp;quot; This test passed as expected showing the issue had been resolved. It was also tested whether they could select a topic in which they weren't the only submission, and this test passed as expected as well.&lt;br /&gt;
&lt;br /&gt;
'''Issue 417'''&lt;br /&gt;
&lt;br /&gt;
The 4 variables - num_reviews, num_reviews_required, num_metareviews_required and num_metareviews_allowed - are added to the assignment table using rails migration. The default of these variables are set to 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class AddNumReviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_reviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumReviewsToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      change_column :assignments, :num_reviews, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsRequiredToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_required, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class AddNumMetareviewsAllowedToAssignments &amp;lt; ActiveRecord::Migration&lt;br /&gt;
    def change&lt;br /&gt;
      add_column :assignments, :num_metareviews_allowed, :integer, :default =&amp;gt; 3&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These variables are viewable at &amp;quot;others&amp;quot; page for each assignment in students account, and settable at &amp;quot;edit assignment&amp;quot; page, &amp;quot;review_strategy&amp;quot; tab in instructor's account. The instructor are allowed to choose whether they want upper bound on number of reviews (num_reviews &amp;amp;&amp;amp; num_metareviews_allowed) by clicking check box. By this way, the instructor can allow students to review as many submission as possible but grading only required number of reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Validations are done by checking whether the number of reviews required is less than number of reviews allowed. i.e.) num_reviews_required &amp;lt;= num_reviews_allowed. Similarly for condition follows for meta reviews. These validation are done in assignment.rb file and are executed before an update is saved into database. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   class Assignment &amp;lt; ActiveRecord::Base&lt;br /&gt;
      validate :valid_num_review&lt;br /&gt;
      def valid_num_review&lt;br /&gt;
        if(self.num_reviews &amp;amp;&amp;amp; self.num_reviews != -1 &amp;amp;&amp;amp; self.num_reviews &amp;lt; self.num_reviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Num of reviews required cannot be greater than number of reviews allowed&amp;quot;)&lt;br /&gt;
         elsif(self.num_metareviews_allowed &amp;amp;&amp;amp; self.num_metareviews_allowed != -1 &amp;amp;&amp;amp; self.num_metareviews_allowed &amp;lt; self.num_metareviews_required)&lt;br /&gt;
           self.errors.add(:message, &amp;quot;Number of Meta-Reviews required cannot be greater than number of meta-reviews allowed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here num_reviews and num_metareviews_allowed are negative when the upper bound for reivews are infinity.&lt;br /&gt;
&lt;br /&gt;
The corresponding tests are written in assignment_spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Review&amp;quot; do&lt;br /&gt;
    @assignment.num_reviews = 1&lt;br /&gt;
    @assignment.num_reviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  it &amp;quot;check whether assignment doesnot accept required value greater than allowed value - Meta-Review&amp;quot; do&lt;br /&gt;
    @assignment.num_metareviews_allowed = 1&lt;br /&gt;
    @assignment.num_metareviews_required = 3&lt;br /&gt;
    expect(@assignment).not_to be_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first test checks whether num_reviews accepts values less than num_reviews_required for which the validation should fail.&lt;br /&gt;
The Second test checks whether num_metareviews_allowed accepts values less than num_metareviews_required for which the validation should fail too.&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Manual Testing ==&lt;br /&gt;
'''&lt;br /&gt;
*Please follow these instructions for testing these solutions manually.&lt;br /&gt;
&lt;br /&gt;
'''228'''&lt;br /&gt;
&lt;br /&gt;
'''402'''&lt;br /&gt;
*Log in with an instructor.&lt;br /&gt;
*Create an assignment with topics to choose from.&lt;br /&gt;
*Log in with a student.&lt;br /&gt;
*Sign up for one of the topics from the previously created assignment.&lt;br /&gt;
*Submit an assignment for that topic.&lt;br /&gt;
*Go to the Others' Work tab.&lt;br /&gt;
*Attempt to select that topic for review -OR- Check the box for &amp;quot;I Don't Care&amp;quot;&lt;br /&gt;
*Attempt to request review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''417'''&lt;br /&gt;
*Log in as an instructor&lt;br /&gt;
*go to edit page of an assignment and navigate to Review Strategy tab.&lt;br /&gt;
*Change the allowed and required field of reviews and meta-reviews.&lt;br /&gt;
*Try giving greater value for required field than allowed field. It should throw an error stating the relevant message.&lt;br /&gt;
*Give the correct value and save it.&lt;br /&gt;
*Sign in as a student who has enrolled for that particular assignment.&lt;br /&gt;
*go to &amp;quot;others&amp;quot; page.&lt;br /&gt;
*The allowed and required field are displayed saying that the assignment requires atleast k reviews.&lt;br /&gt;
*If meta-review is enabled for that topic then the meta-review information is also displayed. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Website]&lt;br /&gt;
#[https://github.com/crajase/expertiza Expertiza GitHub Fork]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/228 Issue 228]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/402 Issue 402]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/issues/417 Issue 417]&lt;/div&gt;</summary>
		<author><name>Vhegde</name></author>
	</entry>
</feed>