<?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=Ichench</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=Ichench"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ichench"/>
	<updated>2026-05-09T02:27:36Z</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_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144974</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144974"/>
		<updated>2022-04-12T03:39:20Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Rspec Unit Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Because this component is only specified in the file &amp;quot;app/assets/javascripts/tree display.jsx,&amp;quot; we can only use javascript to implement it. The format of the interactive dropdown advanced search code will be the same as &amp;quot;User Advanced Search.&amp;quot; We built a pop up advanced search capability in React component FilterableTable utilizing AdditionalSearchDropDown, DatePicker, and HASQUIZ TOGGLE components.&lt;br /&gt;
&lt;br /&gt;
The ContentTable component handles the searching mechanism, which filters out course titles that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Because course and assignment searches are so similar, they share the same code in the FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result, everything should be included.&lt;br /&gt;
# The filtered search produces a list of items that include the filtered search item.&lt;br /&gt;
# When a search is invalid, an empty list is returned.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Modified ====&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with the given user name' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches an empty users list if user with given user name is not found' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with the given email' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches an empty users list if user with given email is not found' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with given user name and email' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with given full name and email' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and full name' do&lt;br /&gt;
      it 'fetches all users with given user name and full name' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with given user name, full name and email' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first image depicts the USER search UI page. The second image depicts the USER page, which allows users to search by userid, name, and e-mail.&lt;br /&gt;
It's worth noting that not all parameters are required for a successful search. You can search using one, two, or all of the options.&lt;br /&gt;
&lt;br /&gt;
[[File:Users 1.png|700px]]&lt;br /&gt;
[[File:Users 2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Courses_1.png|700px]]&lt;br /&gt;
[[File:Courses_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignments_1.png|700px]]&lt;br /&gt;
[[File:Assignments_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionaires_1.png|700px]]&lt;br /&gt;
[[File:Questionaries_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144956</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144956"/>
		<updated>2022-04-12T03:30:16Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Questionnaire Search UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Because this component is only specified in the file &amp;quot;app/assets/javascripts/tree display.jsx,&amp;quot; we can only use javascript to implement it. The format of the interactive dropdown advanced search code will be the same as &amp;quot;User Advanced Search.&amp;quot; We built a pop up advanced search capability in React component FilterableTable utilizing AdditionalSearchDropDown, DatePicker, and HASQUIZ TOGGLE components.&lt;br /&gt;
&lt;br /&gt;
The ContentTable component handles the searching mechanism, which filters out course titles that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Because course and assignment searches are so similar, they share the same code in the FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result, everything should be included.&lt;br /&gt;
# The filtered search produces a list of items that include the filtered search item.&lt;br /&gt;
# When a search is invalid, an empty list is returned.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first image depicts the USER search UI page. The second image depicts the USER page, which allows users to search by userid, name, and e-mail.&lt;br /&gt;
It's worth noting that not all parameters are required for a successful search. You can search using one, two, or all of the options.&lt;br /&gt;
&lt;br /&gt;
[[File:Users 1.png|700px]]&lt;br /&gt;
[[File:Users 2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Courses_1.png|700px]]&lt;br /&gt;
[[File:Courses_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignments_1.png|700px]]&lt;br /&gt;
[[File:Assignments_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionaires_1.png|700px]]&lt;br /&gt;
[[File:Questionaries_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaries_2.png&amp;diff=144951</id>
		<title>File:Questionaries 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaries_2.png&amp;diff=144951"/>
		<updated>2022-04-12T03:26:25Z</updated>

		<summary type="html">&lt;p&gt;Ichench: Ichench uploaded a new version of File:Questionaries 2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144949</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144949"/>
		<updated>2022-04-12T03:24:17Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Questionnaire Search UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Because this component is only specified in the file &amp;quot;app/assets/javascripts/tree display.jsx,&amp;quot; we can only use javascript to implement it. The format of the interactive dropdown advanced search code will be the same as &amp;quot;User Advanced Search.&amp;quot; We built a pop up advanced search capability in React component FilterableTable utilizing AdditionalSearchDropDown, DatePicker, and HASQUIZ TOGGLE components.&lt;br /&gt;
&lt;br /&gt;
The ContentTable component handles the searching mechanism, which filters out course titles that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Because course and assignment searches are so similar, they share the same code in the FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result, everything should be included.&lt;br /&gt;
# The filtered search produces a list of items that include the filtered search item.&lt;br /&gt;
# When a search is invalid, an empty list is returned.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first image depicts the USER search UI page. The second image depicts the USER page, which allows users to search by userid, name, and e-mail.&lt;br /&gt;
It's worth noting that not all parameters are required for a successful search. You can search using one, two, or all of the options.&lt;br /&gt;
&lt;br /&gt;
[[File:Users 1.png|700px]]&lt;br /&gt;
[[File:Users 2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Courses_1.png|700px]]&lt;br /&gt;
[[File:Courses_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignments_1.png|700px]]&lt;br /&gt;
[[File:Assignments_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionaires_1.png|700px]]&lt;br /&gt;
[[File:Questionaires_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza&amp;diff=144932</id>
		<title>CSC/ECE 517 Fall 2021 - E2153. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza&amp;diff=144932"/>
		<updated>2022-04-12T03:12:13Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Questionnaire Search UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. It is an open-source application running on Ruby on Rails. It is used for the management of courses and the assignments for respective courses, by the faculties and the students. The manage content section of the application has different views that display information about the users, courses, assignments, questionnaires, and reviews. &lt;br /&gt;
&lt;br /&gt;
The application should have a fully functional search functionality throughout the views, so that a user can search any type of data with ease, on the basis of any number of parameters depending on his requirements. Users should be searched on the basis of one more parameter which includes name, full name, email, etc. Similarly, assignments should be searched on the basis of name, created date, updated date, etc. &lt;br /&gt;
&lt;br /&gt;
However, the search functionality in the existing application is constrained to just a single parameter for users and assignments. Questionnaires management does not have a search functionality implemented as yet. This project works on improving the search functionality of Expertiza, by adding search bars if not present, introducing an advanced search feature where user can search on the basis of more than one parameters, and making the search functionality appear more elegant.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can search for a user by name, user-ID, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for assignments by name, due date, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for rubrics (or other questionnaires) by name, or by the courses or assignments they have been used in.&lt;br /&gt;
##For the instructor, there also needs to be a way to quickly find rubrics (and other questionnaires) that have been used in a single course.  It should be possible to search or click somewhere to bring up a list of questionnaires used in the course, expanding only the applicable questionnaires in the list of questionnaires.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search all reviews of a particular team’s work for particular scores or text strings.  Reviews should be able to be filtered by score, text comment length, reviewer, and reviewee.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a particular user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Our Result ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2079 Previous Implementation ===&lt;br /&gt;
#[https://github.com/prashantyadla/expertiza/tree/beta E2079 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1842 E2079 Pull Request]&lt;br /&gt;
#[https://drive.google.com/file/d/1yr_4b0SsN_J4qGMpZbQLzKXzWAjoX7fV/view. Video Link]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# All implementation are working on javascript inside tree_display.jsx.&lt;br /&gt;
# With compatibility issue, these work can't be check-in currently.&lt;br /&gt;
# Format are not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching of user with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
The design proposed in this iteration of the project is not much different from a high level than the design proposed form last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]. Below you will see a similar description of the solution previously proposed and some additional design choices added to improve upon the previous iteration of this issue. Changes from the previous design will be denoted by clear statements indicating the revision.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
In the current system workflow, the Manage Users view can search users by Username, Full name, and email. We will retain these 3 searching criteria, except changing &amp;quot;Username&amp;quot; into &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name&amp;quot;. We will allow searching for fields irrespective of the case of the searched string. The user will be able to apply multiple filters at a time and the output of the query will match all filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
====Implementation====&lt;br /&gt;
User has its own &amp;quot;list&amp;quot; controller, so it will directly implemented in list form with a &amp;quot;_search&amp;quot; html form after apply the search result. Since only this class has rails list, so only this file will implement in ruby code. Our goal is to maintain the logic and search alike.&lt;br /&gt;
# Delete the original simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;&lt;br /&gt;
## Add a render for search form&lt;br /&gt;
## Align the UI for direct user access, which is not part of our project, but to make the page looks similar, we also change the style of it&lt;br /&gt;
## Align the user list table UI with style &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;&lt;br /&gt;
# Add a form in &amp;quot;app/views/users/_search.html.erb&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;Search&amp;quot; button will using style &amp;quot;class='btn btn-primary'&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;text blank&amp;quot; will using the style &amp;quot;class:'form-control'&amp;quot;&lt;br /&gt;
## Advanced Search toggle button is done with javascript (jquery) inside this form individually, and the form is divided into 2 separate field&lt;br /&gt;
### search_button_field: This part should always be displayed&lt;br /&gt;
### advance_search_form: This part should only display after the &amp;quot;Advanced Search&amp;quot; be toggled&lt;br /&gt;
# Add a form input handler in the &amp;quot;users_controller.rb&amp;quot; to parse the form, which should only do parsing and send parameters to model&lt;br /&gt;
# Add a advanced search feature to the User model &amp;quot;user.rb&amp;quot; inside the method &amp;quot;get_user_list&amp;quot;&lt;br /&gt;
## This change will cause this method to take up 3 parameters with (user id, full name, e-mail)&lt;br /&gt;
## We use regular expression to match the search with user fields, and it should allow multiple input for comparison&lt;br /&gt;
## The result will return back to controller in @users, and list view will render it again with paginated users&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system implementation, searching via the name of the course is supported with a partial or complete course name. In the proposed system, the user will be able to search for a course using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for a course by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the courses created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All courses that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.nce.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop-up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The proposed system will implement search functionality for searching via below criteria:&lt;br /&gt;
# Keyword within Name of Questionnaire: A text field&lt;br /&gt;
# Keyword or a string in a single question within a questionnaire: A text field&lt;br /&gt;
# Course Name: A text field for the course name&lt;br /&gt;
# Assignment Name: A text field for the assignment&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply multiple filters at a time and the output of the query will match all the filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
&lt;br /&gt;
There will be a default search box of the name of questionnaire as a simple search, and if a user want to apply multiple filters, the user can tap on the &amp;quot;Advanced Search&amp;quot; button which is adjacent to the &amp;quot;Search&amp;quot; button, and a hidden field will be rendered below-containing text boxes for all the columns. All the matched questionnaires will be listed at once.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:42660.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Added ====&lt;br /&gt;
Before checking the code, here's some preliminary:&lt;br /&gt;
# We are testing the only function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire 1.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire 2.png|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yu-Hsuan Lo (ylo@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Fu-Jen Yen (fyen@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Shao-Yo Chao (schao2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza&amp;diff=144927</id>
		<title>CSC/ECE 517 Fall 2021 - E2153. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza&amp;diff=144927"/>
		<updated>2022-04-12T03:11:08Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Questionnaire Search UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. It is an open-source application running on Ruby on Rails. It is used for the management of courses and the assignments for respective courses, by the faculties and the students. The manage content section of the application has different views that display information about the users, courses, assignments, questionnaires, and reviews. &lt;br /&gt;
&lt;br /&gt;
The application should have a fully functional search functionality throughout the views, so that a user can search any type of data with ease, on the basis of any number of parameters depending on his requirements. Users should be searched on the basis of one more parameter which includes name, full name, email, etc. Similarly, assignments should be searched on the basis of name, created date, updated date, etc. &lt;br /&gt;
&lt;br /&gt;
However, the search functionality in the existing application is constrained to just a single parameter for users and assignments. Questionnaires management does not have a search functionality implemented as yet. This project works on improving the search functionality of Expertiza, by adding search bars if not present, introducing an advanced search feature where user can search on the basis of more than one parameters, and making the search functionality appear more elegant.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can search for a user by name, user-ID, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for assignments by name, due date, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for rubrics (or other questionnaires) by name, or by the courses or assignments they have been used in.&lt;br /&gt;
##For the instructor, there also needs to be a way to quickly find rubrics (and other questionnaires) that have been used in a single course.  It should be possible to search or click somewhere to bring up a list of questionnaires used in the course, expanding only the applicable questionnaires in the list of questionnaires.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search all reviews of a particular team’s work for particular scores or text strings.  Reviews should be able to be filtered by score, text comment length, reviewer, and reviewee.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a particular user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Our Result ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2079 Previous Implementation ===&lt;br /&gt;
#[https://github.com/prashantyadla/expertiza/tree/beta E2079 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1842 E2079 Pull Request]&lt;br /&gt;
#[https://drive.google.com/file/d/1yr_4b0SsN_J4qGMpZbQLzKXzWAjoX7fV/view. Video Link]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# All implementation are working on javascript inside tree_display.jsx.&lt;br /&gt;
# With compatibility issue, these work can't be check-in currently.&lt;br /&gt;
# Format are not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching of user with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
The design proposed in this iteration of the project is not much different from a high level than the design proposed form last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]. Below you will see a similar description of the solution previously proposed and some additional design choices added to improve upon the previous iteration of this issue. Changes from the previous design will be denoted by clear statements indicating the revision.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
In the current system workflow, the Manage Users view can search users by Username, Full name, and email. We will retain these 3 searching criteria, except changing &amp;quot;Username&amp;quot; into &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name&amp;quot;. We will allow searching for fields irrespective of the case of the searched string. The user will be able to apply multiple filters at a time and the output of the query will match all filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
====Implementation====&lt;br /&gt;
User has its own &amp;quot;list&amp;quot; controller, so it will directly implemented in list form with a &amp;quot;_search&amp;quot; html form after apply the search result. Since only this class has rails list, so only this file will implement in ruby code. Our goal is to maintain the logic and search alike.&lt;br /&gt;
# Delete the original simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;&lt;br /&gt;
## Add a render for search form&lt;br /&gt;
## Align the UI for direct user access, which is not part of our project, but to make the page looks similar, we also change the style of it&lt;br /&gt;
## Align the user list table UI with style &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;&lt;br /&gt;
# Add a form in &amp;quot;app/views/users/_search.html.erb&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;Search&amp;quot; button will using style &amp;quot;class='btn btn-primary'&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;text blank&amp;quot; will using the style &amp;quot;class:'form-control'&amp;quot;&lt;br /&gt;
## Advanced Search toggle button is done with javascript (jquery) inside this form individually, and the form is divided into 2 separate field&lt;br /&gt;
### search_button_field: This part should always be displayed&lt;br /&gt;
### advance_search_form: This part should only display after the &amp;quot;Advanced Search&amp;quot; be toggled&lt;br /&gt;
# Add a form input handler in the &amp;quot;users_controller.rb&amp;quot; to parse the form, which should only do parsing and send parameters to model&lt;br /&gt;
# Add a advanced search feature to the User model &amp;quot;user.rb&amp;quot; inside the method &amp;quot;get_user_list&amp;quot;&lt;br /&gt;
## This change will cause this method to take up 3 parameters with (user id, full name, e-mail)&lt;br /&gt;
## We use regular expression to match the search with user fields, and it should allow multiple input for comparison&lt;br /&gt;
## The result will return back to controller in @users, and list view will render it again with paginated users&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system implementation, searching via the name of the course is supported with a partial or complete course name. In the proposed system, the user will be able to search for a course using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for a course by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the courses created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All courses that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.nce.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop-up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The proposed system will implement search functionality for searching via below criteria:&lt;br /&gt;
# Keyword within Name of Questionnaire: A text field&lt;br /&gt;
# Keyword or a string in a single question within a questionnaire: A text field&lt;br /&gt;
# Course Name: A text field for the course name&lt;br /&gt;
# Assignment Name: A text field for the assignment&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply multiple filters at a time and the output of the query will match all the filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
&lt;br /&gt;
There will be a default search box of the name of questionnaire as a simple search, and if a user want to apply multiple filters, the user can tap on the &amp;quot;Advanced Search&amp;quot; button which is adjacent to the &amp;quot;Search&amp;quot; button, and a hidden field will be rendered below-containing text boxes for all the columns. All the matched questionnaires will be listed at once.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:42660.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Added ====&lt;br /&gt;
Before checking the code, here's some preliminary:&lt;br /&gt;
# We are testing the only function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-1.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire-2.JPG|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Yu-Hsuan Lo (ylo@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Fu-Jen Yen (fyen@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Shao-Yo Chao (schao2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaries_2.png&amp;diff=144924</id>
		<title>File:Questionaries 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaries_2.png&amp;diff=144924"/>
		<updated>2022-04-12T03:10:00Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaires_1.png&amp;diff=144921</id>
		<title>File:Questionaires 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionaires_1.png&amp;diff=144921"/>
		<updated>2022-04-12T03:09:14Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144487</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144487"/>
		<updated>2022-04-07T00:12:03Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Search for Questionnaires: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144484</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144484"/>
		<updated>2022-04-07T00:11:23Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Search for Questionnaires: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144483</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144483"/>
		<updated>2022-04-07T00:10:55Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144480</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144480"/>
		<updated>2022-04-07T00:10:13Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Search for Questionnaires: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:questionnaires sequence.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionnaires_sequence.png&amp;diff=144479</id>
		<title>File:Questionnaires sequence.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Questionnaires_sequence.png&amp;diff=144479"/>
		<updated>2022-04-07T00:08:31Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144418</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144418"/>
		<updated>2022-04-06T21:34:06Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
#Getting sub-contents when a user press on a course&lt;br /&gt;
##From FilterableTable ,getSubFolderData() method makes an HTTP POST request.&lt;br /&gt;
##It will update the state of the FilterableTable component after retrieving the data.&lt;br /&gt;
##When the state is updated, the ContentTable component is updated, and the component is rerendered&lt;br /&gt;
&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
##FilterableTable is in charge of the searching method. When the search button is pressed, all sub-contents from each questionnaire category are filtered based on the user's input.&lt;br /&gt;
##From FilterableTable component, handleQuestionnaireSearchChange() method keeps track of the search input field. When the input field is cleared, it will trigger an update.&lt;br /&gt;
&lt;br /&gt;
Proposed Implementation&lt;br /&gt;
&lt;br /&gt;
In the proposed system.we will be using existing list method However, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144414</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144414"/>
		<updated>2022-04-06T21:21:01Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
In the proposed system the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144410</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144410"/>
		<updated>2022-04-06T21:19:00Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
Current Implementation:&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144408</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144408"/>
		<updated>2022-04-06T21:15:16Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144404</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144404"/>
		<updated>2022-04-06T21:11:55Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching by assignment name (partial or whole) is supported. After pressing the Advanced Search button in the proposed system, the user will be able to search for an assignment with additional filters. The filters will contain a creation date, an updated date, and a checkbox to indicate if a quiz is included. The user might apply many filters at the same time, and the query's output would match all of them.&lt;br /&gt;
&lt;br /&gt;
When searching for an assignment by date, the user will have the option of searching by created or modified date from a drop-down menu. Following that, he will be presented with a calendar from which he may choose a date, and any tasks created/updated on or before that date will be displayed.&lt;br /&gt;
&lt;br /&gt;
The user may apply additional filters by tapping the Advanced Search button adjacent to the Search button; a hidden div will then be shown below, including text fields for all of the columns. The filters will return all assignments that fit the criteria. If the search criteria do not match any entries in the database, an empty list will be provided.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
We will use the existing list method and make changes to it in order to present the &amp;quot;Advanced Search&amp;quot; functionality.&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Functionalities to be tested:&lt;br /&gt;
# Given an unfiltered search result that should include everything.&lt;br /&gt;
# The result of the filtered search is a list of objects that contain the filtered search item.&lt;br /&gt;
# An empty list is returned when a search is invalid.&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all the search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
Here are some improvements on previously implemented test cases:&lt;br /&gt;
# The &amp;quot;it&amp;quot; clause is going to be more specific with respect to each test.&lt;br /&gt;
# We will be introducing fixtures in the tests to modularize the common code in each test.&lt;br /&gt;
# We will try to add more tests if possible to increase the code coverage of the controllers and models.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
You can watch this demo video for a rough idea of the UI pages. [https://youtu.be/SxbHz9bp2L0 Demo]. &lt;br /&gt;
&lt;br /&gt;
We will be making more changes during the implementation phase and will be adding the screenshots parallelly in this wiki.&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144364</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144364"/>
		<updated>2022-04-06T20:01:22Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Search for Questionnaires: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project makes use of peer review to allow students to learn from one another. It's a Ruby on Rails-based open-source application. It is used by faculty and students for the management of courses and assignments for specific courses. Different screens in the manage content area of the application offer information about users, courses, assignments, questionnaires, and reviews.&lt;br /&gt;
&lt;br /&gt;
The program should have a fully functional search functionality throughout all views, allowing a user to quickly find any sort of data using any number of parameters that meet his needs. Users should be found using one additional parameter, such as their name, full name, email address, and so on. Similarly, assignments should be searched by name, creation date, updated date, and other criteria.&lt;br /&gt;
&lt;br /&gt;
However, the existing application's search functionality is limited to a single parameter for users and assignments. A search feature has not yet been introduced in the management of questionnaires. This project aims to improve Expertiza's search functionality by adding search bars if they aren't already there, creating an advanced search tool that allows users to search using several parameters, and making the search functionality look more appealing.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can look for a person using their name, user ID, or other criteria.&lt;br /&gt;
#An instructor should be able to look for assignments based on their name, due date, or other criteria.&lt;br /&gt;
#An instructor should be able to find rubrics (or other questionnaires) by name or by the courses or assignments in which they were utilized.&lt;br /&gt;
##There should also be a means for instructors to quickly locate rubrics (and other surveys) that have been utilized in a particular course. It should be possible to search or click someplace to bring up a list of questionnaires used in the course, with the list of questionnaires only extending to include those that are pertinent.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search for specific ratings or text strings across all reviews of a team's work. Filtering reviews by score, text comment length, reviewer, and reviewee should be possible.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Expertiza presently supports some of these queries, but the user interface is extremely clumsy. This is especially true on the site of an instructor or administrator, where huge and complicated search boxes push the vital elements of the page to the bottom of the screen. A quick search should be possible by just inputting text into an unobtrusive textbox. If further criteria are needed, there should be an &amp;quot;advanced search&amp;quot; button or link that opens up more textboxes, perhaps in Javascript, that are of an acceptable size and do not overwhelm the rest of the page's content.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Previous Implementation ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# The code is not readable and there are some parts of code that still need to DRYed out.&lt;br /&gt;
# The test cases &amp;quot;it&amp;quot; clause must be more specific to the test. This is the same for all the test cases as of now which is quite confusing.&lt;br /&gt;
# All implementations are working on javascript inside tree_display.jsx. There are some changes that are overlapping and confusing to refactor.&lt;br /&gt;
# All the code changes should follow proper ruby naming conventions and there should be enough comments to explain the functionality.&lt;br /&gt;
# With compatibility issues, these workers can't be check-in currently.&lt;br /&gt;
# Format is not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching for users with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue. Clear words stating the modification will be used to indicate changes from the previous design.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
The Manage Users view in the current system process allows search users by Username, Full Name, and Email. We'll keep these three search criteria the same, but we'll rename &amp;quot;Username&amp;quot; to &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name.&amp;quot; We'll let you search for fields regardless of the case of the string you're looking for. The user will be able to apply numerous filters at once, with the query's output matching all of them. An empty list will be returned if no results are found.&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:User flow.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
In order to introduce the &amp;quot;Advanced Search&amp;quot; functionality, we will leverage the existing list method and make changes in that method. &lt;br /&gt;
# Remove the existing simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;.&lt;br /&gt;
## Add a new partial to render the search form.&lt;br /&gt;
## Style the user list table UI by adding the code as &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;.&lt;br /&gt;
# So in order to perform the search, we will introduce code to render a form input in file: &amp;quot;app/views/users/_search.html.erb&amp;quot;.&lt;br /&gt;
## We will by styling the &amp;quot;Search&amp;quot; button with &amp;quot;class='btn btn-primary'&amp;quot;.&lt;br /&gt;
## We will be styling the &amp;quot;text blank&amp;quot; using &amp;quot;class:'form-control'&amp;quot;.&lt;br /&gt;
## Now our UI contains two search components to be displayed in the UI.&lt;br /&gt;
### search_field: This search bar is always displayed as it is in the existing UI.&lt;br /&gt;
### advance_search_fields: These are only displayed when the &amp;quot;Advanced Search&amp;quot; button is toggled to be ON.&lt;br /&gt;
# In &amp;quot;users controller.rb,&amp;quot; add a form input handler to parse the form, which should just do parsing and provide arguments to the model.&lt;br /&gt;
# In the method &amp;quot;get_user_list&amp;quot;, add code to perform the newly introduced advanced search which is in the User model file: &amp;quot;user.rb&amp;quot;&lt;br /&gt;
## As a result of this modification, the method &amp;quot;get_user_list&amp;quot; will now have three parameters (user id, full name, e-mail).&lt;br /&gt;
## To match the search with user fields, we utilize regular expressions, and it should allow for multiple input for comparison.&lt;br /&gt;
## The result will be returned to the controller in @users, and the list view will render it with paginated users once more.&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system when a user goes on Course page to look up for any course, a search box is present. User can add course name to look up any course. Functionality of Advanced search is also present in which user can search for any course based on start date and end date. User can select a filter whether he wants to search via created date filter or updated date filter. User can also select whether he wants course name which has a quiz present or not.&lt;br /&gt;
&lt;br /&gt;
But the issue with the current system is that it may lead to some discrepancies if multiple filters are selected and current system of searching a course does not work on DRY approach. Hence, we propose a new system which is quite like current one just with some additional modifications to make course search more effective and use the DRY approach.&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the user will be able to search a course with the similar advanced search option as previous one, just the back-end code for implementing this functionality will be based on Don’t Repeat Yourself Approach. The part of code which is being reused again and again will be written at just one place and a call will be made to use that functionality.&lt;br /&gt;
To search for a course by date, the user will have a similar drop-down list to choose whether he want to search by created date or updated date. For the date drop down menu, a calendar prompt will be displayed for date selection.&lt;br /&gt;
&lt;br /&gt;
To clear out the discrepancies in applying multiple filters, we implemented the DRY approach and tried to remove as much duplicate code as possible. All the courses that match user preferences in search box will be returned when user search using multiple filters. An empty list will be returned if search criteria is not matched.&lt;br /&gt;
&lt;br /&gt;
====UML Diagram for Course Search====&lt;br /&gt;
[[File:OODD1.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Current system has most of the functionalities implemented already, like Advanced search functionality etc. We will use this code of current system and  optimize this code by using the DRY approach and removing the duplicate and reused code. Hence our implementation first describes the current implementation of various functionalities as described in wiki page of 2021 and then we provide the refactoring of the code.&lt;br /&gt;
&lt;br /&gt;
The implementation of this functionality of advanced search and optimal UI is written in &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;. The functionality of dropdown menu in advanced search has the same format as “User Advanced Search”. The components used for implementing the advanced search functionality are AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE. The React component FilterableTable is used to implement pop-up advanced search functionality.&lt;br /&gt;
#	Fetching and Displaying all the sub-contents when user clicks on a course &lt;br /&gt;
##	The HTTP POST request is sent by getSubFolderData() from FilterableTable component&lt;br /&gt;
##	The state of FilterableTable component is updated after retrieving the data.&lt;br /&gt;
##	An update to ContentTable component is triggered once the state is updated.&lt;br /&gt;
#	Course Search&lt;br /&gt;
##	ContentTable component handles the search method, which filters out courses' names that match the user's input corresponding to each filter as selected by the user.&lt;br /&gt;
&lt;br /&gt;
Refactoring of implementation of above desired functionalities is done in this new proposed system and code duplication is removed. DRY approach has been implemented in this system for Course and assignment search functionality along with advanced search.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
&lt;br /&gt;
====Sequence Diagram====&lt;br /&gt;
[[File:Assigments sequence diagrame.jpeg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The existing system includes search functionality for the following criteria:&lt;br /&gt;
#A text field : where you can search for a keyword within name of  Questionnaire&lt;br /&gt;
#A text field : to search for a keyword or a string In a single question within a questionnaire&lt;br /&gt;
#A text field:For the Course name&lt;br /&gt;
#A text field:For the Assignment name&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply numerous filters at once, and the query's output will match all of them. An empty list will be returned if no results are found..&lt;br /&gt;
&lt;br /&gt;
As a simple search,There is a default search box for the questionnaire's name and if a user wants to apply several filters, user need to press the &amp;quot;Advanced Search&amp;quot; button which is  adjacent to the &amp;quot;Search&amp;quot; button, Also, a hidden field with text boxes for all the columns are being rendered below. A List is being displayed for the questionnaires which matches the search&lt;br /&gt;
&lt;br /&gt;
In the current system for searching for a Questionnaire does not follow the DRY approach. As a result, we suggest a new system that is quite similar to the current one, but with a few tweaks to make the Questionnaire search more effective and to follow the DRY approach.&lt;br /&gt;
&lt;br /&gt;
Proposed System:&lt;br /&gt;
&lt;br /&gt;
The user will be able to search questionnaires in the proposed system using an advanced search option similar to the previous one; however, the back end code for implementing this functionality needs to be refactored by following DRY Approach.In the file: app/assets/javascripts/tree display.jsx  code that is in common for all the searches  needs to be refactored&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
;Rspec Tests Files&lt;br /&gt;
:spec/models/[https://github.com/expertiza/expertiza/blob/beta/spec/models/assignment_spec.rb assignment_spec.rb]&lt;br /&gt;
:spec/models/[https://github.com/expertiza/expertiza/blob/beta/spec/models/response_spec.rb response_spec.rb]&lt;br /&gt;
:spec/models/[https://github.com/expertiza/expertiza/blob/beta/spec/models/user_spec.rb user_spec.rb]&lt;br /&gt;
&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
here's some preliminary points for testing:&lt;br /&gt;
# We are testing only the function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Courses ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Type the search criteria fro the course (name, institution etc) in the available search box and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire.JPG|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Banpreet Singh Chhabra (bchhabr@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144117</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144117"/>
		<updated>2022-04-06T00:10:36Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /*  Lo-fi UI Example  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. It is an open-source application running on Ruby on Rails. It is used for the management of courses and the assignments for respective courses, by the faculties and the students. The manage content section of the application has different views that display information about the users, courses, assignments, questionnaires, and reviews. &lt;br /&gt;
&lt;br /&gt;
The application should have a fully functional search functionality throughout the views, so that a user can search any type of data with ease, on the basis of any number of parameters depending on his requirements. Users should be searched on the basis of one more parameter which includes name, full name, email, etc. Similarly, assignments should be searched on the basis of name, created date, updated date, etc. &lt;br /&gt;
&lt;br /&gt;
However, the search functionality in the existing application is constrained to just a single parameter for users and assignments. Questionnaires management does not have a search functionality implemented as yet. This project works on improving the search functionality of Expertiza, by adding search bars if not present, introducing an advanced search feature where user can search on the basis of more than one parameters, and making the search functionality appear more elegant.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can search for a user by name, user-ID, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for assignments by name, due date, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for rubrics (or other questionnaires) by name, or by the courses or assignments they have been used in.&lt;br /&gt;
##For the instructor, there also needs to be a way to quickly find rubrics (and other questionnaires) that have been used in a single course.  It should be possible to search or click somewhere to bring up a list of questionnaires used in the course, expanding only the applicable questionnaires in the list of questionnaires.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search all reviews of a particular team’s work for particular scores or text strings.  Reviews should be able to be filtered by score, text comment length, reviewer, and reviewee.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a particular user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Some of these searches are currently possible in Expertiza, but the user interface is quite cumbersome.  This is especially true on an instructor’s or administrator’s homepage, where large and confusing search boxes shift the important parts of the page down to the bottom of the screen.  There should be a way to do a simple search by just typing text into an unobtrusive textbox.  If more criteria need to be specified, there should be an “advanced search” button or link that opens up additional textboxes, perhaps in Javascript, that are of reasonable size and do not overwhelm other content on the page.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Our Result ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2079 Previous Implementation ===&lt;br /&gt;
#[https://github.com/prashantyadla/expertiza/tree/beta E2079 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1842 E2079 Pull Request]&lt;br /&gt;
#[https://drive.google.com/file/d/1yr_4b0SsN_J4qGMpZbQLzKXzWAjoX7fV/view. Video Link]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# All implementation are working on javascript inside tree_display.jsx.&lt;br /&gt;
# With compatibility issue, these work can't be check-in currently.&lt;br /&gt;
# Format are not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching of user with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Comments on Previous Implementation ===&lt;br /&gt;
The functionality of this project is quite good, better than any previous attempt.  We have some questions about whether the code is as readable as it should be.&lt;br /&gt;
The appearance of the search pages is now uniform, fixing a problem from the previous project attempt.  However, code is still duplicated, and should be DRYed out.&lt;br /&gt;
Tests &amp;quot;&amp;quot;are just testing the keyword.&amp;quot;&amp;quot; ??&lt;br /&gt;
In the tests, the it clauses say, &amp;quot;&amp;quot;allows certain action&amp;quot;&amp;quot; or &amp;quot;&amp;quot;refuses certain action&amp;quot;&amp;quot;.  They should be more specific!&lt;br /&gt;
Re. the code, there are a lot of changes to big .jsx files that may prove confusing to refactor.  In tree_display.jsx, the _this variable is removed; this seems to be an overlapping edit that will have to be resolved.&lt;br /&gt;
It's in the same repo with their 1st OSS project, which could be a problem.  However, that project was highly rated and should probably be merged too.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
The design proposed in this iteration of the project is not much different from a high level than the design proposed form last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]. Below you will see a similar description of the solution previously proposed and some additional design choices added to improve upon the previous iteration of this issue. Changes from the previous design will be denoted by clear statements indicating the revision.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
In the current system workflow, the Manage Users view can search users by Username, Full name, and email. We will retain these 3 searching criteria, except changing &amp;quot;Username&amp;quot; into &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name&amp;quot;. We will allow searching for fields irrespective of the case of the searched string. The user will be able to apply multiple filters at a time and the output of the query will match all filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
====Implementation====&lt;br /&gt;
User has its own &amp;quot;list&amp;quot; controller, so it will directly implemented in list form with a &amp;quot;_search&amp;quot; html form after apply the search result. Since only this class has rails list, so only this file will implement in ruby code. Our goal is to maintain the logic and search alike.&lt;br /&gt;
# Delete the original simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;&lt;br /&gt;
## Add a render for search form&lt;br /&gt;
## Align the UI for direct user access, which is not part of our project, but to make the page looks similar, we also change the style of it&lt;br /&gt;
## Align the user list table UI with style &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;&lt;br /&gt;
# Add a form in &amp;quot;app/views/users/_search.html.erb&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;Search&amp;quot; button will using style &amp;quot;class='btn btn-primary'&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;text blank&amp;quot; will using the style &amp;quot;class:'form-control'&amp;quot;&lt;br /&gt;
## Advanced Search toggle button is done with javascript (jquery) inside this form individually, and the form is divided into 2 separate field&lt;br /&gt;
### search_button_field: This part should always be displayed&lt;br /&gt;
### advance_search_form: This part should only display after the &amp;quot;Advanced Search&amp;quot; be toggled&lt;br /&gt;
# Add a form input handler in the &amp;quot;users_controller.rb&amp;quot; to parse the form, which should only do parsing and send parameters to model&lt;br /&gt;
# Add a advanced search feature to the User model &amp;quot;user.rb&amp;quot; inside the method &amp;quot;get_user_list&amp;quot;&lt;br /&gt;
## This change will cause this method to take up 3 parameters with (user id, full name, e-mail)&lt;br /&gt;
## We use regular expression to match the search with user fields, and it should allow multiple input for comparison&lt;br /&gt;
## The result will return back to controller in @users, and list view will render it again with paginated users&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system implementation, searching via the name of the course is supported with a partial or complete course name. In the proposed system, the user will be able to search for a course using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for a course by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the courses created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All courses that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.nce.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop-up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The proposed system will implement search functionality for searching via below criteria:&lt;br /&gt;
# Keyword within Name of Questionnaire: A text field&lt;br /&gt;
# Keyword or a string in a single question within a questionnaire: A text field&lt;br /&gt;
# Course Name: A text field for the course name&lt;br /&gt;
# Assignment Name: A text field for the assignment&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply multiple filters at a time and the output of the query will match all the filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
&lt;br /&gt;
There will be a default search box of the name of questionnaire as a simple search, and if a user want to apply multiple filters, the user can tap on the &amp;quot;Advanced Search&amp;quot; button which is adjacent to the &amp;quot;Search&amp;quot; button, and a hidden field will be rendered below-containing text boxes for all the columns. All the matched questionnaires will be listed at once.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lofi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Added ====&lt;br /&gt;
Before checking the code, here's some preliminary:&lt;br /&gt;
# We are testing the only function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire.JPG|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Lofi.jpg&amp;diff=144116</id>
		<title>File:Lofi.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Lofi.jpg&amp;diff=144116"/>
		<updated>2022-04-06T00:07:22Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144115</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=144115"/>
		<updated>2022-04-05T23:59:52Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /*  Lo-fi UI Example  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. It is an open-source application running on Ruby on Rails. It is used for the management of courses and the assignments for respective courses, by the faculties and the students. The manage content section of the application has different views that display information about the users, courses, assignments, questionnaires, and reviews. &lt;br /&gt;
&lt;br /&gt;
The application should have a fully functional search functionality throughout the views, so that a user can search any type of data with ease, on the basis of any number of parameters depending on his requirements. Users should be searched on the basis of one more parameter which includes name, full name, email, etc. Similarly, assignments should be searched on the basis of name, created date, updated date, etc. &lt;br /&gt;
&lt;br /&gt;
However, the search functionality in the existing application is constrained to just a single parameter for users and assignments. Questionnaires management does not have a search functionality implemented as yet. This project works on improving the search functionality of Expertiza, by adding search bars if not present, introducing an advanced search feature where user can search on the basis of more than one parameters, and making the search functionality appear more elegant.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can search for a user by name, user-ID, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for assignments by name, due date, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for rubrics (or other questionnaires) by name, or by the courses or assignments they have been used in.&lt;br /&gt;
##For the instructor, there also needs to be a way to quickly find rubrics (and other questionnaires) that have been used in a single course.  It should be possible to search or click somewhere to bring up a list of questionnaires used in the course, expanding only the applicable questionnaires in the list of questionnaires.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search all reviews of a particular team’s work for particular scores or text strings.  Reviews should be able to be filtered by score, text comment length, reviewer, and reviewee.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a particular user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Some of these searches are currently possible in Expertiza, but the user interface is quite cumbersome.  This is especially true on an instructor’s or administrator’s homepage, where large and confusing search boxes shift the important parts of the page down to the bottom of the screen.  There should be a way to do a simple search by just typing text into an unobtrusive textbox.  If more criteria need to be specified, there should be an “advanced search” button or link that opens up additional textboxes, perhaps in Javascript, that are of reasonable size and do not overwhelm other content on the page.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Our Result ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2079 Previous Implementation ===&lt;br /&gt;
#[https://github.com/prashantyadla/expertiza/tree/beta E2079 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1842 E2079 Pull Request]&lt;br /&gt;
#[https://drive.google.com/file/d/1yr_4b0SsN_J4qGMpZbQLzKXzWAjoX7fV/view. Video Link]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# All implementation are working on javascript inside tree_display.jsx.&lt;br /&gt;
# With compatibility issue, these work can't be check-in currently.&lt;br /&gt;
# Format are not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching of user with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Comments on Previous Implementation ===&lt;br /&gt;
The functionality of this project is quite good, better than any previous attempt.  We have some questions about whether the code is as readable as it should be.&lt;br /&gt;
The appearance of the search pages is now uniform, fixing a problem from the previous project attempt.  However, code is still duplicated, and should be DRYed out.&lt;br /&gt;
Tests &amp;quot;&amp;quot;are just testing the keyword.&amp;quot;&amp;quot; ??&lt;br /&gt;
In the tests, the it clauses say, &amp;quot;&amp;quot;allows certain action&amp;quot;&amp;quot; or &amp;quot;&amp;quot;refuses certain action&amp;quot;&amp;quot;.  They should be more specific!&lt;br /&gt;
Re. the code, there are a lot of changes to big .jsx files that may prove confusing to refactor.  In tree_display.jsx, the _this variable is removed; this seems to be an overlapping edit that will have to be resolved.&lt;br /&gt;
It's in the same repo with their 1st OSS project, which could be a problem.  However, that project was highly rated and should probably be merged too.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
The design proposed in this iteration of the project is not much different from a high level than the design proposed form last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]. Below you will see a similar description of the solution previously proposed and some additional design choices added to improve upon the previous iteration of this issue. Changes from the previous design will be denoted by clear statements indicating the revision.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
In the current system workflow, the Manage Users view can search users by Username, Full name, and email. We will retain these 3 searching criteria, except changing &amp;quot;Username&amp;quot; into &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name&amp;quot;. We will allow searching for fields irrespective of the case of the searched string. The user will be able to apply multiple filters at a time and the output of the query will match all filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
====Implementation====&lt;br /&gt;
User has its own &amp;quot;list&amp;quot; controller, so it will directly implemented in list form with a &amp;quot;_search&amp;quot; html form after apply the search result. Since only this class has rails list, so only this file will implement in ruby code. Our goal is to maintain the logic and search alike.&lt;br /&gt;
# Delete the original simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;&lt;br /&gt;
## Add a render for search form&lt;br /&gt;
## Align the UI for direct user access, which is not part of our project, but to make the page looks similar, we also change the style of it&lt;br /&gt;
## Align the user list table UI with style &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;&lt;br /&gt;
# Add a form in &amp;quot;app/views/users/_search.html.erb&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;Search&amp;quot; button will using style &amp;quot;class='btn btn-primary'&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;text blank&amp;quot; will using the style &amp;quot;class:'form-control'&amp;quot;&lt;br /&gt;
## Advanced Search toggle button is done with javascript (jquery) inside this form individually, and the form is divided into 2 separate field&lt;br /&gt;
### search_button_field: This part should always be displayed&lt;br /&gt;
### advance_search_form: This part should only display after the &amp;quot;Advanced Search&amp;quot; be toggled&lt;br /&gt;
# Add a form input handler in the &amp;quot;users_controller.rb&amp;quot; to parse the form, which should only do parsing and send parameters to model&lt;br /&gt;
# Add a advanced search feature to the User model &amp;quot;user.rb&amp;quot; inside the method &amp;quot;get_user_list&amp;quot;&lt;br /&gt;
## This change will cause this method to take up 3 parameters with (user id, full name, e-mail)&lt;br /&gt;
## We use regular expression to match the search with user fields, and it should allow multiple input for comparison&lt;br /&gt;
## The result will return back to controller in @users, and list view will render it again with paginated users&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system implementation, searching via the name of the course is supported with a partial or complete course name. In the proposed system, the user will be able to search for a course using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for a course by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the courses created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All courses that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.nce.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop-up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The proposed system will implement search functionality for searching via below criteria:&lt;br /&gt;
# Keyword within Name of Questionnaire: A text field&lt;br /&gt;
# Keyword or a string in a single question within a questionnaire: A text field&lt;br /&gt;
# Course Name: A text field for the course name&lt;br /&gt;
# Assignment Name: A text field for the assignment&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply multiple filters at a time and the output of the query will match all the filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
&lt;br /&gt;
There will be a default search box of the name of questionnaire as a simple search, and if a user want to apply multiple filters, the user can tap on the &amp;quot;Advanced Search&amp;quot; button which is adjacent to the &amp;quot;Search&amp;quot; button, and a hidden field will be rendered below-containing text boxes for all the columns. All the matched questionnaires will be listed at once.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:Lo-fi.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Added ====&lt;br /&gt;
Before checking the code, here's some preliminary:&lt;br /&gt;
# We are testing the only function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire.JPG|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Lo-fi.jpg&amp;diff=144114</id>
		<title>File:Lo-fi.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Lo-fi.jpg&amp;diff=144114"/>
		<updated>2022-04-05T23:57:59Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=143918</id>
		<title>CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2233._Improving_search_facility_in_Expertiza&amp;diff=143918"/>
		<updated>2022-04-03T04:01:45Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project takes advantage of peer-review among students to allow them to learn from each other. It is an open-source application running on Ruby on Rails. It is used for the management of courses and the assignments for respective courses, by the faculties and the students. The manage content section of the application has different views that display information about the users, courses, assignments, questionnaires, and reviews. &lt;br /&gt;
&lt;br /&gt;
The application should have a fully functional search functionality throughout the views, so that a user can search any type of data with ease, on the basis of any number of parameters depending on his requirements. Users should be searched on the basis of one more parameter which includes name, full name, email, etc. Similarly, assignments should be searched on the basis of name, created date, updated date, etc. &lt;br /&gt;
&lt;br /&gt;
However, the search functionality in the existing application is constrained to just a single parameter for users and assignments. Questionnaires management does not have a search functionality implemented as yet. This project works on improving the search functionality of Expertiza, by adding search bars if not present, introducing an advanced search feature where user can search on the basis of more than one parameters, and making the search functionality appear more elegant.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
#An instructor or administrator can search for a user by name, user-ID, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for assignments by name, due date, or other characteristics.&lt;br /&gt;
#An instructor should be able to search for rubrics (or other questionnaires) by name, or by the courses or assignments they have been used in.&lt;br /&gt;
##For the instructor, there also needs to be a way to quickly find rubrics (and other questionnaires) that have been used in a single course.  It should be possible to search or click somewhere to bring up a list of questionnaires used in the course, expanding only the applicable questionnaires in the list of questionnaires.&lt;br /&gt;
##One should also be able to search for questionnaires by words used in questions that belong to the questionnaires.&lt;br /&gt;
#There should be a way to search all reviews of a particular team’s work for particular scores or text strings.  Reviews should be able to be filtered by score, text comment length, reviewer, and reviewee.&lt;br /&gt;
#An instructor or administrator should be able to search for all the assignments that a particular user has participated in.&lt;br /&gt;
#If more than one criterion needs to be specified, there should be an 'Advanced Search' button.&lt;br /&gt;
&lt;br /&gt;
Some of these searches are currently possible in Expertiza, but the user interface is quite cumbersome.  This is especially true on an instructor’s or administrator’s homepage, where large and confusing search boxes shift the important parts of the page down to the bottom of the screen.  There should be a way to do a simple search by just typing text into an unobtrusive textbox.  If more criteria need to be specified, there should be an “advanced search” button or link that opens up additional textboxes, perhaps in Javascript, that are of reasonable size and do not overwhelm other content on the page.&lt;br /&gt;
&lt;br /&gt;
=== E2153 Our Result ===&lt;br /&gt;
#[https://github.com/yhslo/expertiza E2153 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2165 E2153 Pull Request]&lt;br /&gt;
#[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2079 Previous Implementation ===&lt;br /&gt;
#[https://github.com/prashantyadla/expertiza/tree/beta E2079 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1842 E2079 Pull Request]&lt;br /&gt;
#[https://drive.google.com/file/d/1yr_4b0SsN_J4qGMpZbQLzKXzWAjoX7fV/view. Video Link]&lt;br /&gt;
&lt;br /&gt;
=== Issue With Previous Implementation ===&lt;br /&gt;
# All implementation are working on javascript inside tree_display.jsx.&lt;br /&gt;
# With compatibility issue, these work can't be check-in currently.&lt;br /&gt;
# Format are not aligned between course search/assignment search and user search/rubric search.&lt;br /&gt;
# Questionnaire search is not straightforward and the list is not working.&lt;br /&gt;
# Searching of user with &amp;quot;name&amp;quot; and &amp;quot;full name&amp;quot; is confusing.&lt;br /&gt;
# Searching criteria can't be accumulated.&lt;br /&gt;
# Instructors and administrators can't find assignments with participants.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Comments on Previous Implementation ===&lt;br /&gt;
The functionality of this project is quite good, better than any previous attempt.  We have some questions about whether the code is as readable as it should be.&lt;br /&gt;
The appearance of the search pages is now uniform, fixing a problem from the previous project attempt.  However, code is still duplicated, and should be DRYed out.&lt;br /&gt;
Tests &amp;quot;&amp;quot;are just testing the keyword.&amp;quot;&amp;quot; ??&lt;br /&gt;
In the tests, the it clauses say, &amp;quot;&amp;quot;allows certain action&amp;quot;&amp;quot; or &amp;quot;&amp;quot;refuses certain action&amp;quot;&amp;quot;.  They should be more specific!&lt;br /&gt;
Re. the code, there are a lot of changes to big .jsx files that may prove confusing to refactor.  In tree_display.jsx, the _this variable is removed; this seems to be an overlapping edit that will have to be resolved.&lt;br /&gt;
It's in the same repo with their 1st OSS project, which could be a problem.  However, that project was highly rated and should probably be merged too.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[https://youtu.be/SxbHz9bp2L0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
The design proposed in this iteration of the project is not much different from a high level than the design proposed form last year in [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]. Below you will see a similar description of the solution previously proposed and some additional design choices added to improve upon the previous iteration of this issue. Changes from the previous design will be denoted by clear statements indicating the revision.&lt;br /&gt;
&lt;br /&gt;
Three main objects in this application are used as the basis for expanding search functionality. These are the user, assignment and questionnaire. Each of these points are searchable by the title of the object or not searchable at all. The remaining sections note the current situation and propose a tentative solution.&lt;br /&gt;
&lt;br /&gt;
===Search for User:===&lt;br /&gt;
In the current system workflow, the Manage Users view can search users by Username, Full name, and email. We will retain these 3 searching criteria, except changing &amp;quot;Username&amp;quot; into &amp;quot;User ID&amp;quot; to avoid confusion with &amp;quot;Full name&amp;quot;. We will allow searching for fields irrespective of the case of the searched string. The user will be able to apply multiple filters at a time and the output of the query will match all filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
====Implementation====&lt;br /&gt;
User has its own &amp;quot;list&amp;quot; controller, so it will directly implemented in list form with a &amp;quot;_search&amp;quot; html form after apply the search result. Since only this class has rails list, so only this file will implement in ruby code. Our goal is to maintain the logic and search alike.&lt;br /&gt;
# Delete the original simple search in &amp;quot;app/views/users/list.html.erb&amp;quot;&lt;br /&gt;
## Add a render for search form&lt;br /&gt;
## Align the UI for direct user access, which is not part of our project, but to make the page looks similar, we also change the style of it&lt;br /&gt;
## Align the user list table UI with style &amp;quot;class=&amp;quot;table table-hover&amp;quot;&amp;quot;&lt;br /&gt;
# Add a form in &amp;quot;app/views/users/_search.html.erb&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;Search&amp;quot; button will using style &amp;quot;class='btn btn-primary'&amp;quot;&lt;br /&gt;
## Note that to align the UI design, the &amp;quot;text blank&amp;quot; will using the style &amp;quot;class:'form-control'&amp;quot;&lt;br /&gt;
## Advanced Search toggle button is done with javascript (jquery) inside this form individually, and the form is divided into 2 separate field&lt;br /&gt;
### search_button_field: This part should always be displayed&lt;br /&gt;
### advance_search_form: This part should only display after the &amp;quot;Advanced Search&amp;quot; be toggled&lt;br /&gt;
# Add a form input handler in the &amp;quot;users_controller.rb&amp;quot; to parse the form, which should only do parsing and send parameters to model&lt;br /&gt;
# Add a advanced search feature to the User model &amp;quot;user.rb&amp;quot; inside the method &amp;quot;get_user_list&amp;quot;&lt;br /&gt;
## This change will cause this method to take up 3 parameters with (user id, full name, e-mail)&lt;br /&gt;
## We use regular expression to match the search with user fields, and it should allow multiple input for comparison&lt;br /&gt;
## The result will return back to controller in @users, and list view will render it again with paginated users&lt;br /&gt;
&lt;br /&gt;
===Search for Courses:===&lt;br /&gt;
In the current system implementation, searching via the name of the course is supported with a partial or complete course name. In the proposed system, the user will be able to search for a course using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for a course by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the courses created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All courses that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.nce.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop-up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Assignments:===&lt;br /&gt;
In the current system implementation, searching via the name of the assignment is supported with a partial or complete assignment name. In the proposed system, the user will be able to search for an assignment using additional filters after they press the Advanced Search button. The filters will have creation date, updated date and a checkbox represent whether it include a quiz. The user could apply multiple filters at a time and the output of the query would match all filters applied.&lt;br /&gt;
&lt;br /&gt;
To search for an assignment by Date, the user will have a drop down list to choose search by created or updated date. The following will prompt with a calendar where he can select a date and all the assignments created/update on or before the selected date will be displayed. &lt;br /&gt;
&lt;br /&gt;
To apply multiple filters, the user can tap on the Advanced Search button available, adjacent to the Search button; a hidden div will then be rendered below-containing text boxes for all the columns. All assignments that match the filters will be returned. An empty list will be returned if the search criteria don't match any records in the database.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search&amp;quot;. By using AdditionalSearchDropDown, DatePicker, and HASQUIZ_TOGGLE components, we build a pop up advanced search functionality in React component FilterableTable.&lt;br /&gt;
# Searching for courses&lt;br /&gt;
## The searching method is handled by ContentTable component, which filters out courses' names that match the user's input.&lt;br /&gt;
&lt;br /&gt;
Due to the similarity of course search and assignment search, they share the same code in FilterableTable component.&lt;br /&gt;
&lt;br /&gt;
===Search for Questionnaires:===&lt;br /&gt;
The proposed system will implement search functionality for searching via below criteria:&lt;br /&gt;
# Keyword within Name of Questionnaire: A text field&lt;br /&gt;
# Keyword or a string in a single question within a questionnaire: A text field&lt;br /&gt;
# Course Name: A text field for the course name&lt;br /&gt;
# Assignment Name: A text field for the assignment&lt;br /&gt;
&lt;br /&gt;
The user will be able to apply multiple filters at a time and the output of the query will match all the filters applied. If no results are found, an empty list will be returned.&lt;br /&gt;
&lt;br /&gt;
There will be a default search box of the name of questionnaire as a simple search, and if a user want to apply multiple filters, the user can tap on the &amp;quot;Advanced Search&amp;quot; button which is adjacent to the &amp;quot;Search&amp;quot; button, and a hidden field will be rendered below-containing text boxes for all the columns. All the matched questionnaires will be listed at once.&lt;br /&gt;
====Implementation====&lt;br /&gt;
This part is solely listed within the file &amp;quot;app/assets/javascripts/tree_display.jsx&amp;quot;, so we can only implement this part with javascript. The interactive dropdown advanced search code will maintain the same format as &amp;quot;User Advanced Search.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Getting sub-contents when a user press on a course&lt;br /&gt;
## The getSubFolderData() from FilterableTable will send HTTP POST request.&lt;br /&gt;
## After retrieving the data, it will update the state of FilterableTable component.&lt;br /&gt;
## Once the state is updated, it will trigger an update to ContentTable component and rerender the component.&lt;br /&gt;
#Searching for questionnaire&lt;br /&gt;
## The searching method is handled by FilterableTable component. Once the search button is pressed, it filters all the sub-contents from every questionnaire category based on the user input.&lt;br /&gt;
## handleQuestionnaireSearchChange() in FilterableTable component keeps track of the search input field. It will trigger an update when the input field has been cleared.&lt;br /&gt;
&lt;br /&gt;
=== ''' Lo-fi UI Example ''' ===&lt;br /&gt;
[[File:42660.jpg|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
=== ''' Flowchart ''' ===&lt;br /&gt;
[[File:Flowchart.jpg|750px|center]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Rspec Unit Tests === &lt;br /&gt;
Automated tests can be written to test the following functionalities:&lt;br /&gt;
# Given an unfiltered search result which should show all&lt;br /&gt;
# Given a filtered search, the result renders a list of objects containing the filtered search item&lt;br /&gt;
# Given an invalid search, an empty list returns&lt;br /&gt;
RSpec tests will be written to cover the depth of each test point above for all four search objects mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
==== Code Snippet Added ====&lt;br /&gt;
Before checking the code, here's some preliminary:&lt;br /&gt;
# We are testing the only function that related to the search function in model/user.rb which is used to output search result&lt;br /&gt;
# get_user_list(arg1, arg2, arg3), where (arg1, arg2, arg3) represents (userid, full name, email)&lt;br /&gt;
# For each test, we are trying to find the users with &amp;quot;keyword&amp;quot;, that is, if there is user with the keyword in selected field, it should return in the list, otherwise null.&lt;br /&gt;
# For each test, we also checked the search function with multiple input, that is, with or without either userid, full name or email.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# spec/models/user_spec.rb&lt;br /&gt;
context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abcd&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when current user is super admin and search by user full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbcd&amp;quot;, &amp;quot;&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbcd@gmail.com&amp;quot;)).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;&amp;quot;)).to eq([user1, user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot; bbc&amp;quot;, &amp;quot;abcbbe@gmail.com&amp;quot;)).to eq([user2])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current user is super admin and search by user name, full name and email' do&lt;br /&gt;
      it 'fetches all users with abc' do&lt;br /&gt;
        allow(user).to receive_message_chain(&amp;quot;role.super_admin?&amp;quot;) { true }&lt;br /&gt;
        expect(user.get_user_list(&amp;quot;abc&amp;quot;, &amp;quot;abc bbc&amp;quot;, &amp;quot;abcbbc@gmail.com&amp;quot;)).to eq([user1])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
UI tests will be performed to reproduce the behavior previously mentioned. These steps were reproduced from the previously proposed solution for this issue.&lt;br /&gt;
Please pair with our [https://youtu.be/SxbHz9bp2L0 Demo Video] to confirm our testing&lt;br /&gt;
==== Search for User ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Users&lt;br /&gt;
# Type the search string in the search box available on the UI and select the column to search for from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the specified criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Assignment ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assignments&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
==== Search for Questionnaire ====&lt;br /&gt;
# Log into expertiza to view the home page&lt;br /&gt;
# Go to Manage &amp;gt; Questionnaires&lt;br /&gt;
# Type the search criteria in the available search criteria and select the appropriate field from the dropdown.&lt;br /&gt;
# To perform a search based on multiple filters, the user can tap on the Advanced Search button adjacent to the Search button, the view renders a hidden div containing text boxes for all the columns, allowing the user to search based on multiple columns.&lt;br /&gt;
# All the entries that match the given criteria will be returned.&lt;br /&gt;
# An empty list is returned if the search criteria don't match any valid records in the database.&lt;br /&gt;
&lt;br /&gt;
== Resulting Snapshots ==&lt;br /&gt;
The following screenshots show before and after an advanced search for courses, assignments, and users.&lt;br /&gt;
&lt;br /&gt;
You can also watch [https://youtu.be/SxbHz9bp2L0 the demo video here]&lt;br /&gt;
&lt;br /&gt;
=== User Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:User_BeforeEdit.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the page of USER search UI. The second picture shows the USER page that search by userid, name and e-mail.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:User_BeforeAdv.png|700px]]&lt;br /&gt;
[[File:User_AfterMultiSrch.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Course Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Course-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of COURSE searching UI. The second picture shows the searching result that search by created date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Course.JPG|700px]]&lt;br /&gt;
[[File:Course-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Assignment Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Assignment-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of ASSIGNMENT searching UI. The second picture shows the searching result that search by updated date.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment.JPG|700px]]&lt;br /&gt;
[[File:Assignment-date.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Questionnaire Search UI ===&lt;br /&gt;
&amp;lt;li&amp;gt;Before Change&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Questionnaire-origin.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;After Change&amp;lt;/li&amp;gt;&lt;br /&gt;
The first picture shows the main page of questionnaire searching UI. The second picture shows the questionnaire searching page with advance search and detail of review questionnaire.&lt;br /&gt;
Note that it doesn't necessarily need all parameters to search. One can search with one or two or all parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Questionnaire.JPG|700px]]&lt;br /&gt;
[[File:Questionnaire-open.JPG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
&lt;br /&gt;
Ed Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Vishnu Challa (vchalla2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Sujith Tumma (stumma2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Indu Chenchala (ichench@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza Fall 2021 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1987._Improving_search_facility_in_Expertiza Fall 2019 Design]&lt;br /&gt;
#[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2020_-_E2079._Improve_Search_Facility_In_Expertiza Fall 2020 Design]&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://relishapp.com/rspec RSpec Documentation]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143344</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143344"/>
		<updated>2022-03-21T23:23:25Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143301</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143301"/>
		<updated>2022-03-21T22:40:11Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are two checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because for saving a new question there is no need to check for the QuizQuestionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; has been removed. Explanation is given above in the three  checks for QuizQuestionnaire Problem 3&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143249</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143249"/>
		<updated>2022-03-21T21:56:18Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; has been removed. Explanation is given above in the three  checks for QuizQuestionnaire Problem 3&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143239</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143239"/>
		<updated>2022-03-21T21:41:41Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem: There are three checks for whether a question is a QuizQuestionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; has been removed. Explanation is given above in the three  checks for QuizQuestionnaire Problem 3&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143237</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143237"/>
		<updated>2022-03-21T21:41:15Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem: There are three checks for whether a question is a QuizQuestionnaire */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.====&lt;br /&gt;
&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; has been removed. Explanation is given above in the three  checks for QuizQuestionnaire Problem 3&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143125</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143125"/>
		<updated>2022-03-21T04:08:27Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on refactoring &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; by sanding down rough edges of code throughthe removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used==== &lt;br /&gt;
&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method and its corresponding test has been removed because it was not used anywhere.&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long====&lt;br /&gt;
*'''Solution''':&amp;lt;code&amp;gt;@questionnaire&amp;lt;/code&amp;gt; initialization was moved to a new method called &amp;lt;code&amp;gt;initialize_values&amp;lt;/code&amp;gt;. The questionnaire node initialization was moved to &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Initialize values.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Create questionnaire node.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;====&lt;br /&gt;
These checks are likely unnecessary, and testing the class of an object carries potential problems.&lt;br /&gt;
*'''Solution''': The first check was located in the &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; and has been deleted along with the method.&lt;br /&gt;
&lt;br /&gt;
*'''Solution''': &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.===&lt;br /&gt;
&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;====&lt;br /&gt;
Although these fields are okay to default to the given values, these should be defined constants&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter====&lt;br /&gt;
Although not functionally broken, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; has been removed. Explanation is given above in the three  checks for QuizQuestionnaire Problem 3&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;questionnaires_controller_spec.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*Check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.&lt;br /&gt;
&lt;br /&gt;
*Explore if &amp;lt;code&amp;gt;create_questionnaire_node&amp;lt;/code&amp;gt; can be moved to the &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt; class&lt;br /&gt;
&lt;br /&gt;
*Explore moving &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; initialization into the &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt; model.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
Link to Expertiza repository: [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to the forked repository: [https://github.com/War-Keeper/expertiza here]&lt;br /&gt;
&lt;br /&gt;
Link to Pull Request: [https://github.com/expertiza/expertiza/pull/2320 here]&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2216:_Refactor_late_policies_controller&amp;diff=143038</id>
		<title>CSC/ECE 517 Spring 2022 - E2216: Refactor late policies controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2216:_Refactor_late_policies_controller&amp;diff=143038"/>
		<updated>2022-03-20T16:26:13Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2216: Refactoring late_policies_controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
 Write a short description of the project&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''':All the late policies will show up on the index page, not just policies created by the current instructor. Need to create public &amp;amp; private late policies. Try to leverage code for private and public courses, assignments, and questionnaires.==== &lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':create and update have some duplicate code. Fix that using a partial, _form.====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Both create and update need comments and a better identifier naming.====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Reduce code duplication. Find a way to make the code more DRY.====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Line 64: The if condition can be simplified. ====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Improve the variable name for same_policy_name. (Boolean variables can be named in a better way). ====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Add method comments. ====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''':Find the use of instance variables in create and update method? Do we really need it? Can it be made local variables instead? ====&lt;br /&gt;
&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
(Add modified files and list of changes here)&lt;br /&gt;
== Testing ==&lt;br /&gt;
(Add any testing that were added)&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/late_policies_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
(Add pull request link here)&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143031</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143031"/>
		<updated>2022-03-20T15:34:01Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Future Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on sanding down the rough edges of &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; through the removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used.&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;.==== &lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long, and needs to be broken up====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;. These checks are likely unnecessary, and testing the class of an object carries potential problems.====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;. Although these fields are okay to default to the given values, these should be defined constants====&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice====&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
(Add modified files and list of changes here)&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
check for &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; has been removed.explore moving ScoredQuestion initialization into the scored_question model&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
GitHub link: https://github.com/expertiza/expertiza/pull/2320&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143016</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=143016"/>
		<updated>2022-03-20T04:00:37Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem: Several bad if statements exist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on sanding down the rough edges of &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; through the removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used.&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;.==== &lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long, and needs to be broken up====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;. These checks are likely unnecessary, and testing the class of an object carries potential problems.====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;. Although these fields are okay to default to the given values, these should be defined constants====&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice====&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is not a QuizQuestionnaire is not necessary so this line has been removed because the for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Line 190 : &amp;lt;code&amp;gt;if question.is_a? ScoredQuestion&amp;lt;/code&amp;gt; check for ScoredQuestion has been removed.Also hardcoded the minlabel and max label values from &amp;lt;code&amp;gt;question.max_label = 'Strongly agree'&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;question.min_label = 'Strongly disagree'&amp;lt;/code&amp;gt; to &lt;br /&gt;
&amp;lt;code&amp;gt;question.max_label = ScoredQuestion::DEFAULT_MAX_AGREEMENT&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;question.min_label = ScoredQuestion::DEFAULT_MIN_AGREEMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:score.png]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
(Add modified files and list of changes here)&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
GitHub link: https://github.com/expertiza/expertiza/pull/2320&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Score.png&amp;diff=143015</id>
		<title>File:Score.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Score.png&amp;diff=143015"/>
		<updated>2022-03-20T04:00:13Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Scored.png&amp;diff=143014</id>
		<title>File:Scored.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Scored.png&amp;diff=143014"/>
		<updated>2022-03-20T03:57:45Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=142985</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=142985"/>
		<updated>2022-03-18T04:14:28Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem: Several bad if statements exist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on sanding down the rough edges of &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; through the removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used.&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;.==== &lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long, and needs to be broken up====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;. These checks are likely unnecessary, and testing the class of an object carries potential problems.====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;. Although these fields are okay to default to the given values, these should be defined constants====&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice====&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because the for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
[[File:266_check.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
(Add modified files and list of changes here)&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
GitHub link: https://github.com/expertiza/expertiza/pull/2320&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:266_check.JPG&amp;diff=142984</id>
		<title>File:266 check.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:266_check.JPG&amp;diff=142984"/>
		<updated>2022-03-18T04:13:57Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check.JPG&amp;diff=142983</id>
		<title>File:Line 91 check.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check.JPG&amp;diff=142983"/>
		<updated>2022-03-18T04:13:05Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=142982</id>
		<title>CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2217:_Refactor_questionnaires_controller&amp;diff=142982"/>
		<updated>2022-03-18T04:06:33Z</updated>

		<summary type="html">&lt;p&gt;Ichench: /* Problem: Several bad if statements exist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the changes made for the Spring 2022 OSS Project E2217: Refactoring Questionnaires Controller&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This project focused on sanding down the rough edges of &amp;lt;code&amp;gt;questionnaires_controller.rb&amp;lt;/code&amp;gt; through the removal of the unused ''create_questionnaire'' method, breaking up the exceedingly long ''create'' method, transfer of hardcoded values in the ''add_new_questions'' method, and general code cleanup.&lt;br /&gt;
&lt;br /&gt;
== Problems and Solutions ==&lt;br /&gt;
===='''Problem''': The &amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; method is not used.&amp;lt;code&amp;gt;create_questionnaire&amp;lt;/code&amp;gt; has no immediate apparent calls, and appears to have the same functionality as &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt;.==== &lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
==== '''Problem''': The &amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; method is 49 lines long, and needs to be broken up====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are three checks for whether a question is a &amp;lt;code&amp;gt;QuizQuestionnaire&amp;lt;/code&amp;gt;. These checks are likely unnecessary, and testing the class of an object carries potential problems.====&lt;br /&gt;
*'''Solution''':&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': There are assignment values hardwired into the code in &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt;. Although these fields are okay to default to the given values, these should be defined constants====&lt;br /&gt;
*'''Solution''': As these values related to &amp;lt;code&amp;gt;ScoredQuestion&amp;lt;/code&amp;gt; items, constants were created in &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;add_new_questions&amp;lt;/code&amp;gt; now uses these class constants when assigning default values for fields. These values are all changeable in the UI after initialization.&lt;br /&gt;
&lt;br /&gt;
Addition of constants to &amp;lt;code&amp;gt;scored_question.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
[[File:Scored_question_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several methods have a &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; as a parameter, this may be unnecessary in several situations where &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; would suffice====&lt;br /&gt;
*'''Solution''': Where applicable, &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; was changed to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt;. This was done in methods where &amp;lt;code&amp;gt;params[:id].nil?&amp;lt;/code&amp;gt; was not called, and in methods where &amp;lt;code&amp;gt;questionnaire_id = params[:id]&amp;lt;/code&amp;gt; was called &lt;br /&gt;
&lt;br /&gt;
Change of &amp;lt;code&amp;gt;questionnaire_id&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;params[:id]&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;save_all_questions&amp;lt;/code&amp;gt;:&lt;br /&gt;
[[File:save_all_questions_changes.png]]&lt;br /&gt;
&lt;br /&gt;
===='''Problem''': Several bad &amp;lt;var&amp;gt;if&amp;lt;/var&amp;gt; statements exist====&lt;br /&gt;
*'''Solution''': Line 96:  &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot; &amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because the QuizQuestionnaire is same as the other questionnaire types.&lt;br /&gt;
[[File:Line_91_check_quizquestionanire.png]]&lt;br /&gt;
&lt;br /&gt;
Line 244 &amp;amp; 266 : &amp;lt;code&amp;gt;if @questionnaire.type != &amp;quot;QuizQuestionnaire&amp;quot;&amp;lt;/code&amp;gt; checking if it is a QuizQuestionnaire is not necessary so this line has been removed because the for saving a new question there is no need to check for the QuizQuestionnaire and weights used in this check are not used anywhere.&lt;br /&gt;
[[File:Bad_if_quiz.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Modified Files ==&lt;br /&gt;
(Add modified files and list of changes here)&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec ./spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
GitHub link: https://github.com/expertiza/expertiza/pull/2320&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Bad_if_quiz.JPG&amp;diff=142981</id>
		<title>File:Bad if quiz.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Bad_if_quiz.JPG&amp;diff=142981"/>
		<updated>2022-03-18T04:03:04Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check_quizquestionanire.png&amp;diff=142980</id>
		<title>File:Line 91 check quizquestionanire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check_quizquestionanire.png&amp;diff=142980"/>
		<updated>2022-03-18T03:39:42Z</updated>

		<summary type="html">&lt;p&gt;Ichench: Ichench uploaded a new version of File:Line 91 check quizquestionanire.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check_quizquestionanire.png&amp;diff=142979</id>
		<title>File:Line 91 check quizquestionanire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Line_91_check_quizquestionanire.png&amp;diff=142979"/>
		<updated>2022-03-18T03:36:23Z</updated>

		<summary type="html">&lt;p&gt;Ichench: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ichench</name></author>
	</entry>
</feed>